--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+<!--
+ Jalview Checkstyle configuration file
+-->
+<module name="Checker">
+ <!-- Default severity is warning -->
+ <property name="severity" value="warning"/>
+ <property name="fileExtensions" value="java,properties"/>
+
+ <!--
+ Add any metrics that you wish to suppress to the following file.
+ -->
+ <module name="SuppressionFilter">
+ <property name="file" value="${basedir}/resources/checkstyle/checkstyle-suppress.xml"/>
+ </module>
+
+ <!--
+ Allow suppression of rules by comments, e.g.:
+ // CHECKSTYLE.OFF: ParameterNumber
+ ..method declaration
+ // CHECKSTYLE.ON: ParameterNumber
+ -->
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
+ <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+
+ <!--
+ Maximum line count for source files
+ -->
+ <module name="FileLength">
+ <property name="max" value="1200"/>
+ <property name="fileExtensions" value="java"/>
+ </module>
+
+ <!--
+ Check language bundles have the same keys and no duplicates
+ (ensure Checkstyle is configured to scan non-source files)
+ -->
+ <module name="Translation">
+ <property name="fileExtensions" value="properties"/>
+ <property name="baseName" value="^Messages.*$"/>
+ </module>
+ <module name="UniqueProperties">
+ <property name="fileExtensions" value="properties" />
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="TreeWalker">
+
+ <property name="tabWidth" value="4"/>
+
+ <!--
+ Enables parsing of suppressions comments
+ see http://checkstyle.sourceforge.net/config_filters.html#SuppressionCommentFilter
+ -->
+ <module name="FileContentsHolder"/>
+
+ <!-- ****************************** -->
+ <!-- NAMING STANDARDS -->
+ <!-- ****************************** -->
+
+ <!--
+ Naming convention for member fields. Start with (optional) underscore, then
+ lower case, then camel case; no internal underscores
+ -->
+ <module name="MemberName">
+ <property name="format" value="^_?[a-z][a-zA-Z0-9]*$"/>
+ </module>
+
+ <!--
+ Naming convention for methods. Start with (optional) underscore, then
+ lower case, then camel case; no internal underscores
+ -->
+ <module name="MethodName">
+ <property name="format" value="^_?[a-z]([a-zA-Z0-9]+)*$"/>
+ </module>
+
+ <!--
+ Name pattern for local final variables.
+ -->
+ <module name="LocalFinalVariableName">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ </module>
+
+ <!--
+ Name pattern for local variables
+ -->
+ <module name="LocalVariableName">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ </module>
+
+ <!--
+ Name pattern for constants (static final fields)
+ -->
+ <module name="ConstantName">
+ <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
+ </module>
+
+ <!--
+ Name pattern for parameters (note no underscores allowed)
+ -->
+ <module name="ParameterName">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ </module>
+
+ <!--
+ Name pattern for static (non-final) fields
+ -->
+ <module name="StaticVariableName">
+ <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
+ </module>
+
+ <!--
+ Name pattern for classes
+ -->
+ <module name="TypeName">
+ <property name="format" value="[A-Z][a-zA-Z0-9]*$"/>
+ <property name="tokens" value="CLASS_DEF"/>
+ </module>
+
+ <!--
+ Name pattern for interfaces. All interfaces names must end with 'I'.
+ ** currently suppressed in checkstyle-suppress.xml **
+ -->
+ <module name="TypeName">
+ <property name="id" value="InterfaceNaming"/>
+ <property name="format" value="^[A-Z][a-zA-Z0-9]*I$"/>
+ <property name="tokens" value="INTERFACE_DEF"/>
+ <message key="name.invalidPattern" value="Interface names should end in a I"/>
+ </module>
+
+ <!--
+ Java package name pattern
+ -->
+ <module name="PackageName">
+ <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+ </module>
+
+ <!-- ****************************** -->
+ <!-- LAYOUT AND STYLE -->
+ <!-- ****************************** -->
+
+ <!--
+ Only one top level type per source file
+ -->
+ <module name="OuterTypeNumber"/>
+
+ <!--
+ Ensure a class has a package declaration
+ -->
+ <module name="PackageDeclaration"/>
+
+ <!--
+ see http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-141855.html#1852
+ 1. Class (static) variables: public, protected, package, private
+ 2. Instance variables: public, protected, package, private
+ 3. Constructors
+ 4. Methods
+ -->
+ <module name="DeclarationOrder"/>
+
+ <!--
+ Modifier order should conform to JLS
+ see http://checkstyle.sourceforge.net/config_modifier.html#ModifierOrder
+ public protected private abstract static final transient volatile synchronized native strictfp
+ -->
+ <module name="ModifierOrder"/>
+
+ <!--
+ Declare variables in separate statements, for readability and bug avoidance
+ -->
+ <module name="MultipleVariableDeclarations"/>
+
+ <!--
+ Only use blocks within control statements
+ -->
+ <module name="AvoidNestedBlocks"/>
+
+ <!--
+ Require at least a comment within a block.
+ Note this will accept auto-generated // TODO comments,
+ (but they should be flagged up by the TodoComment rule)
+ -->
+ <module name="EmptyBlock">
+ <property name="option" value="text"/>
+ </module>
+
+ <!--
+ Require braces round all code blocks within if/else/for/do/while
+ -->
+ <module name="NeedBraces"/>
+
+ <!--
+ Disallow empty ';' statements
+ -->
+ <module name="EmptyStatement"/>
+
+ <!--
+ Maximum number of return statements for a method
+ -->
+ <module name="ReturnCount">
+ <property name="max" value="4"/>
+ </module>
+
+ <!--
+ Don't use modifiers in contexts where their value is not optional,
+ for example all interface methods are always public
+ see http://checkstyle.sourceforge.net/config_modifier.html#RedundantModifier
+ -->
+ <module name="RedundantModifier"/>
+
+ <!--
+ Variables whose value is not modified should be declared final, both to show the
+ program's intent, and to allow compiler optimisation
+ ** currently suppressed in checkstyle-suppress.xml **
+ -->
+ <module name="FinalLocalVariable">
+ <property name="tokens" value="VARIABLE_DEF" />
+ </module>
+
+ <!--
+ Disallows shorthand of assigning values within an expression
+ -->
+ <module name="InnerAssignment"/>
+
+ <!--
+ Use Java style array declarations to assist in readability
+ -->
+ <module name="ArrayTypeStyle"/>
+
+ <!--
+ Use L not l to define a long constant
+ -->
+ <module name="UpperEll"/>
+
+ <!-- ****************************** -->
+ <!-- SIZE LIMITS -->
+ <!-- ****************************** -->
+
+ <!--
+ Maximum line count for methods
+ -->
+ <module name="MethodLength">
+ <property name="tokens" value="METHOD_DEF"/>
+ <property name="max" value="50"/>
+ <property name="countEmpty" value="false"/>
+ </module>
+
+ <!--
+ Maximum statement count for methods, constructors,
+ instance initialisation and static initialisation blocks
+ -->
+ <module name="ExecutableStatementCount">
+ <property name="max" value="30"/>
+ <property name="tokens" value="METHOD_DEF"/>
+ </module>
+ <module name="ExecutableStatementCount">
+ <property name="max" value="30"/>
+ <property name="tokens" value="CTOR_DEF"/>
+ </module>
+ <module name="ExecutableStatementCount">
+ <property name="max" value="4"/>
+ <property name="tokens" value="INSTANCE_INIT"/>
+ </module>
+ <module name="ExecutableStatementCount">
+ <property name="id" value="NoStaticInitialization"/>
+ <property name="max" value="0"/>
+ <property name="tokens" value="STATIC_INIT"/>
+ </module>
+
+ <!--
+ Maximum parameter count for methods
+ -->
+ <module name="ParameterNumber">
+ <property name="max" value="5"/>
+ </module>
+
+ <!--
+ Maximum line length for anonymous inner classes
+ -->
+ <module name="AnonInnerLength">
+ <property name="max" value="40"/>
+ </module>
+
+ <!-- ****************************** -->
+ <!-- IMPORTS -->
+ <!-- ****************************** -->
+
+ <!--
+ Ensures that there are no redundant or unused imports.
+ Should be handled by Save actions if using Eclipse
+ -->
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+
+ <!--
+ Disallow * imports; may also be enforced by IDE Save Actions
+ -->
+ <module name="AvoidStarImport"/>
+
+ <!--
+ Disallow import of sun.* packages as they are not portable
+ -->
+ <module name="IllegalImport"/>
+
+ <!--
+ rules as to what packages each package may (not) import
+ see http://checkstyle.sourceforge.net/config_imports.html#ImportControl
+ -->
+ <module name="ImportControl">
+ <property name="file" value="${basedir}/resources/checkstyle/import-control.xml"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- ****************************** -->
+ <!-- CATCH and THROW -->
+ <!-- ****************************** -->
+
+ <!--
+ Disallow catch of Exception, RunTimeException or Error
+ -->
+ <module name="IllegalCatch"/>
+
+ <!--
+ Disallow throw of Exception, RunTimeException or Error
+ -->
+ <module name="IllegalThrows"/>
+
+ <!-- ****************************** -->
+ <!-- CODING CHECKS -->
+ <!-- ****************************** -->
+
+ <!--
+ Check for use of factory method rather than constructor for specified classes
+ -->
+ <module name="IllegalInstantiation">
+ <property name="classes" value="java.lang.Boolean"/>
+ </module>
+
+ <!--
+ Check that "string".equals(value) is used rather than value.equals("string")
+ -->
+ <module name="EqualsAvoidNull"/>
+
+ <!--
+ Check that equals() and hashCode() are always overridden together
+ -->
+ <module name="EqualsHashCode"/>
+
+ <!--
+ Require switch statements to include a default
+ -->
+ <module name="MissingSwitchDefault"/>
+
+ <!--
+ Check that switch default follows all case statements
+ -->
+ <module name="DefaultComesLast">
+ <property name="severity" value="error"/>
+ </module>
+
+ <!--
+ Disallows fall-through in switch statements i.e. a case without a break, return, throw or continue
+ upgrade this to error once AnnotationRenderer is recoded!
+ -->
+ <module name="FallThrough">
+ <property name="severity" value="warning"/>
+ </module>
+
+ <!--
+ Warn if boolean expressions can be simplified
+ -->
+ <module name="SimplifyBooleanExpression"/>
+
+ <!--
+ Warn if boolean return expressions can be simplified
+ -->
+ <module name="SimplifyBooleanReturn"/>
+
+ <!--
+ Classes with only private constructors should be declared final
+ -->
+ <module name="FinalClass"/>
+
+ <!--
+ Classes with only static methods should not be instantiable,
+ so should declare a private default constructor.
+ -->
+ <module name="HideUtilityClassConstructor"/>
+
+ <!--
+ An Interface should declare methods (do not use to define constants only)
+ -->
+ <module name="InterfaceIsType"/>
+
+ <!--
+ Disallow public fields in classes (other than constants)
+ -->
+ <module name="VisibilityModifier">
+ <property name="packageAllowed" value="true"/>
+ <property name="allowPublicImmutableFields" value="true"/>
+ </module>
+
+ <!--
+ Checks that a local variable or a parameter does not shadow a field that is defined in the same class.
+ Note this should also be configured as a compiler warning in the IDE.
+ -->
+ <module name="HiddenField"/>
+
+ <!--
+ Check that proper logging is used and never printing to System.out.
+ This may be suppressed in the class that provides logging functions.
+ -->
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="System\.out\.println"/>
+ <property name="ignoreComments" value="true"/>
+ </module>
+
+ <!--
+ Checks that classes that define a covariant equals() method also override
+ method equals(java.lang.Object).
+ -->
+ <module name="CovariantEquals"/>
+
+ <!--
+ Checks that there are no "magic numbers" (numeric literals)
+ -->
+ <module name="MagicNumber">
+ <property name="ignoreNumbers" value="-1,0,1,2"/>
+ </module>
+
+ <!--
+ Check that loop control variables are not modified inside the for block
+ -->
+ <module name="ModifiedControlVariable">
+ </module>
+
+ <!--
+ Checks that string literals are not used with == or !=.
+ -->
+ <module name="StringLiteralEquality">
+ </module>
+
+ <!--
+ Checks that clone() invokes super.clone()
+ -->
+ <module name="SuperClone"/>
+
+ <!--
+ Checks that finalize() invokes super.finalize()
+ -->
+ <module name="SuperFinalize"/>
+
+ <!--
+ Disallow assignment of parameters.
+ -->
+ <module name="ParameterAssignment"/>
+
+ <!--
+ Checks for multiple occurrences of the same string literal within a single file.
+ NB - does not check for the same string in different files.
+ -->
+ <module name="MultipleStringLiterals">
+ <property name="allowedDuplicates" value="1"/>
+ </module>
+
+ <!--
+ Checks that exceptions are immutable (have only final fields)
+ -->
+ <module name="MutableException"/>
+
+ <!-- ****************************** -->
+ <!-- COMPLEXITY -->
+ <!-- ****************************** -->
+
+ <!--
+ Restrict the number of number of &&, ||, &, | and ^ in an expression.
+ Note that the operators & and | are not only integer bitwise operators, they are also the
+ non-shortcut versions of the boolean operators && and ||.
+ -->
+ <module name="BooleanExpressionComplexity">
+ <property name="max" value="3"/>
+ </module>
+
+ <!--
+ This metric measures the number of instantiations of other classes within the given class.
+ The higher the DAC, the more complex the data structure of the system.
+ -->
+ <module name="ClassDataAbstractionCoupling">
+ <property name="max" value="7"/>
+ </module>
+
+ <!--
+ The number of other classes a class relies on. A high number indicates over-complex
+ class interdependencies that might benefit from refactoring.
+ -->
+ <module name="ClassFanOutComplexity">
+ <property name="max" value="10"/>
+ </module>
+
+ <!--
+ Checks cyclomatic complexity against a specified limit. The complexity is a measure
+ of the minimum number of possible paths through the source and therefore the number of required
+ tests. Consider re-factoring if at or above 10.
+ -->
+ <module name="CyclomaticComplexity">
+ <property name="max" value="15"/>
+ </module>
+
+ <!--
+ The NPATH metric computes the number of possible execution paths through a function. It takes
+ into account the nesting of conditional statements and multi-part boolean expressions
+ (e.g., A && B, C || D, etc.).
+ -->
+ <module name="NPathComplexity">
+ <property name="max" value="200"/>
+ </module>
+
+ <!--
+ Maximum number of throws statements in a method
+ -->
+ <module name="ThrowsCount">
+ <property name="max" value="2"/>
+ </module>
+
+ <!--
+ Maximum if-else depth
+ -->
+ <module name="NestedIfDepth">
+ <property name="max" value="4"/>
+ </module>
+
+ <!--
+ Restricts nested try blocks to a specified depth.
+ -->
+ <module name="NestedTryDepth">
+ <property name="max" value="2"/>
+ </module>
+
+ <!-- ****************************** -->
+ <!-- TODO -->
+ <!-- ****************************** -->
+
+ <!--
+ Checks for uncommented main() methods (debugging leftovers)
+ -->
+ <module name="UncommentedMain"/>
+
+ <!--
+ Check for TODO and similar comments
+ -->
+ <module name="TodoComment">
+ <property name="format" value="(TODO)|(FIXME)|(DOCUMENT ME)"/>
+ </module>
+
+ </module>
+</module>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE import-control PUBLIC
+ "-//Puppy Crawl//DTD Import Control 1.1//EN"
+ "http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
+
+ <!--
+ see http://checkstyle.sourceforge.net/config_imports.html#ImportControl
+ allow/disallow rules propagate to sub-packages
+ unless local-only="true" is specified
+
+ note this can handle only one top-level package, so ImportControl is
+ suppressed for MCview and vamsas in checkstyle-suppress.xml
+ (all rules are suppressed for com/ext/org/uk)
+ -->
+ <import-control pkg="jalview">
+
+ <allow pkg="java"/>
+ <allow pkg="jalview"/>
+ <allow pkg="com.stevesoft.pat"/>
+
+ <subpackage name="appletgui">
+ <disallow pkg="jalview.gui"/>
+ <disallow pkg="jalview.ws"/>
+ <allow pkg="org.jmol"/>
+ <allow pkg="javajs.awt" class="jalview.appletgui.AppletJmolBinding"/>
+ </subpackage>
+
+ <subpackage name="bin">
+ <allow pkg="groovy"/>
+ <allow pkg="org.apache.log4j" class="jalview.bin.Cache"/>
+ <allow pkg="javax.swing" class="jalview.bin.Jalview"/>
+ <allow pkg="netscape.javascript" class="jalview.bin.JalviewLite"/>
+ </subpackage>
+
+ <subpackage name="datamodel">
+ <disallow pkg="jalview.gui"/>
+ <allow pkg="fr.orsay.lri.varna"/>
+ </subpackage>
+
+ <subpackage name="datamodel.xdb.embl">
+ <allow pkg="org.exolab.castor"/>
+ </subpackage>
+
+ <subpackage name="fts">
+ <allow pkg="javax.swing"/>
+ <allow pkg="javax.ws"/>
+ <allow pkg="org.json"/>
+ <allow pkg="com.sun.jersey"/>
+ </subpackage>
+
+ <subpackage name="gui">
+ <allow pkg="javax.swing"/>
+ <allow pkg="javax.help"/>
+ <allow pkg="javax.imageio"/>
+ <allow pkg="ext.edu.ucsf"/>
+ <allow pkg="net.miginfocom"/>
+ <allow pkg="org.jibble"/>
+ <allow pkg="org.jmol"/>
+ <allow pkg="org.openscience"/>
+ <allow pkg="org.exolab.castor" class="jalview.gui.Jalview2XML"/>
+ <allow pkg="org.robsite" class="jalview.gui.BlogReader"/>
+ <allow pkg="org.apache.log4j" class="jalview.gui.Console"/>
+ <allow pkg="org.apache.log4j" class="jalview.gui.JalviewAppender"/>
+ <allow pkg="org.biodas" class="jalview.gui.DasSourceBrowser"/>
+ <allow pkg="compbio.metadata" class="jalview.gui.WsJobParameters"/>
+ <allow pkg="fr.orsay.lri.varna" class="jalview.gui.AppVarna"/>
+ <allow pkg="fr.orsay.lri.varna" class="jalview.gui.AppVarnaBinding"/>
+ <allow pkg="uk.ac.vamsas" class="jalview.gui.VamsasApplication"/>
+ </subpackage>
+
+ <subpackage name="jbgui">
+ <allow pkg="javax.swing"/>
+ <allow pkg="net.miginfocom"/>
+ </subpackage>
+
+ <subpackage name="httpserver">
+ <allow pkg="javax.servlet"/>
+ <allow pkg="org.eclipse.jetty"/>
+ </subpackage>
+
+ <subpackage name="io">
+ <allow pkg="javax.swing"/>
+ <allow pkg="org.jfree"/>
+ <allow pkg="org.json"/>
+ <allow pkg="org.jsoup"/>
+ <allow pkg="uk.ac.ebi"/>
+ <allow pkg="uk.ac.vamsas"/>
+ <allow pkg="fr.orsay.lri.varna"/>
+ <allow pkg="MCview"/>
+ </subpackage>
+
+ <subpackage name="javascript">
+ <allow pkg="netscape.javascript"/>
+ </subpackage>
+
+ <subpackage name="rest">
+ <allow pkg="javax.servlet"/>
+ </subpackage>
+
+ <subpackage name="structure">
+ <allow pkg="MCview"/>
+ </subpackage>
+
+ <subpackage name="util">
+ <allow pkg="javax.swing"/>
+ <allow pkg="javax.imageio"/>
+ <allow pkg="org.jfree"/>
+ <allow pkg="org.jibble"/>
+ </subpackage>
+
+ <subpackage name="ws">
+ <allow pkg="javax.swing"/>
+ <allow pkg="javax.xml"/>
+ <allow pkg="ext.vamsas"/>
+ <allow pkg="compbio"/>
+ <allow pkg="MCview"/>
+ <allow pkg="org.apache.http"/>
+ <allow pkg="org.apache.james"/>
+ <allow pkg="org.apache.axis"/>
+ <allow pkg="org.biodas.jdas"/>
+ <allow pkg="org.exolab.castor"/>
+ <allow pkg="uk.ac.ebi"/>
+ <allow pkg="vamsas.objects"/>
+ </subpackage>
+
+ </import-control>
\ No newline at end of file