Groovy Documentation
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _

A

AbcComplexityAstVisitor - Class in org.codenarc.rule.size
AbcComplexityRule - Class in org.codenarc.rule.size
Rule that calculates the ABC Complexity for methods/classes and checks against configured threshold values.
AbstractAstVisitor - Class in org.codenarc.rule
Abstract superclass for Groovy AST Visitors used with Rules
AbstractAstVisitorRule - Class in org.codenarc.rule
Abstract superclass for Rules that use a Groovy AST Visitor.
AbstractClassNameAstVisitor - Class in org.codenarc.rule.naming
AbstractClassNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the name of an abstract class matches a regular expression specified in the regex property.
AbstractClassWithoutAbstractMethodAstVisitor - Class in org.codenarc.rule.design
AbstractClassWithoutAbstractMethodRule - Class in org.codenarc.rule.design
The abstract class does not contain any abstract methods.
AbstractConstructorCallAstVisitor - Class in org.codenarc.rule
Abstract superclass for AST Visitor classes that deal with constructor calls
AbstractFinallyAstVisitor - Class in org.codenarc.rule.basic
Abstract superclass for AST Visitor classes that check for conditions within a finally block
AbstractLastStatementInBlockAstVisitor - Class in org.codenarc.rule.unused
Abstract superclass for AstVisitor classes that need to determine whether a Statement is the last statement within a block.
AbstractMethodMetricAstVisitor - Class in org.codenarc.rule.size
Abstract superclass for AstVisitor classes that use method-level GMetrics Metrics.
AbstractMethodMetricAstVisitor() - Constructor in AbstractMethodMetricAstVisitor
AbstractReportWriter - Class in org.codenarc.report
Abstract superclass for ReportWriter implementation classes.
AbstractRule - Class in org.codenarc.rule
Abstract superclass for Rules.
AbstractSourceCode - Class in org.codenarc.source
Abstract superclass for SourceCode implementations
AbstractTypeNameAstVisitor - Class in org.codenarc.rule.naming
Abstract superclass for AstVisitor classes dealing with class/type names, e.g. classes, interfaces and abstract classes.
addChild(Results) - Method in DirectoryResults
addConfiguredOption(ReportOption) - Method in Report
addConfiguredReport(Report) - Method in CodeNarcTask
Ant-defined method (by convention), called with each instance of a nested element within this task.
AddEmptyStringAstVisitor - Class in org.codenarc.rule.basic
AddEmptyStringRule - Class in org.codenarc.rule.basic
Finds empty string literals which are being added.
addExclude(String) - Method in FilteredRuleSet
Add an exclude criteria.
addFileset(FileSet) - Method in CodeNarcTask
addInclude(String) - Method in FilteredRuleSet
Add an include criteria.
addRule(Rule) - Method in CompositeRuleSet
Add a single Rule to this RuleSet
addRuleSet(RuleSet) - Method in CompositeRuleSet
Add all of the Rules within the specified RuleSet to this RuleSet
addViolation(Violation) - Method in AbstractAstVisitor
Add a new Violation to the list of violations found by this visitor.
addViolationOnMismatch(String, String) - Method in InconsistentPropertyLockingAstVisitor
addViolationOnMismatch(String, String) - Method in InconsistentPropertySynchronizationAstVisitor
AnalysisContext - Class in org.codenarc
Holds information related to the configuration and context for the source code analysis.
analyze(RuleSet) - Method in AntFileSetSourceAnalyzer
Analyze all source code using the specified RuleSet and return the report results.
analyze(RuleSet) - Method in DirectorySourceAnalyzer
Analyze the source with the configured directory tree(s) using the specified RuleSet and return the report results.
analyze(RuleSet) - Method in FilesystemSourceAnalyzer
Analyze the source with the configured directory tree(s) using the specified RuleSet and return the report results.
analyze(RuleSet) - Method in SourceAnalyzer
Analyze all source code using the specified RuleSet and return the report results.
analyze(RuleSet) - Method in StringSourceAnalyzer
AntFileSetSourceAnalyzer - Class in org.codenarc.ant
SourceAnalyzer implementation that gets source files from one or more Ant FileSets.
AntFileSetSourceAnalyzer(Project, List) - Constructor in AntFileSetSourceAnalyzer
Construct a new instance on the specified List of Ant FileSets.
applyTo(SourceCode, List) - Method in AbstractAstVisitorRule
applyTo(SourceCode) - Method in AbstractRule
Apply this rule to the specified source and return a list of violations (or an empty List).
applyTo(SourceCode, List) - Method in DuplicateImportRule
applyTo(SourceCode, List) - Method in IllegalRegexRule
applyTo(SourceCode, List) - Method in ImportFromSamePackageRule
applyTo(SourceCode, List) - Method in RequiredRegexRule
applyTo(SourceCode, List) - Method in RequiredStringRule
applyTo(SourceCode) - Method in Rule
Apply this rule to the specified source and return a list of violations (or an empty List)
applyTo(SourceCode, List) - Method in UnnecessaryGroovyImportRule
applyTo(SourceCode, List) - Method in UnnecessarySemicolonRule
applyTo(SourceCode, List) - Method in UnusedImportRule
applyTo(SourceCode, List) - Method in UnusedPrivateFieldRule
applyTo(SourceCode, List) - Method in UnusedPrivateMethodParameterRule
applyTo(SourceCode, List) - Method in UnusedPrivateMethodRule
applyTo(SourceCode, List) - Method in UnusedVariableRule
areJoinableConstants(Expression, Expression) - Method in ConsecutiveUtils
ArrayReturnTracker - Class in org.codenarc.rule.basic
assertClassImplementsRuleInterface(Class) - Method in RuleSetUtil
AssertionTrap - Class in org.codenarc.rule.junit
Visits code searching for assert statements or assert.* method calls.
AssignmentInConditionalAstVisitor - Class in org.codenarc.rule.basic
AssignmentInConditionalRule - Class in org.codenarc.rule.basic
An assignment operator (=) was used in a conditional test.
AstUtil - Class in org.codenarc.util
Contains static utility methods related to Groovy AST.
AstVisitor - Interface in org.codenarc.rule
Interface for Groovy AST Visitors used with Rules

B

BASE_MESSAGES_BUNDLE - Field in AbstractReportWriter
baseDir - Field in CodeNarc
BigDecimalInstantiationAstVisitor - Class in org.codenarc.rule.basic
BigDecimalInstantiationRule - Class in org.codenarc.rule.basic
Rule that checks for calls to the BigDecimal constructor with a double or float literal.
BOOLEAN_CLASS - Field in AbstractAstVisitor
BooleanGetBooleanAstVisitor - Class in org.codenarc.rule.basic
BooleanGetBooleanRule - Class in org.codenarc.rule.basic
This rule catches usages of java.lang.Boolean.getBoolean(String) which reads a boolean from the System properties.
BooleanMethodReturnsNullAstVisitor - Class in org.codenarc.rule.basic
BooleanMethodReturnsNullRule - Class in org.codenarc.rule.basic
Method with Boolean return type returns explicit null.
BooleanReturnTracker - Class in org.codenarc.rule.basic
BrokenOddnessCheckAstVisitor - Class in org.codenarc.rule.basic
BrokenOddnessCheckRule - Class in org.codenarc.rule.basic
The code uses x % 2 == 1 to check to see if a value is odd, but this won't work for negative numbers (e.g., (-5) % 2 == -1).
buildFileElement(FileResults) - Method in XmlReportWriter
buildMessageElement(Violation) - Method in XmlReportWriter
buildPackageAttributeMap(def) - Method in XmlReportWriter
buildPackageElement(def) - Method in XmlReportWriter
buildPackageElements(def) - Method in XmlReportWriter
buildProjectElement(AnalysisContext) - Method in XmlReportWriter
buildReportElement() - Method in XmlReportWriter
buildRulesElement(AnalysisContext) - Method in InlineXmlReportWriter
buildRulesElement(AnalysisContext) - Method in XmlReportWriter
buildSortedListOfAllRules() - Method in GenerateUtil
buildSourceLineElement(Violation) - Method in XmlReportWriter
buildViolationElement(Violation) - Method in InlineXmlReportWriter
buildViolationElement(Violation) - Method in XmlReportWriter
BusyWaitAstVisitor - Class in org.codenarc.rule.concurrency
BusyWaitRule - Class in org.codenarc.rule.concurrency
Busy waiting (forcing a Thread.sleep() while waiting on a condition) should be avoided.

C

CatchArrayIndexOutOfBoundsExceptionRule - Class in org.codenarc.rule.exceptions
Rule that checks for catching a ArrayIndexOutOfBoundsException
CatchErrorRule - Class in org.codenarc.rule.exceptions
Rule that checks for catching a Error
CatchExceptionRule - Class in org.codenarc.rule.exceptions
Rule that checks for catching a Exception
CatchIllegalMonitorStateExceptionRule - Class in org.codenarc.rule.exceptions
Rule to trap when IllegalMonitorStateException is being caught.
CatchIndexOutOfBoundsExceptionRule - Class in org.codenarc.rule.exceptions
Rule that checks for catching a IndexOutOfBoundsException
CatchNullPointerExceptionRule - Class in org.codenarc.rule.exceptions
Rule that checks for catching a NullPointerException
CatchRuntimeExceptionRule - Class in org.codenarc.rule.exceptions
Rule that checks for catching a RuntimeException
CatchThrowableRule - Class in org.codenarc.rule.exceptions
Rule that checks for catching a Throwable
cdata(String) - Method in XmlReportWriter
ChainedTestAstVisitor - Class in org.codenarc.rule.junit
ChainedTestRule - Class in org.codenarc.rule.junit
A test method that invokes another test method is a chained test; the methods are dependent on one another.
ClassNameAstVisitor - Class in org.codenarc.rule.naming
ClassNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the name of a class matches a regular expression.
classNodeImplementsType(ClassNode, Class) - Method in AstUtil
This method tells you if a ClassNode implements or extends a certain class.
ClassPathResource - Class in org.codenarc.util.io
A Resource implementation for resources available on the classpath.
ClassPathResource(String) - Constructor in ClassPathResource
Construct a new ClassPathResource
path:
- the path to the resource (file).
ClassSizeAstVisitor - Class in org.codenarc.rule.size
ClassSizeRule - Class in org.codenarc.rule.size
Rule that checks the size of a class.
CloneableWithoutCloneAstVisitor - Class in org.codenarc.rule.basic
CloneableWithoutCloneRule - Class in org.codenarc.rule.basic
A class that implements Cloneable should define a clone() method.
CloseWithoutCloseableAstVisitor - Class in org.codenarc.rule.design
CloseWithoutCloseableRule - Class in org.codenarc.rule.design
If a class defines a "void close()" then that class should implement java.io.Closeable.
CodeNarc - Class in org.codenarc
Command-line runner for CodeNarc.
CODENARC_URL - Field in AbstractReportWriter
CodeNarcRunner - Class in org.codenarc
Helper class to run CodeNarc.
CodeNarcTask - Class in org.codenarc.ant
Ant Task for running CodeNarc.
CollectionReturnTracker - Class in org.codenarc.rule.basic
CommonCatchAstVisitor - Class in org.codenarc.rule.exceptions
AstVisitor implementation that checks for catching an exception type specified in the constructor

This is an internal class and its API is subject to change.

CommonCatchAstVisitor(String) - Constructor in CommonCatchAstVisitor
Construct a new instance, specifying the exception class name
CommonThrowAstVisitor - Class in org.codenarc.rule.exceptions
AstVisitor implementation that checks for throwing one of the exception type names specified in the constructor

This is an internal class and its API is subject to change.

CommonThrowAstVisitor(List) - Constructor in CommonThrowAstVisitor
Construct a new instance, specifying the exception type names
CompareToWithoutComparableAstVisitor - Class in org.codenarc.rule.basic
CompareToWithoutComparableRule - Class in org.codenarc.rule.basic
If you implement a compareTo method then you should also implement the Comparable interface.
CompositeRuleSet - Class in org.codenarc.ruleset
A RuleSet implementation that aggregates a set of RuleSets and Rules.
configure(RuleSet) - Method in PropertiesFileRuleSetConfigurer
Configure the rules within the RuleSet from the properties file (relative to the classpath).
ConfusingClassNamedExceptionAstVisitor - Class in org.codenarc.rule.exceptions
ConfusingClassNamedExceptionRule - Class in org.codenarc.rule.exceptions
This rule traps classes named exception that do not inherit from exception.
ConfusingMethodNameAstVisitor - Class in org.codenarc.rule.naming
ConfusingMethodNameRule - Class in org.codenarc.rule.naming
This rule traps the condition where two methods or closures differ only by their capitalization.
ConfusingTernaryAstVisitor - Class in org.codenarc.rule.basic
ConfusingTernaryRule - Class in org.codenarc.rule.basic
In an "if" expression with an "else" clause, avoid negation in the test.
ConsecutiveLiteralAppendsAstVisitor - Class in org.codenarc.rule.basic
ConsecutiveLiteralAppendsRule - Class in org.codenarc.rule.basic
Violations occur when method calls to append(Object) are chained together with literals as parameters.
ConsecutiveStringConcatenationAstVisitor - Class in org.codenarc.rule.basic
ConsecutiveStringConcatenationRule - Class in org.codenarc.rule.basic
Catches concatenation of two string literals on the same line.
ConsecutiveUtils - Class in org.codenarc.util
Utility class for Consecutive* rules.
CONSTANT_EXPRESSION_VALUES - Field in AbstractAstVisitor
ConstantIfExpressionAstVisitor - Class in org.codenarc.rule.basic
ConstantIfExpressionRule - Class in org.codenarc.rule.basic
Rule that checks for if statement with a constant value for the if expression, such as:
ConstantsOnlyInterfaceAstVisitor - Class in org.codenarc.rule.design
ConstantsOnlyInterfaceRule - Class in org.codenarc.rule.design
An interface should be used only to model a behaviour of a class: using an interface as a container of constants is a poor usage pattern.
ConstantTernaryExpressionAstVisitor - Class in org.codenarc.rule.basic
ConstantTernaryExpressionRule - Class in org.codenarc.rule.basic
Rule that checks for ternary expressions with a constant value for the boolean expression, such as:
CONTROLLERS_AND_TAGLIB_FILES - Field in GrailsUtil
CONTROLLERS_CLASSES - Field in GrailsUtil
CONTROLLERS_FILES - Field in GrailsUtil
CoupledTestCaseAstVisitor - Class in org.codenarc.rule.junit
CoupledTestCaseRule - Class in org.codenarc.rule.junit
This rule finds test cases that are coupled to other test cases, either by invoking static methods on another test case or by creating instances of another test case.
createCodeNarcRunner - Field in CodeNarc
createCodeNarcRunner - Field in CodeNarcTask
createMetric() - Method in AbcComplexityAstVisitor
createMetric() - Method in AbstractMethodMetricAstVisitor
createMetric() - Method in CyclomaticComplexityAstVisitor
createRuleSet() - Method in CodeNarcRunner
Create and return the RuleSet that provides the source of Rules to be applied.
createSourceAnalyzer() - Method in CodeNarc
Create and return the SourceAnalyzer
createSourceAnalyzer() - Method in CodeNarcTask
Create and return the SourceAnalyzer
createViolation(SourceCode, ASTNode, def) - Method in AbstractRule
Create a new Violation for the AST node.
createViolationForImport(SourceCode, String, String) - Method in AbstractRule
Create and return a new Violation for this rule and the specified import className and alias
CUSTOM_MESSAGES_BUNDLE - Field in AbstractReportWriter
customMessagesBundleName - Field in AbstractReportWriter
CyclomaticComplexityAstVisitor - Class in org.codenarc.rule.size
CyclomaticComplexityRule - Class in org.codenarc.rule.size
Rule that calculates the Cyclomatic Complexity for methods/classes and checks against configured threshold values.

D

DeadCodeAstVisitor - Class in org.codenarc.rule.basic
DeadCodeRule - Class in org.codenarc.rule.basic
Dead code appears after a return statement or an exception is thrown.
DEFAULT_CONST_NAME - Field in AbstractAstVisitorRule
DEFAULT_FIELD_NAME - Field in AbstractAstVisitorRule
DEFAULT_OUTPUT_FILE - Field in HtmlReportWriter
DEFAULT_TEST_CLASS_NAMES - Field in AbstractAstVisitorRule
DEFAULT_TEST_FILES - Field in AbstractAstVisitorRule
DEFAULT_VAR_NAME - Field in AbstractAstVisitorRule
defaultPropertiesFilename - Field in PropertiesFileRuleSetConfigurer
DefaultResourceFactory - Class in org.codenarc.util.io
Default implementation of ResourceFactory.
description(String) - Method in TopLevelDelegate
DirectoryResults - Class in org.codenarc.results
Represents the results for a directory
DirectoryResults(String) - Constructor in DirectoryResults
Create a new instance with the specified path
DirectorySourceAnalyzer - Class in org.codenarc.analyzer
SourceAnalyzer implementation that recursively processes files in the configured source directories.
dispatchToIfWithoutSuper(IfStatement) - Method in InvertedIfElseAstVisitor
DoubleCheckedLockingAstVisitor - Class in org.codenarc.rule.concurrency
DoubleCheckedLockingRule - Class in org.codenarc.rule.concurrency
This rule detects double checked locking, where a 'lock hint' is tested for null before initializing an object within a synchronized block.
DoubleNegativeAstVisitor - Class in org.codenarc.rule.basic
DoubleNegativeRule - Class in org.codenarc.rule.basic
There is no point in using a double negative, it is always positive.
DuplicateCaseStatementAstVisitor - Class in org.codenarc.rule.basic
DuplicateCaseStatementRule - Class in org.codenarc.rule.basic
Rule that checks for duplicate case statements in a switch block, such as two equal integers or strings.
DuplicateImportRule - Class in org.codenarc.rule.imports
Rule that checks for a duplicate import
DuplicateLiteralAstVisitor - Class in org.codenarc.rule.dry
Abstract superclass for rule AstVisitor classes that detect duplicate literal constants
DuplicateLiteralAstVisitor(Class, Set) - Constructor in DuplicateLiteralAstVisitor
DuplicateNumberLiteralRule - Class in org.codenarc.rule.dry
Checks for duplication of constant number literal values.
DuplicateStringLiteralRule - Class in org.codenarc.rule.dry
Code containing duplicate String literals can usually be improved by declaring the String as a constant field.

E

ElseBlockBracesAstVisitor - Class in org.codenarc.rule.braces
ElseBlockBracesRule - Class in org.codenarc.rule.braces
Rule that checks that else blocks use braces rather than a single statement.
EmptyCatchBlockAstVisitor - Class in org.codenarc.rule.basic
EmptyCatchBlockRule - Class in org.codenarc.rule.basic
Rule that checks for empty catch blocks
EmptyElseBlockAstVisitor - Class in org.codenarc.rule.basic
EmptyElseBlockRule - Class in org.codenarc.rule.basic
Rule that checks for empty else blocks
EmptyFinallyBlockAstVisitor - Class in org.codenarc.rule.basic
EmptyFinallyBlockRule - Class in org.codenarc.rule.basic
Rule that checks for empty finally blocks
EmptyForStatementAstVisitor - Class in org.codenarc.rule.basic
EmptyForStatementRule - Class in org.codenarc.rule.basic
Rule that checks for empty for statements
EmptyIfStatementAstVisitor - Class in org.codenarc.rule.basic
EmptyIfStatementRule - Class in org.codenarc.rule.basic
Rule that checks for empty if statements
EmptyInstanceInitializerAstVisitor - Class in org.codenarc.rule.basic
EmptyInstanceInitializerRule - Class in org.codenarc.rule.basic
The class has an empty instance initializer.
EmptyMethodAstVisitor - Class in org.codenarc.rule.basic
EmptyMethodInAbstractClassAstVisitor - Class in org.codenarc.rule.design
EmptyMethodInAbstractClassRule - Class in org.codenarc.rule.design
An empty method in an abstract class should be abstract instead, as developer may rely on this empty implementation rather than code the appropriate one.
EmptyMethodRule - Class in org.codenarc.rule.basic
A method was found without an implementation.
EmptyStaticInitializerAstVisitor - Class in org.codenarc.rule.basic
EmptyStaticInitializerRule - Class in org.codenarc.rule.basic
An empty static initializer was found.
EmptySwitchStatementAstVisitor - Class in org.codenarc.rule.basic
EmptySwitchStatementRule - Class in org.codenarc.rule.basic
Rule that checks for empty switch statements
EmptySynchronizedStatementAstVisitor - Class in org.codenarc.rule.basic
EmptySynchronizedStatementRule - Class in org.codenarc.rule.basic
Rule that checks for empty synchronized statement
EmptyTryBlockAstVisitor - Class in org.codenarc.rule.basic
EmptyTryBlockRule - Class in org.codenarc.rule.basic
Rule that checks for empty try blocks
EmptyWhileStatementAstVisitor - Class in org.codenarc.rule.basic
EmptyWhileStatementRule - Class in org.codenarc.rule.basic
Rule that checks for empty while statements
EqualsAndHashCodeAstVisitor - Class in org.codenarc.rule.basic
EqualsAndHashCodeRule - Class in org.codenarc.rule.basic
Rule that checks that if either the boolean equals(Object) or the int hashCode() methods are overridden within a class, then both must be overridden.
ExceptionExtendsErrorAstVisitor - Class in org.codenarc.rule.exceptions
ExceptionExtendsErrorRule - Class in org.codenarc.rule.exceptions
Errors are system exceptions.
exclude(String) - Method in RuleSetDelegate
excludes - Field in CodeNarc
execute(String) - Method in CodeNarc
execute() - Method in CodeNarcRunner
The main entry point for this class.
execute() - Method in CodeNarcTask
Execute this Ant Task
ExplicitArrayListInstantiationRule - Class in org.codenarc.rule.basic
This rule checks for the explicit instantiation of an ArrayList using the no-arg constructor.
ExplicitCallToAndMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToAndMethodAstVisitor() - Constructor in ExplicitCallToAndMethodAstVisitor
ExplicitCallToAndMethodRule - Class in org.codenarc.rule.basic
This rule detects when the and(Object) method is called directly in code instead of using the & operator.
ExplicitCallToCompareToMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToCompareToMethodAstVisitor() - Constructor in ExplicitCallToCompareToMethodAstVisitor
ExplicitCallToCompareToMethodRule - Class in org.codenarc.rule.basic
This rule detects when the compareTo(Object) method is called directly in code instead of using the <=>, >, >=, <, and <= operators.
ExplicitCallToDivMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToDivMethodAstVisitor() - Constructor in ExplicitCallToDivMethodAstVisitor
ExplicitCallToDivMethodRule - Class in org.codenarc.rule.basic
This rule detects when the div(Object) method is called directly in code instead of using the / operator.
ExplicitCallToEqualsMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToEqualsMethodAstVisitor() - Constructor in ExplicitCallToEqualsMethodAstVisitor
ExplicitCallToEqualsMethodRule - Class in org.codenarc.rule.basic
This rule detects when the equals(Object) method is called directly in code instead of using the == or !
ExplicitCallToGetAtMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToGetAtMethodAstVisitor() - Constructor in ExplicitCallToGetAtMethodAstVisitor
ExplicitCallToGetAtMethodRule - Class in org.codenarc.rule.basic
This rule detects when the getAt(Object) method is called directly in code instead of using the [] index operator.
ExplicitCallToLeftShiftMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToLeftShiftMethodAstVisitor() - Constructor in ExplicitCallToLeftShiftMethodAstVisitor
ExplicitCallToLeftShiftMethodRule - Class in org.codenarc.rule.basic
This rule detects when the leftShift(Object) method is called directly in code instead of using the << operator.
ExplicitCallToMethodAstVisitor - Class in org.codenarc.rule.basic
Parent Visitor for "ExplicitCallToX" Rules.
ExplicitCallToMethodAstVisitor(String) - Constructor in ExplicitCallToMethodAstVisitor
The method name to watch for.
ExplicitCallToMinusMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToMinusMethodAstVisitor() - Constructor in ExplicitCallToMinusMethodAstVisitor
ExplicitCallToMinusMethodRule - Class in org.codenarc.rule.basic
This rule detects when the minus(Object) method is called directly in code instead of using the - operator.
ExplicitCallToModMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToModMethodAstVisitor() - Constructor in ExplicitCallToModMethodAstVisitor
ExplicitCallToModMethodRule - Class in org.codenarc.rule.basic
This rule detects when the mod(Object) method is called directly in code instead of using the % operator.
ExplicitCallToMultiplyMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToMultiplyMethodAstVisitor() - Constructor in ExplicitCallToMultiplyMethodAstVisitor
ExplicitCallToMultiplyMethodRule - Class in org.codenarc.rule.basic
This rule detects when the multiply(Object) method is called directly in code instead of using the * operator.
ExplicitCallToOrMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToOrMethodAstVisitor() - Constructor in ExplicitCallToOrMethodAstVisitor
ExplicitCallToOrMethodRule - Class in org.codenarc.rule.basic
This rule detects when the or(Object) method is called directly in code instead of using the | operator.
ExplicitCallToPlusMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToPlusMethodAstVisitor() - Constructor in ExplicitCallToPlusMethodAstVisitor
ExplicitCallToPlusMethodRule - Class in org.codenarc.rule.basic
This rule detects when the plus(Object) method is called directly in code instead of using the + operator.
ExplicitCallToPowerMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToPowerMethodAstVisitor() - Constructor in ExplicitCallToPowerMethodAstVisitor
ExplicitCallToPowerMethodRule - Class in org.codenarc.rule.basic
This rule detects when the power(Object) method is called directly in code instead of using the ** operator.
ExplicitCallToRightShiftMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToRightShiftMethodAstVisitor() - Constructor in ExplicitCallToRightShiftMethodAstVisitor
ExplicitCallToRightShiftMethodRule - Class in org.codenarc.rule.basic
This rule detects when the rightShift(Object) method is called directly in code instead of using the >> operator.
ExplicitCallToXorMethodAstVisitor - Class in org.codenarc.rule.basic
ExplicitCallToXorMethodAstVisitor() - Constructor in ExplicitCallToXorMethodAstVisitor
ExplicitCallToXorMethodRule - Class in org.codenarc.rule.basic
This rule detects when the xor(Object) method is called directly in code instead of using the ^ operator.
ExplicitGarbageCollectionAstVisitor - Class in org.codenarc.rule.basic
ExplicitGarbageCollectionRule - Class in org.codenarc.rule.basic
Calls to System.gc(), Runtime.getRuntime().gc(), and System.runFinalization() are not advised.
ExplicitHashMapInstantiationRule - Class in org.codenarc.rule.basic
This rule checks for the explicit instantiation of a HashMap using the no-arg constructor.
ExplicitHashSetInstantiationRule - Class in org.codenarc.rule.basic
This rule checks for the explicit instantiation of a HashSet using the no-arg constructor.
ExplicitLinkedListInstantiationRule - Class in org.codenarc.rule.basic
This rule checks for the explicit instantiation of a LinkedList using the no-arg constructor.
ExplicitStackInstantiationRule - Class in org.codenarc.rule.basic
This rule checks for the explicit instantiation of a Stack using the no-arg constructor.
ExplicitTreeSetInstantiationRule - Class in org.codenarc.rule.basic
This rule checks for the explicit instantiation of a TreeSet using the no-arg constructor.
ExplicitTypeInstantiationAstVisitor - Class in org.codenarc.rule.basic
AstVisitor that checks for no-arg constructor calls for the type specified in the constructor.
ExplicitTypeInstantiationAstVisitor(String) - Constructor in ExplicitTypeInstantiationAstVisitor

F

FieldNameAstVisitor - Class in org.codenarc.rule.naming
FieldNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the name of each field matches a regular expression.
FileResults - Class in org.codenarc.results
Represents the results of applying a set of rules against a single sourcefile
FileResults(String, List) - Constructor in FileResults
fileSets - Field in AntFileSetSourceAnalyzer
fileSets - Field in CodeNarcTask
FilesystemSourceAnalyzer - Class in org.codenarc.analyzer
SourceAnalyzer implementation that recursively processes files from the file system.
FilteredRuleSet - Class in org.codenarc.ruleset
A RuleSet implementation that is a Decorator for another RuleSet, but provides the ability to filter included and excluded rules within that RuleSet.
FilteredRuleSet(RuleSet) - Constructor in FilteredRuleSet
Construct a new instance on the specified RuleSet
FinalClassWithProtectedMemberAstVisitor - Class in org.codenarc.rule.design
FinalClassWithProtectedMemberRule - Class in org.codenarc.rule.design
This rule finds classes marked final that contain protected methods and fields.
findResultsForPath(String) - Method in DirectoryResults
Return the Results object with the specified path within this directory or its descendents.
findResultsForPath(String) - Method in FileResults
Return the Results object with the specified path.
findResultsForPath(String) - Method in Results
Return the Results object with the specified path within this results object or its descendents.
findResultsForPath(String) - Method in VirtualResults
formatSourceLine(String, int) - Method in HtmlReportWriter
Format and trim the source line.
ForStatementBracesAstVisitor - Class in org.codenarc.rule.braces
ForStatementBracesRule - Class in org.codenarc.rule.braces
Rule that checks that for statements use braces rather than a single statement.

G

GenerateAll - Class in org.codenarc.tool
Java application (main() method) that invokes all of the Generate* scripts.
GenerateCodeNarcRulesProperties - Class in org.codenarc.tool
Java application (main() method) that generates the 'codenarc-base-rules.properties' properties file.
GenerateRuleIndexPage - Class in org.codenarc.tool
Java application (main() method) that generates the "codenarc-rule-index.apt.template" file.
GenerateRuleSetAllRules - Class in org.codenarc.tool
Java application (main() method) that generates the "StarterRuleSet-AllRules.groovy.txt.template" file.
GenerateRuleSetAllRulesByCategory - Class in org.codenarc.tool
Java application (main() method) that generates the "StarterRuleSet-AllRulesByCategory.groovy.txt.template" file.
GenerateUtil - Class in org.codenarc.tool
Contains static utility methods related to the Generate* tools.
getAnnotation(AnnotatedNode, String) - Method in AstUtil
Return the AnnotationNode for the named annotation, or else null.
getArgumentNames(MethodCallExpression) - Method in AstUtil
Gets the argument names of a method call.
getAst() - Method in AbstractSourceCode
Return the Groovy AST (Abstract Syntax Tree) for this source file
getAst() - Method in GMetricsSourceCodeAdapter
getAst() - Method in SourceCode
Return the Groovy AST (Abstract Syntax Tree) for this source file
getAstVisitor() - Method in AbstractAstVisitorRule
getAstVisitor() - Method in CatchArrayIndexOutOfBoundsExceptionRule
getAstVisitor() - Method in CatchErrorRule
getAstVisitor() - Method in CatchExceptionRule
getAstVisitor() - Method in CatchIllegalMonitorStateExceptionRule
getAstVisitor() - Method in CatchIndexOutOfBoundsExceptionRule
getAstVisitor() - Method in CatchNullPointerExceptionRule
getAstVisitor() - Method in CatchRuntimeExceptionRule
getAstVisitor() - Method in CatchThrowableRule
getAstVisitor() - Method in DuplicateNumberLiteralRule
getAstVisitor() - Method in DuplicateStringLiteralRule
getAstVisitor() - Method in ExplicitArrayListInstantiationRule
getAstVisitor() - Method in ExplicitHashMapInstantiationRule
getAstVisitor() - Method in ExplicitHashSetInstantiationRule
getAstVisitor() - Method in ExplicitLinkedListInstantiationRule
getAstVisitor() - Method in ExplicitStackInstantiationRule
getAstVisitor() - Method in ExplicitTreeSetInstantiationRule
getAstVisitor() - Method in JUnitTestMethodWithoutAssertRule
getAstVisitor() - Method in ThrowErrorRule
getAstVisitor() - Method in ThrowExceptionRule
getAstVisitor() - Method in ThrowNullPointerExceptionRule
getAstVisitor() - Method in ThrowRuntimeExceptionRule
getAstVisitor() - Method in ThrowThrowableRule
getChildren() - Method in DirectoryResults
@return the List of child Results objects; may be empty
getChildren() - Method in FileResults
Return an empty List
getChildren() - Method in Results
@return the List of child Results objects; may be empty
getChildren() - Method in VirtualResults
getCodeNarcVersion() - Method in AbstractReportWriter
getDescriptionForRule(Rule) - Method in AbstractReportWriter
getEmptyBlock(Statement) - Method in AstUtil
getFieldType(FieldNode) - Method in AstUtil
Supports discovering many common JDK types, but not all.
getFormattedTimestamp() - Method in AbstractReportWriter
getHtmlDescriptionForRule(Rule) - Method in AbstractReportWriter
getImportsSortedByLineNumber(def) - Method in AbstractRule
getInputStream() - Method in ClassPathResource
Open an InputStream on the classpath resource path
getInputStream() - Method in Resource
Return the InputStream for this resource.
getInputStream() - Method in UrlResource
Open a FileInputStream on the file
getInstanceOfTarget(def) - Method in AstUtil
getLineNumber(def) - Method in AbstractMethodMetricAstVisitor
getLineNumberForCharacterIndex(int) - Method in AbstractSourceCode
Return the line index for the line containing the character at the specified index within the source code.
getLineNumberForCharacterIndex(int) - Method in GMetricsSourceCodeAdapter
getLineNumberForCharacterIndex(int) - Method in SourceCode
Return the line index for the line containing the character at the specified index within the source code.
getLines() - Method in AbstractSourceCode
@return the List of lines of the source code (with line terminators removed)
getLines() - Method in GMetricsSourceCodeAdapter
getLines() - Method in SourceCode
@return the List of lines of the source code (with line terminators removed)
getMaxClassMetricValue() - Method in AbcComplexityAstVisitor
getMaxClassMetricValue() - Method in AbstractMethodMetricAstVisitor
getMaxClassMetricValue() - Method in CyclomaticComplexityAstVisitor
getMaxMethodMetricValue() - Method in AbcComplexityAstVisitor
getMaxMethodMetricValue() - Method in AbstractMethodMetricAstVisitor
getMaxMethodMetricValue() - Method in CyclomaticComplexityAstVisitor
getMethodArguments(MethodCallExpression) - Method in AstUtil
Return the List of Arguments for the specified MethodCallExpression.
getMethodNode(ClassNode, String, def) - Method in AbstractMethodMetricAstVisitor
getMetricShortDescription() - Method in AbcComplexityAstVisitor
getMetricShortDescription() - Method in AbstractMethodMetricAstVisitor
getMetricShortDescription() - Method in CyclomaticComplexityAstVisitor
getName() - Method in AbstractRule
@return the unique name for this rule
getName() - Method in GMetricsSourceCodeAdapter
getName(String) - Method in PathUtil
getName() - Method in Rule
@return the unique id for this rule
getName() - Method in SourceCode
Get the logical name for this source code.
getName() - Method in SourceFile
@return the filename for this source file, excluding path
getNullComparisonTarget(def) - Method in AstUtil
getNumberOfFilesWithViolations(boolean) - Method in DirectoryResults
Return the number of files with violations
getNumberOfFilesWithViolations(boolean) - Method in FileResults
Return 1 if these results include at least one violation
getNumberOfFilesWithViolations(boolean) - Method in Results
Return the number of files with violations
getNumberOfFilesWithViolations(boolean) - Method in VirtualResults
getNumberOfViolationsWithPriority(int, boolean) - Method in DirectoryResults
Return the number of violations with the specified priority
getNumberOfViolationsWithPriority(int, boolean) - Method in FileResults
@param recursive - true if the returned count should include subdirectories as well; defaults to true
getNumberOfViolationsWithPriority(int, boolean) - Method in Results
Return the number of violations with the specified priority
getNumberOfViolationsWithPriority(int, boolean) - Method in VirtualResults
getParameterNames(MethodNode) - Method in AstUtil
Gets the parameter names of a method node.
getParentPath(String) - Method in PathUtil
getPath() - Method in DirectoryResults
@return the path to the file or directory associated with these results
getPath() - Method in FileResults
@return the path to the file or directory associated with these results
getPath() - Method in GMetricsSourceCodeAdapter
getPath() - Method in Results
@return the path to the file or directory associated with these results
getPath() - Method in SourceCode
Get the logical path for this source code.
getPath() - Method in SourceFile
@return the normalized path for this source file, including filename
getPath() - Method in VirtualResults
getPriority() - Method in AbstractRule
@return the priority of this rule, between 1 (highest priority) and 3 (lowest priority), inclusive.
getPriority() - Method in Rule
@return the priority of this rule; must be 1, 2 or 3
getReportWriter(String, Map) - Method in ReportWriterFactory
getResource(String) - Method in DefaultResourceFactory
Return a Resource instance suitable for the specified path.
getResource(String) - Method in ResourceFactory
Return a Resource instance suitable for the specified path.
getResourceBundleString(String, String, boolean) - Method in AbstractReportWriter
getRuleClass(String) - Method in PropertiesFileRuleRegistry
Return the Rule Class for the specified name or else null
getRuleClass(String) - Method in RuleRegistry
getRules() - Method in CompositeRuleSet
Returns:
a List of Rule objects.
getRules() - Method in FilteredRuleSet
Return the List of Rules that match the include(s) (if specified) AND DO NOT match any exlcude(s) specified.
getRules() - Method in GroovyDslRuleSet
@return a List of Rule objects
getRules() - Method in ListRuleSet
@return a List of Rule objects
getRules() - Method in RuleSet
@return a List of optionally configured Rule objects
getRules() - Method in XmlFileRuleSet
@return a List of Rule objects
getRules() - Method in XmlReaderRuleSet
@return a List of Rule objects
getRuleSet() - Method in RuleSetBuilder
getRuleSet() - Method in TopLevelDelegate
getSortedRules(AnalysisContext) - Method in AbstractReportWriter
getSourceDirectories() - Method in AntFileSetSourceAnalyzer
getSourceDirectories() - Method in FilesystemSourceAnalyzer
getSourceDirectories() - Method in SourceAnalyzer
Return the List of source directories to be analyzed.
getSourceDirectories() - Method in StringSourceAnalyzer
getSourceLine(def) - Method in AbstractMethodMetricAstVisitor
getSourceUnit() - Method in AbstractAstVisitor
getSourceUnit() - Method in ReferenceCollector
getText() - Method in GMetricsSourceCodeAdapter
getText() - Method in SourceCode
@return the full text of the source code
getText() - Method in SourceFile
@return the full text of the source code
getText() - Method in SourceString
@return the full text of the source code
getTimestamp - Field in AbstractReportWriter
getTotalNumberOfFiles(boolean) - Method in DirectoryResults
Return the total number of (Groovy) files analyzed
getTotalNumberOfFiles(boolean) - Method in FileResults
Return the total number of (Groovy) files analyzed
getTotalNumberOfFiles(boolean) - Method in Results
Return the total number of (Groovy) files analyzed
getTotalNumberOfFiles(boolean) - Method in VirtualResults
getVariableExpressions(DeclarationExpression) - Method in AstUtil
Return the List of VariableExpression objects referenced by the specified DeclarationExpression.
getVersion() - Method in GroovyVersion
getViolationMessage(ConstructorCallExpression) - Method in AbstractConstructorCallAstVisitor
getViolationMessage(ConstructorCallExpression) - Method in BigDecimalInstantiationAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToAndMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToCompareToMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToDivMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToEqualsMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToGetAtMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToLeftShiftMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToMinusMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToModMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToMultiplyMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToOrMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToPlusMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToPowerMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToRightShiftMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToXorMethodAstVisitor
getViolationMessage(ConstructorCallExpression) - Method in UnnecessaryBooleanInstantiationAstVisitor
getViolationMessage(ConstructorCallExpression) - Method in UnnecessaryStringInstantiationAstVisitor
getViolations() - Method in AstVisitor
Retrieve the List of Violations resulting from applying this visitor
getViolationsWithPriority(int) - Method in DirectoryResults
@return the List of violations with the specified priority; may be empty
getViolationsWithPriority(int) - Method in FileResults
@return the List of violations with the specified priority; may be empty
getViolationsWithPriority(int) - Method in Results
Return the List of violations with the specified priority
getViolationsWithPriority(int) - Method in VirtualResults
GMetricsSourceCodeAdapter - Class in org.codenarc.rule.size
Adapter that adapts from a GMetrics SourceCode object to a CodeNarc SourceCode object.
GMetricsSourceCodeAdapter(SourceCode) - Constructor in GMetricsSourceCodeAdapter
GrailsPublicControllerMethodAstVisitor - Class in org.codenarc.rule.grails
GrailsPublicControllerMethodRule - Class in org.codenarc.rule.grails
Rule that checks for public methods on Grails controller classes.
GrailsServletContextReferenceAstVisitor - Class in org.codenarc.rule.grails
GrailsServletContextReferenceRule - Class in org.codenarc.rule.grails
Rule that checks for references to the servletContext object from within Grails controller and taglib classes.
GrailsSessionReferenceAstVisitor - Class in org.codenarc.rule.grails
GrailsSessionReferenceRule - Class in org.codenarc.rule.grails
Rule that checks for references to the session object from within Grails controller and taglib classes.
GrailsSessionReferenceRule() - Constructor in GrailsSessionReferenceRule
GrailsStatelessServiceRule - Class in org.codenarc.rule.grails
Rule that checks for non-final fields on a Grails service class.
GrailsStatelessServiceRule() - Constructor in GrailsStatelessServiceRule
GrailsUtil - Class in org.codenarc.rule.grails
Utility methods and constants for Grails rule classes.
GroovyDslRuleSet - Class in org.codenarc.ruleset
A RuleSet implementation that parses a Groovy DSL of RuleSet definitions.
GroovyDslRuleSet(String) - Constructor in GroovyDslRuleSet
Construct a new instance on the specified Groovy DSL RuleSet file path
GroovyLangImmutableAstVisitor - Class in org.codenarc.rule.basic
GroovyLangImmutableRule - Class in org.codenarc.rule.basic
The groovy.lang.Immutable annotation has been deprecated and replaced by groovy.transform.Immutable.
GroovyVersion - Class in org.codenarc.util
Utility methods to determine the version of Groovy currently executing.
GStringAsMapKeyAstVisitor - Class in org.codenarc.rule.basic
GStringAsMapKeyRule - Class in org.codenarc.rule.basic
A rule that disallows GStrings as map keys as they might change their hashcode over time.

H

handleClosure(ClosureExpression) - Method in BooleanMethodReturnsNullAstVisitor
handleClosure(ClosureExpression) - Method in ReturnsNullInsteadOfEmptyArrayAstVisitor
handleClosure(ClosureExpression) - Method in ReturnsNullInsteadOfEmptyCollectionRuleAstVisitor
HELP - Field in CodeNarc
HtmlReportWriter - Class in org.codenarc.report
ReportWriter that generates an HTML report.

I

IfStatementBracesAstVisitor - Class in org.codenarc.rule.braces
IfStatementBracesRule - Class in org.codenarc.rule.braces
Rule that checks that if statements use braces rather than a single statement.
IllegalRegexRule - Class in org.codenarc.rule.generic
Checks for a specified illegal regular expression within the source code.
ImplementationAsTypeAstVisitor - Class in org.codenarc.rule.design
ImplementationAsTypeRule - Class in org.codenarc.rule.design
Checks for use of the following concrete classes when specifying the type of a method parameter, closure parameter, constructor parameter, method return type or field type (the associated interfaces should be used to specify the type instead):
  • java.util.ArrayList
  • java.util.GregorianCalendar
  • java.util.HashMap
  • java.util.HashSet
  • java.util.Hashtable
  • java.util.LinkedHashMap
  • java.util.LinkedHashSet
  • java.util.LinkedList
  • java.util.TreeMap
  • java.util.TreeSet
  • java.util.Vector
  • java.util.concurrent.ArrayBlockingQueue
  • java.util.concurrent.ConcurrentHashMap
  • java.util.concurrent.ConcurrentLinkedQueue
  • java.util.concurrent.CopyOnWriteArrayList
  • java.util.concurrent.CopyOnWriteArraySet
  • java.util.concurrent.DelayQueue
  • java.util.concurrent.LinkedBlockingQueue
  • java.util.concurrent.PriorityBlockingQueue
  • java.util.concurrent.PriorityQueue
  • java.util.concurrent.SynchronousQueue
ImportFromSamePackageRule - Class in org.codenarc.rule.imports
Checks for an import of a class that is within the same package as the importing class.
include(String) - Method in RuleSetDelegate
includes - Field in CodeNarc
InconsistentPropertyLockingAstVisitor - Class in org.codenarc.rule.concurrency
InconsistentPropertyLockingRule - Class in org.codenarc.rule.concurrency
Class contains similarly-named get and set methods where one method of the pair is marked either
WithReadLock:
or
@WithWriteLock and the other is not locked at all.
InconsistentPropertySynchronizationAstVisitor - Class in org.codenarc.rule.concurrency
InconsistentPropertySynchronizationRule - Class in org.codenarc.rule.concurrency
Class contains similarly-named get and set methods where the set method is synchronized and the get method is not, or the get method is synchronized and the set method is not.
initializeDefaultResourceBundle() - Method in AbstractReportWriter
initializeResourceBundle - Field in AbstractReportWriter
initializeRuleRegistry() - Method in RuleRegistryInitializer
initializeWildcardPatterns() - Method in FilesystemSourceAnalyzer
InlineXmlReportWriter - Class in org.codenarc.report
ReportWriter that generates an XML report with inline rule descriptions.
IntegerGetIntegerAstVisitor - Class in org.codenarc.rule.basic
IntegerGetIntegerRule - Class in org.codenarc.rule.basic
This rule catches usages of java.lang.Integer.getInteger(String, ...) which reads an Integer from the System properties.
InterfaceNameAstVisitor - Class in org.codenarc.rule.naming
InterfaceNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the name of an interface matches a regular expression specified in the regex property.
InvertedIfElseAstVisitor - Class in org.codenarc.rule.basic
InvertedIfElseRule - Class in org.codenarc.rule.basic
An inverted if-else statement is one in which there is a single if statement with a single else branch and the boolean test of the if is negated.
isAssertConstantValueCall(MethodCallExpression, String, Object) - Method in JUnitUtil
Return true if the MethodCallExpression represents a JUnit assert method call with the specified method name and constant argument value.
isBinaryExpressionType(Expression, String) - Method in AstUtil
Returns true if the expression is a binary expression with the specified token.
isBlock(Statement) - Method in AstUtil
Return true if the Statement is a block
isBoolean(Expression) - Method in AstUtil
Tells you if the expression is either the true or false literal.
isClosureDeclaration(ASTNode) - Method in AstUtil
Returns true if the ASTNode is a declaration of a closure, either as a declaration or a field.
isConstant(Expression, int) - Method in AstUtil
Tells you if an expression is the constant integer.
isConstantOrLiteral(Expression) - Method in AstUtil
Tells you if an expression is a constant or literal.
isConstructorCallAViolation(ConstructorCallExpression) - Method in AbstractConstructorCallAstVisitor
Subclasses must implement to return true if the visited constructor call causes a rule violation
isConstructorCallAViolation(ConstructorCallExpression) - Method in BigDecimalInstantiationAstVisitor
isConstructorCallAViolation(ConstructorCallExpression) - Method in UnnecessaryBooleanInstantiationAstVisitor
isConstructorCallAViolation(ConstructorCallExpression) - Method in UnnecessaryStringInstantiationAstVisitor
isDirectoryContainingFiles(Results) - Method in HtmlReportWriter
Return true if the Results represents a directory that contains at least one file
isDirectoryContainingFilesWithViolations(Results) - Method in HtmlReportWriter
Return true if the Results represents a directory that contains at least one file with one or more violations.
isEmptyBlock(Statement) - Method in AstUtil
Return true if the Statement is a block and it is empty (contains no "meaningful" statements).
isEnabled(Rule) - Method in AbstractReportWriter
isFalse(Expression) - Method in AstUtil
Tells you if the expression is the false expression, either literal or contant.
isFile() - Method in DirectoryResults
@return false (this object does not represents the results for a single file)
isFile() - Method in FileResults
@return true (this object represents the results for a single file)
isFile() - Method in Results
@return true only if this object represents the results for a single file
isFile() - Method in VirtualResults
isFinalVariable(DeclarationExpression, SourceCode) - Method in AstUtil
Return true if the DeclarationExpression represents a 'final' variable declaration.
isFirstVisit(def) - Method in AbstractAstVisitor
Return true if the AST expression has not already been visited.
isFromGeneratedSourceCode(ASTNode) - Method in AstUtil
@return true if the ASTNode was generated (synthetic) rather than from the "real" input source code.
isGroovy1_6() - Method in GroovyVersion
isGroovy1_7() - Method in GroovyVersion
isIgnoredMethodName(String) - Method in AbstractMethodMetricAstVisitor
isInstanceOfCheck(def) - Method in AstUtil
isJoinableType(Expression) - Method in ConsecutiveUtils
isLastStatementInBlock(Statement) - Method in AbstractLastStatementInBlockAstVisitor
isMatchingLoggerDefinition(def) - Method in LogUtil
isMethodCall(Expression, String, int) - Method in AstUtil
Tells you if the expression is a method call for a certain method name with a certain number of arguments.
isMethodCallOnObject(Expression, String) - Method in AstUtil
Tells you if the expression is a method call on a particual object (which is represented as a String).
isMethodNamed(MethodCallExpression, String, Integer) - Method in AstUtil
Return true only if the MethodCallExpression represents a method call for the specified method name
isMethodNode(ASTNode, String, Integer, Class) - Method in AstUtil
Tells you if the ASTNode is a method node for the given name, arity, and return type.
isNotNullCheck(def) - Method in AstUtil
isNull(ASTNode) - Method in AstUtil
Tells you if the expression is the null literal.
isPublic(ASTNode) - Method in AstUtil
Tells you if the ASTNode has a public modifier on it.
isReady() - Method in AbstractClassNameRule
isReady() - Method in AbstractRule
Allows rules to check whether preconditions are satisfied and short-circuit execution (i.e., do nothing) if those preconditions are not satisfied.
isReady() - Method in IllegalRegexRule
isReady() - Method in InterfaceNameRule
isReady() - Method in RequiredRegexRule
isReady() - Method in RequiredStringRule
isRoot(def) - Method in XmlReportWriter
isSafe(Expression) - Method in AstUtil
Tells you if the expression is a null safe dereference.
isSetUpMethod(MethodNode) - Method in JUnitUtil
isSpreadSafe(Expression) - Method in AstUtil
Tells you if the expression is a spread operator call
isStatementWithinFinally(Statement) - Method in AbstractFinallyAstVisitor
@return true if the specified statement is within a finally block
isSynchronizedBlock(Statement) - Method in SynchronizedReadObjectMethodAstVisitor
isTearDownMethod(MethodNode) - Method in JUnitUtil
isTestMethod(ASTNode) - Method in JUnitUtil
Tells you if an ASTNode is a test MethodNode.
isTrue(Expression) - Method in AstUtil
Tells you if the expression is true, which can be true or Boolean.TRUE.
isTypeSuffixNecessary(def) - Method in UnnecessaryBigDecimalInstantiationAstVisitor
isTypeSuffixNecessary(def) - Method in UnnecessaryInstantiationAstVisitor
isTypeSuffixNecessary(def) - Method in UnnecessaryIntegerInstantiationAstVisitor
isValid() - Method in AbstractSourceCode
Return true if and only if the source code can be successfully compiled
isValid() - Method in GMetricsSourceCodeAdapter
isValid() - Method in SourceCode
Return true if and only if the source code can be successfully compiled
isVariable(ASTNode, String) - Method in AstUtil
Tells you if the given ASTNode is a VariableExpression with the given name.

J

JUnitAssertAlwaysFailsAstVisitor - Class in org.codenarc.rule.junit
JUnitAssertAlwaysFailsRule - Class in org.codenarc.rule.junit
Rule that checks for JUnit assert() method calls with constant arguments such that the assertion always fails.
JUnitAssertAlwaysSucceedsAstVisitor - Class in org.codenarc.rule.junit
JUnitAssertAlwaysSucceedsRule - Class in org.codenarc.rule.junit
Rule that checks for JUnit assert() method calls with constant arguments such that the assertion always succeeds.
JUnitFailWithoutMessageRule - Class in org.codenarc.rule.junit
This rule detects JUnit calling the fail() method without an argument.
JUnitFailWithoutMessageRuleAstVisitor - Class in org.codenarc.rule.junit
JUnitPublicNonTestMethodAstVisitor - Class in org.codenarc.rule.junit
JUnitPublicNonTestMethodRule - Class in org.codenarc.rule.junit
Rule that checks if a JUnit test class contains public methods other than:
  • Zero-argument methods with names starting with "test"
  • The setUp() and tearDown() methods
  • Methods annotated with @Test
  • Methods annotated with
    Before:
    and
    @After
  • Methods annotated with
    BeforeClass:
    and
    @AfterClass
Public, non-test methods on a test class violate conventional usage of test classes, and can be confusing.
JUnitSetUpCallsSuperAstVisitor - Class in org.codenarc.rule.junit
JUnitSetUpCallsSuperRule - Class in org.codenarc.rule.junit
Rule that checks that if the JUnit setUp() method is defined, that it includes a call to super.setUp().
JUnitStyleAssertionsAstVisitor - Class in org.codenarc.rule.junit
JUnitStyleAssertionsRule - Class in org.codenarc.rule.junit
This rule detects calling JUnit style assertions like assertEquals, assertTrue, assertFalse, assertNull, assertNotNull.
JUnitTearDownCallsSuperAstVisitor - Class in org.codenarc.rule.junit
JUnitTearDownCallsSuperRule - Class in org.codenarc.rule.junit
Rule that checks that if the JUnit tearDown() method is defined, that it includes a call to super.tearDown().
JUnitTestMethodWithoutAssertAstVisitor - Class in org.codenarc.rule.junit
JUnitTestMethodWithoutAssertRule - Class in org.codenarc.rule.junit
This rule searches for test methods that do not contain assert statements.
JUnitUnnecessarySetUpAstVisitor - Class in org.codenarc.rule.junit
JUnitUnnecessarySetUpRule - Class in org.codenarc.rule.junit
Rule that checks for a JUnit setUp() method that only contains a call to super.setUp().
JUnitUnnecessaryTearDownAstVisitor - Class in org.codenarc.rule.junit
JUnitUnnecessaryTearDownRule - Class in org.codenarc.rule.junit
Rule that checks for a JUnit tearDown() method that only contains a call to super.tearDown().
JUnitUtil - Class in org.codenarc.rule.junit
Utility methods for JUnit rule classes.

K


L

line(int) - Method in AbstractSourceCode
Get the trimmed line at the specified index
line(int) - Method in GMetricsSourceCodeAdapter
line(int) - Method in SourceCode
Get the trimmed line at the specified index
ListRuleSet - Class in org.codenarc.ruleset
A RuleSet implementation that returns a static List of Rules passed into its constructor.
ListRuleSet(List) - Constructor in ListRuleSet
Construct a new instance from the specified List of rules.
loadRuleScriptFile(String) - Method in RuleSetUtil
loadRuleSetFile(String) - Method in RuleSetUtil
LoggerForDifferentClassAstVisitor - Class in org.codenarc.rule.logging
LoggerForDifferentClassRule - Class in org.codenarc.rule.logging
Rule that checks for instantiating a logger for a class other than the current class.
LoggerWithWrongModifiersAstVisitor - Class in org.codenarc.rule.logging
LoggerWithWrongModifiersRule - Class in org.codenarc.rule.logging
Logger objects should be declared private, static, and final.
LoggingSwallowsStacktraceAstVisitor - Class in org.codenarc.rule.logging
LoggingSwallowsStacktraceRule - Class in org.codenarc.rule.logging
If you are logging an exception then the proper API is to call error(Object, Throwable), which will log the message and the exception stack trace.
LogUtil - Class in org.codenarc.rule.logging
Utility methods for Logging rules

M

main(String) - Method in CodeNarc
Main command-line entry-point.
main(String) - Method in GenerateAll
Invoke all generation scripts
main(String) - Method in GenerateCodeNarcRulesProperties
Write out all current rules to the 'codenarc-base-rules.properties' properties file
main(String) - Method in GenerateRuleIndexPage
Write out all current rule index to the 'codenarc-rule-index.apt' APT file
main(String) - Method in GenerateRuleSetAllRules
Write out all current rules to the 'codenarc-base-rules.properties' properties file
main(String) - Method in GenerateRuleSetAllRulesByCategory
Write out all current rules to the 'codenarc-base-rules.properties' properties file
matches(SourceCode) - Method in FilesystemSourceAnalyzer
matches(SourceCode) - Method in SourceCodeCriteria
Return true if all of the criteria specified in this object apply to thw SourceCode.
matches(String) - Method in WildcardPattern
Return true if the specified String matches the pattern or if the original patternString (specified in the constructor) was null or empty and the value for defaultMatches (also specified in the constructor) was true.
MAX_SOURCE_LINE_LENGTH - Field in AbstractAstVisitor
MethodCountAstVisitor - Class in org.codenarc.rule.size
MethodCountRule - Class in org.codenarc.rule.size
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine-grained objects.
methodMissing(String, def) - Method in RuleSetDelegate
methodMissing(String, def) - Method in TopLevelDelegate
MethodNameAstVisitor - Class in org.codenarc.rule.naming
MethodNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the name of each method matches a regular expression.
MethodSizeAstVisitor - Class in org.codenarc.rule.size
MethodSizeRule - Class in org.codenarc.rule.size
Rule that checks the size of a method.
metric - Field in AbstractMethodMetricAstVisitor
MissingNewInThrowStatementAstVisitor - Class in org.codenarc.rule.exceptions
MissingNewInThrowStatementRule - Class in org.codenarc.rule.exceptions
A common Groovy mistake when throwing exceptions is to forget the new keyword.
MultipleLoggersAstVisitor - Class in org.codenarc.rule.logging
MultipleLoggersRule - Class in org.codenarc.rule.logging
This rule catches classes that have more than one logger object defined.

N

NestedBlockDepthAstVisitor - Class in org.codenarc.rule.size
NestedBlockDepthRule - Class in org.codenarc.rule.size
Rule that checks for blocks or closures nested more than a configured maximum number.
NestedSynchronizationAstVisitor - Class in org.codenarc.rule.concurrency
NestedSynchronizationRule - Class in org.codenarc.rule.concurrency
Rule to detect nested synchronization blocks.
normalizePath(String) - Method in AbstractSourceCode
Return the normalized value of the specified path.
normalizePath(String) - Method in PathUtil
NullReturnTracker - Class in org.codenarc.rule.basic
Helper AST visitor that adds rule violation if a return statement is encountered that returns a null constant.

O

ObjectOverrideMisspelledMethodNameAstVisitor - Class in org.codenarc.rule.naming
ObjectOverrideMisspelledMethodNameRule - Class in org.codenarc.rule.naming
Rule that checks that the names of the most commonly overridden methods: equals, hashCode and toString, are correct.

P

PackageNameAstVisitor - Class in org.codenarc.rule.naming
packageNameForImport(ImportNode) - Method in AbstractRule
Return the package name for the specified import statement or else an empty String
PackageNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the package name of a class matches a regular expression.
ParameterNameAstVisitor - Class in org.codenarc.rule.naming
ParameterNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the name of each parameter matches a regular expression.
parseArgs(String) - Method in CodeNarc
PathUtil - Class in org.codenarc.util
Path-related utility methods.
PrintlnAstVisitor - Class in org.codenarc.rule.logging
PrintlnRule - Class in org.codenarc.rule.logging
Rule that checks for calls to this.print(), this.println() or this.printf().
PrintStackTraceAstVisitor - Class in org.codenarc.rule.logging
PrintStackTraceRule - Class in org.codenarc.rule.logging
Rule that checks for calls to printStackTrace().
PROPERTIES_FILE - Field in GenerateCodeNarcRulesProperties
PROPERTIES_FILE - Field in PropertiesFileRuleRegistry
propertiesFile - Field in GenerateCodeNarcRulesProperties
PropertiesFileRuleRegistry - Class in org.codenarc.ruleregistry
Implementation of RuleRegistry that loads the rules from the 'codenarc-base-rules.properties' properties file.
PropertiesFileRuleRegistry() - Constructor in PropertiesFileRuleRegistry
PropertiesFileRuleSetConfigurer - Class in org.codenarc.ruleset
Reads the properties file named "codenarc.properties", if found on the classpath, and applies the property values to matching Rules within a specified RuleSet.
propertyMissing(String) - Method in TopLevelDelegate
PropertyNameAstVisitor - Class in org.codenarc.rule.naming
PropertyNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the name of each property matches a regular expression.
PropertyUtil - Class in org.codenarc.util
Contains property-related static utility methods

Q


R

ReferenceCollector - Class in org.codenarc.rule.unused
@author Hamlet D'Arcy
RemoveAllOnSelfAstVisitor - Class in org.codenarc.rule.basic
RemoveAllOnSelfRule - Class in org.codenarc.rule.basic
This rule catches calling the method removeAll with yourself as a parameter.
removePathPrefix(String, String) - Method in PathUtil
Report - Class in org.codenarc.ant
JavaBean class holding the properties for a element with the CodeNarc Ant Task.
ReportOption - Class in org.codenarc.ant
JavaBean class holding the properties for a
reports - Field in CodeNarc
ReportWriter - Interface in org.codenarc.report
Represents the interface of an object that can write out a report
ReportWriterFactory - Class in org.codenarc.report
Factory for ReportWriter objects based on the report type (name).
reportWriters - Field in CodeNarcTask
RequiredRegexRule - Class in org.codenarc.rule.generic
Checks for a specified regular expression that must exist within the source code.
RequiredStringRule - Class in org.codenarc.rule.generic
Checks for a specified String that must exist within the source code.
Resource - Interface in org.codenarc.util.io
Defines the interface for objects that represent a resource (e.g. a file) and provide access to its InputStream.
resourceBundle - Field in AbstractReportWriter
ResourceFactory - Interface in org.codenarc.util.io
Defines the interface for factory objects that create/return Resource instances.
respondsTo(Object, String) - Method in AstUtil
Return true only if the specified object responds to the named method
Results - Interface in org.codenarc.results
Represents the results of applying rules to one or more source files/directories
ReturnFromFinallyBlockAstVisitor - Class in org.codenarc.rule.basic
ReturnFromFinallyBlockRule - Class in org.codenarc.rule.basic
Rule that checks for a return from within a finally block
ReturnNullFromCatchBlockAstVisitor - Class in org.codenarc.rule.exceptions
ReturnNullFromCatchBlockRule - Class in org.codenarc.rule.exceptions
Returning null from a catch block often masks errors and requires the client to handle error codes.
ReturnsNullInsteadOfEmptyArrayAstVisitor - Class in org.codenarc.rule.basic
ReturnsNullInsteadOfEmptyArrayRule - Class in org.codenarc.rule.basic
This rule detects when null is returned from a method that might return an array.
ReturnsNullInsteadOfEmptyCollectionRule - Class in org.codenarc.rule.basic
This rule detects when null is returned from a method that might return a collection.
ReturnsNullInsteadOfEmptyCollectionRuleAstVisitor - Class in org.codenarc.rule.basic
Rule - Interface in org.codenarc.rule
Represents a source code analysis rule
RULE_INDEX_FILE - Field in GenerateRuleIndexPage
rule(String, Closure) - Method in TopLevelDelegate
ruleIndexFile - Field in GenerateRuleIndexPage
RuleRegistry - Interface in org.codenarc.ruleregistry
Represents a registry of rule classes, accessible by rule name
RuleRegistryHolder - Class in org.codenarc.ruleregistry
Holds a reference to the RuleRegistry static singleton
RuleRegistryInitializer - Class in org.codenarc.ruleregistry
Performs initialization (loading) of the RuleRegistry singleton held by RuleRegistryHolder
RuleSet - Interface in org.codenarc.ruleset
Represents a set of (configured) Rule objects that can be applied for static analysis.
ruleSet - Field in CodeNarcTask
RULESET_FILE - Field in GenerateRuleSetAllRules
RULESET_FILE - Field in GenerateRuleSetAllRulesByCategory
ruleset(Closure) - Method in RuleSetBuilder
ruleset(String, Closure) - Method in TopLevelDelegate
RuleSetBuilder - Class in org.codenarc.ruleset
A Builder for RuleSets.
RuleSetDelegate - Class in org.codenarc.ruleset
RuleSetDelegate(RuleSet) - Constructor in RuleSetDelegate
ruleSetFile - Field in GenerateRuleSetAllRules
ruleSetFile - Field in GenerateRuleSetAllRulesByCategory
ruleSetFiles - Field in CodeNarc
RuleSets - Class in org.codenarc.ruleset
Holds list of all RuleSet files.
RuleSetUtil - Class in org.codenarc.ruleset
A private utility class for the RuleSet classes.

S

ScopedConfusingMethodNameAstVisitor - Class in org.codenarc.rule.naming
SerializableClassMustDefineSerialVersionUIDAstVisitor - Class in org.codenarc.rule.basic
SerializableClassMustDefineSerialVersionUIDRule - Class in org.codenarc.rule.basic
Classes that implement Serializable should define a serialVersionUID.
SerialVersionUIDAstVisitor - Class in org.codenarc.rule.basic
SerialVersionUIDRule - Class in org.codenarc.rule.basic
Rule that checks that serialVersionUID field is static final and type long, and is not a property.
SERVICE_CLASSES - Field in GrailsUtil
SERVICE_FILES - Field in GrailsUtil
setAddToIgnoreFieldNames(String) - Method in StatelessClassRule
Add more field names to the existing ignoreFieldNames property value.
setDefaultsIfNecessary() - Method in CodeNarc
setName(String) - Method in AbstractRule
Set the unique name for this rule
setPath(String) - Method in SourceString
setPriority(int) - Method in AbstractRule
Set the priority for this rule
setPropertyFromString(Object, String, String) - Method in PropertyUtil
Set the value of the named property on the specified Object from a String value.
setRule(Rule) - Method in AstVisitor
Set the Rule associated with this visitor
setSourceCode(SourceCode) - Method in AstVisitor
Set the SourceCode associated with this visitor
shouldApplyThisRuleTo(def) - Method in AbstractAstVisitorRule
Return true if this rule should be applied for the specified ClassNode, based on the configuration of this rule.
shouldVisit(ClassNode) - Method in AbstractClassNameAstVisitor
shouldVisit(ClassNode) - Method in AbstractTypeNameAstVisitor
@return true only if this visitor should be applied to (visit) the specified ClassNode.
shouldVisit(ClassNode) - Method in ClassNameAstVisitor
shouldVisit(ClassNode) - Method in InterfaceNameAstVisitor
SimpleDateFormatMissingLocaleAstVisitor - Class in org.codenarc.rule.basic
SimpleDateFormatMissingLocaleRule - Class in org.codenarc.rule.basic
Be sure to specify a Locale when creating a new instance of SimpleDateFormat; the class is locale-sensitive.
sortRules(List) - Method in GenerateUtil
SOURCE_LINE_LAST_SEGMENT_LENGTH - Field in AbstractAstVisitor
SourceAnalyzer - Interface in org.codenarc.analyzer
The interface for objects that can analyze the source files within one or more directory trees using a specified RuleSet and produce report results.
SourceCode - Interface in org.codenarc.source
Represents a unit of source code to be analyzed
SourceCodeCriteria - Class in org.codenarc.source
Represents the set of criteria used to filter source code (files).
SourceFile - Class in org.codenarc.source
The SourceCode implementation for a single file.
SourceFile(File) - Constructor in SourceFile
Construct a new instance for the file at the specified path
sourceLine(ASTNode) - Method in AbstractAstVisitor
Return the source line corresponding to the specified AST node
sourceLineAndNumberForImport(SourceCode, ImportNode) - Method in AbstractRule
Return the source line and line number for the specified import
SourceString - Class in org.codenarc.source
SourceCode implementation that uses source from a pre-defined String.
SourceString(String, String, String) - Constructor in SourceString
Construct a new instance for the file at the specified path
StatelessClassAstVisitor - Class in org.codenarc.rule.generic
StatelessClassRule - Class in org.codenarc.rule.generic
Rule that checks for non-final fields on a class.
StaticCalendarFieldAstVisitor - Class in org.codenarc.rule.concurrency
StaticCalendarFieldRule - Class in org.codenarc.rule.concurrency
Calendar objects should not be used as static fields.
StaticDateFormatFieldAstVisitor - Class in org.codenarc.rule.concurrency
StaticDateFormatFieldRule - Class in org.codenarc.rule.concurrency
DateFormat objects should not be used as static fields.
StaticMatcherFieldAstVisitor - Class in org.codenarc.rule.concurrency
StaticMatcherFieldRule - Class in org.codenarc.rule.concurrency
Matcher objects should not be used as static fields.
StringSourceAnalyzer - Class in org.codenarc.analyzer
Analyzes Strings.
StringSourceAnalyzer(def) - Constructor in StringSourceAnalyzer
suppressionIsPresent(AnnotatedNode) - Method in AbstractAstVisitor
SynchronizedMethodAstVisitor - Class in org.codenarc.rule.concurrency
SynchronizedMethodRule - Class in org.codenarc.rule.concurrency
Synchronized Method Rule - This rule reports uses of the synchronized keyword on methods.
SynchronizedOnBoxedPrimitiveAstVisitor - Class in org.codenarc.rule.concurrency
SynchronizedOnBoxedPrimitiveRule - Class in org.codenarc.rule.concurrency
The code synchronizes on a boxed primitive constant, such as an Integer.
SynchronizedOnGetClassAstVisitor - Class in org.codenarc.rule.concurrency
SynchronizedOnGetClassRule - Class in org.codenarc.rule.concurrency
Synchronized on getClass rather than class literal.
SynchronizedOnReentrantLockAstVisitor - Class in org.codenarc.rule.concurrency
SynchronizedOnReentrantLockRule - Class in org.codenarc.rule.concurrency
Synchronizing on a ReentrantLock field is almost never the intended usage.
SynchronizedOnStringAstVisitor - Class in org.codenarc.rule.concurrency
SynchronizedOnStringRule - Class in org.codenarc.rule.concurrency
Synchronization on a String field can lead to deadlock because Strings are interned by the JVM and can be shared.
SynchronizedOnThisAstVisitor - Class in org.codenarc.rule.concurrency
SynchronizedOnThisRule - Class in org.codenarc.rule.concurrency
Synchronized On This Rule - This rule reports uses of the synchronized blocks where the synchronization reference is 'this'.
SynchronizedReadObjectMethodAstVisitor - Class in org.codenarc.rule.concurrency
SynchronizedReadObjectMethodRule - Class in org.codenarc.rule.concurrency
Catches Serializable classes that define a synchronized readObject method.
SystemErrPrintAstVisitor - Class in org.codenarc.rule.logging
SystemErrPrintRule - Class in org.codenarc.rule.logging
Rule that checks for calls to System.err.print(), System.err.println() or System.err.printf().
SystemOutPrintAstVisitor - Class in org.codenarc.rule.logging
SystemOutPrintRule - Class in org.codenarc.rule.logging
Rule that checks for calls to System.out.print(), System.out.println() or System.out.printf().
SystemRunFinalizersOnExitAstVisitor - Class in org.codenarc.rule.concurrency
SystemRunFinalizersOnExitRule - Class in org.codenarc.rule.concurrency
Method calls to System.runFinalizersOnExit() should not be allowed.

T

TextReportWriter - Class in org.codenarc.report
ReportWriter that generates an simple ASCII text report.
ThreadGroupAstVisitor - Class in org.codenarc.rule.concurrency
ThreadGroupRule - Class in org.codenarc.rule.concurrency
Avoid using ThreadGroup; although it is intended to be used in a threaded environment it contains methods that are not thread safe.
ThreadLocalNotStaticFinalAstVisitor - Class in org.codenarc.rule.concurrency
ThreadLocalNotStaticFinalRule - Class in org.codenarc.rule.concurrency
ThreadLocal fields should be static and final.
ThreadYieldAstVisitor - Class in org.codenarc.rule.concurrency
ThreadYieldRule - Class in org.codenarc.rule.concurrency
Method calls to Thread.yield() should not be allowed.
ThrowErrorRule - Class in org.codenarc.rule.exceptions
Rule that checks for throwing an instance of java.lang.Error
ThrowExceptionFromFinallyBlockAstVisitor - Class in org.codenarc.rule.basic
ThrowExceptionFromFinallyBlockRule - Class in org.codenarc.rule.basic
Rule that checks for throwing an exception from within a finally block
ThrowExceptionRule - Class in org.codenarc.rule.exceptions
Rule that checks for throwing an instance of java.lang.Exception
ThrowNullPointerExceptionRule - Class in org.codenarc.rule.exceptions
Rule that checks for throwing an instance of java.lang.NullPointerException
ThrowRuntimeExceptionRule - Class in org.codenarc.rule.exceptions
Rule that checks for throwing an instance of java.lang.RuntimeException
ThrowThrowableRule - Class in org.codenarc.rule.exceptions
Rule that checks for throwing an instance of java.lang.Throwable
title - Field in CodeNarc
TopLevelDelegate - Class in org.codenarc.ruleset
toString() - Method in AbstractRule
toString() - Method in DirectoryResults
toString() - Method in FileResults
toString() - Method in HtmlReportWriter
toString() - Method in SourceFile
toString() - Method in SourceString
toString() - Method in Violation

U

UnnecessaryBigDecimalInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryBigDecimalInstantiationAstVisitor() - Constructor in UnnecessaryBigDecimalInstantiationAstVisitor
UnnecessaryBigDecimalInstantiationRule - Class in org.codenarc.rule.unnecessary
It is unnecessary to instantiate BigDecimal objects.
UnnecessaryBigIntegerInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryBigIntegerInstantiationAstVisitor() - Constructor in UnnecessaryBigIntegerInstantiationAstVisitor
UnnecessaryBigIntegerInstantiationRule - Class in org.codenarc.rule.unnecessary
It is unnecessary to instantiate BigInteger objects.
UnnecessaryBooleanExpressionAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryBooleanExpressionRule - Class in org.codenarc.rule.unnecessary
Rule that checks unnecessary boolean expressions, including ANDing (&&) or ORing (||) with true, false, null, or a Map/List/String/Number literal.
UnnecessaryBooleanInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryBooleanInstantiationRule - Class in org.codenarc.rule.unnecessary
Rule that checks for direct call to Boolean constructor - use Boolean.valueOf() instead.
UnnecessaryCallForLastElementAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryCallForLastElementRule - Class in org.codenarc.rule.unnecessary
This rule checks for excessively verbose methods of accessing the last element of an array or list.
UnnecessaryCallToSubstringAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryCallToSubstringRule - Class in org.codenarc.rule.unnecessary
Calling String.substring(0) always returns the original string.
UnnecessaryCatchBlockAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryCatchBlockRule - Class in org.codenarc.rule.unnecessary
Violations are triggered when a catch block does nothing but throw the original exception.
UnnecessaryCollectCallAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryCollectCallRule - Class in org.codenarc.rule.unnecessary
Some method calls to Object.collect(Closure) can be replaced with the spread operator.
UnnecessaryCollectionCallAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryCollectionCallRule - Class in org.codenarc.rule.unnecessary
Useless call to collections.
UnnecessaryConstructorAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryConstructorRule - Class in org.codenarc.rule.unnecessary
UnnecessaryConstructor
UnnecessaryDefInMethodDeclarationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryDefInMethodDeclarationRule - Class in org.codenarc.rule.unnecessary
If a method has a visibility modifier, then the def keyword is unneeded.
UnnecessaryDoubleInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryDoubleInstantiationAstVisitor() - Constructor in UnnecessaryDoubleInstantiationAstVisitor
UnnecessaryDoubleInstantiationRule - Class in org.codenarc.rule.unnecessary
It is unnecessary to instantiate Double objects.
UnnecessaryFailAstVisitor - Class in org.codenarc.rule.junit
UnnecessaryFailRule - Class in org.codenarc.rule.junit
In a unit test, catching an exception and immedietly calling Assert.fail() is pointless and hides the stack trace.
UnnecessaryFloatInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryFloatInstantiationAstVisitor() - Constructor in UnnecessaryFloatInstantiationAstVisitor
UnnecessaryFloatInstantiationRule - Class in org.codenarc.rule.unnecessary
It is unnecessary to instantiate Float objects.
UnnecessaryGetterAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryGetterRule - Class in org.codenarc.rule.unnecessary
Checks for explicit calls to getter/accessor methods which can, for the most part, be replaced by property access.
UnnecessaryGroovyImportRule - Class in org.codenarc.rule.imports
Rule that checks for imports from any packages that are already automatically imported by Groovy classes, including java.lang, java.net, java.util, java.io, java.net, groovy.lang and groovy.util, as well as the classes java.math.BigDecimal and java.math.BigInteger
UnnecessaryGStringAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryGStringRule - Class in org.codenarc.rule.unnecessary
String objects should be created with single quotes, and GString objects created with double quotes.
UnnecessaryIfStatementAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryIfStatementRule - Class in org.codenarc.rule.unnecessary
Rule that checks for unnecessary if statements.
UnnecessaryInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
Base visitor for unnecessary constructor calls.
UnnecessaryInstantiationAstVisitor(Class, List, String) - Constructor in UnnecessaryInstantiationAstVisitor
UnnecessaryInstantiationToGetClassAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryInstantiationToGetClassRule - Class in org.codenarc.rule.unnecessary
Avoid instantiating an object just to call getClass() on it; use the .class public member instead.
UnnecessaryIntegerInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryIntegerInstantiationAstVisitor() - Constructor in UnnecessaryIntegerInstantiationAstVisitor
UnnecessaryIntegerInstantiationRule - Class in org.codenarc.rule.unnecessary
It is unnecessary to instantiate Integer objects.
UnnecessaryLongInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryLongInstantiationAstVisitor() - Constructor in UnnecessaryLongInstantiationAstVisitor
UnnecessaryLongInstantiationRule - Class in org.codenarc.rule.unnecessary
It is unnecessary to instantiate Long objects.
UnnecessaryModOneAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryModOneRule - Class in org.codenarc.rule.unnecessary
Any expression mod 1 (exp % 1) is guaranteed to always return zero.
UnnecessaryNullCheckAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryNullCheckBeforeInstanceOfAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryNullCheckBeforeInstanceOfRule - Class in org.codenarc.rule.unnecessary
There is no need to check for null before an instanceof; the instanceof keyword returns false when given a null argument.
UnnecessaryNullCheckRule - Class in org.codenarc.rule.unnecessary
Groovy contains the safe dereference operator, which can be used in boolean conditional statements to safely replace explicit "x == null" tests.
UnnecessaryObjectReferencesAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryObjectReferencesRule - Class in org.codenarc.rule.unnecessary
Violations are triggered when an excessive set of consecutive statements all reference the same variable.
UnnecessaryOverridingMethodAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryOverridingMethodRule - Class in org.codenarc.rule.unnecessary
The overriding method merely calls the same method defined in a superclass.
UnnecessaryPublicModifierAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryPublicModifierRule - Class in org.codenarc.rule.unnecessary
The 'public' modifier is not required on methods or classes.
UnnecessaryReturnKeywordAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryReturnKeywordRule - Class in org.codenarc.rule.unnecessary
In Groovy, the return keyword is often optional.
UnnecessarySelfAssignmentAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessarySelfAssignmentRule - Class in org.codenarc.rule.unnecessary
Method contains a pointless self-assignment to a variable or property.
UnnecessarySemicolonAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessarySemicolonRule - Class in org.codenarc.rule.unnecessary
Semicolons as line terminators are not required in Groovy: remove them.
UnnecessaryStringInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryStringInstantiationRule - Class in org.codenarc.rule.unnecessary
Rule that checks for direct call to the String constructor that accepts a String literal.
UnnecessaryTernaryExpressionAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryTernaryExpressionRule - Class in org.codenarc.rule.unnecessary
Rule that checks for ternary expressions where the conditional expression always evaluates to a boolean and the true and false expressions are merely returning true and false constants.
UnnecessaryTransientModifierAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryTransientModifierRule - Class in org.codenarc.rule.unnecessary
The field is marked as transient, but the class isn't Serializable, so marking it as transient should have no effect.
UnusedArrayAstVisitor - Class in org.codenarc.rule.unused
UnusedArrayRule - Class in org.codenarc.rule.unused
Checks for array allocations that are not assigned or used (i.e., it is ignored).
UnusedImportRule - Class in org.codenarc.rule.imports
Rule that checks for an unreferenced import
UnusedObjectAstVisitor - Class in org.codenarc.rule.unused
UnusedObjectRule - Class in org.codenarc.rule.unused
Checks for object constructions that are not assigned or used (i.e., ignored).
UnusedPrivateFieldAstVisitor - Class in org.codenarc.rule.unused
UnusedPrivateFieldRule - Class in org.codenarc.rule.unused
Rule that checks for private fields that are not referenced within the same class.
UnusedPrivateMethodAstVisitor - Class in org.codenarc.rule.unused
UnusedPrivateMethodParameterAstVisitor - Class in org.codenarc.rule.unused
UnusedPrivateMethodParameterRule - Class in org.codenarc.rule.unused
Rule that checks for parameters to private methods that are not referenced within the method body.
UnusedPrivateMethodRule - Class in org.codenarc.rule.unused
Rule that checks for private methods that are not referenced within the same class.
UnusedVariableAstVisitor - Class in org.codenarc.rule.unused
UnusedVariableRule - Class in org.codenarc.rule.unused
Rule that checks for variables that are not referenced.
UrlResource - Class in org.codenarc.util.io
A Resource implementation based on java.net.URL.
UrlResource(String) - Constructor in UrlResource
Construct a new FileResource
UseAssertEqualsInsteadOfAssertTrueAstVisitor - Class in org.codenarc.rule.junit
UseAssertEqualsInsteadOfAssertTrueRule - Class in org.codenarc.rule.junit
This rule detects JUnit assertions in object equality.
UseAssertFalseInsteadOfNegationAstVisitor - Class in org.codenarc.rule.junit
UseAssertFalseInsteadOfNegationRule - Class in org.codenarc.rule.junit
In unit tests, if a condition is expected to be false then there is no sense using assertTrue with the negation operator.
UseAssertNullInsteadOfAssertEqualsAstVisitor - Class in org.codenarc.rule.junit
UseAssertNullInsteadOfAssertEqualsRule - Class in org.codenarc.rule.junit
This rule detects JUnit calling assertEquals where the first or second parameter is null.
UseAssertSameInsteadOfAssertTrueAstVisitor - Class in org.codenarc.rule.junit
UseAssertSameInsteadOfAssertTrueRule - Class in org.codenarc.rule.junit
This rule detects JUnit calling assertTrue where the first or second parameter is an Object#is() call testing for reference equality.
UseAssertTrueInsteadOfAssertEqualsAstVisitor - Class in org.codenarc.rule.junit
UseAssertTrueInsteadOfAssertEqualsRule - Class in org.codenarc.rule.junit
This rule detects JUnit calling assertEquals where the first parameter is a boolean.
UseAssertTrueInsteadOfNegationAstVisitor - Class in org.codenarc.rule.junit
UseAssertTrueInsteadOfNegationRule - Class in org.codenarc.rule.junit
In unit tests, if a condition is expected to be true then there is no sense using assertFalse with the negation operator.
UseOfNotifyMethodAstVisitor - Class in org.codenarc.rule.concurrency
UseOfNotifyMethodRule - Class in org.codenarc.rule.concurrency
This code calls notify() rather than notifyAll().

V

validate() - Method in AbstractRule
Allows rules to perform validation.
validate() - Method in ClassNameRule
validate() - Method in FieldNameRule
validate() - Method in ParameterNameRule
validate() - Method in PropertyNameRule
VariableNameAstVisitor - Class in org.codenarc.rule.naming
VariableNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the name of each variable matches a regular expression.
VariableUsageFinder - Class in org.codenarc.rule.unnecessary
VERSION_FILE - Field in AbstractReportWriter
Violation - Class in org.codenarc.rule
Represents a single instance of a rule violation
VirtualResults - Class in org.codenarc.results
This is a Results object for something that has no real file system, such as a string.
VirtualResults(List) - Constructor in VirtualResults
visitArgumentlistExpression(ArgumentListExpression) - Method in DuplicateLiteralAstVisitor
visitAssertStatement(AssertStatement) - Method in AssertionTrap
visitAssertStatement(AssertStatement) - Method in UseAssertTrueInsteadOfAssertEqualsAstVisitor
visitBinaryExpression(BinaryExpression) - Method in AddEmptyStringAstVisitor
visitBinaryExpression(BinaryExpression) - Method in BrokenOddnessCheckAstVisitor
visitBinaryExpression(BinaryExpression) - Method in ConsecutiveStringConcatenationAstVisitor
visitBinaryExpression(BinaryExpression) - Method in DuplicateLiteralAstVisitor
visitBinaryExpression(BinaryExpression) - Method in UnnecessaryBooleanExpressionAstVisitor
visitBinaryExpression(BinaryExpression) - Method in UnnecessaryCallForLastElementAstVisitor
visitBinaryExpression(BinaryExpression) - Method in UnnecessaryModOneAstVisitor
visitBinaryExpression(BinaryExpression) - Method in UnnecessarySelfAssignmentAstVisitor
visitBlockStatement(BlockStatement) - Method in AbstractLastStatementInBlockAstVisitor
visitBlockStatement(BlockStatement) - Method in DeadCodeAstVisitor
visitBlockStatement(BlockStatement) - Method in NestedBlockDepthAstVisitor
visitBlockStatement(BlockStatement) - Method in UnnecessaryIfStatementAstVisitor
visitBlockStatement(BlockStatement) - Method in UnnecessaryObjectReferencesAstVisitor
visitBlockStatement(BlockStatement) - Method in UnusedVariableAstVisitor
visitBooleanExpression(BooleanExpression) - Method in UnnecessaryNullCheckAstVisitor
visitBooleanExpression(BooleanExpression) - Method in UnnecessaryNullCheckBeforeInstanceOfAstVisitor
visitCaseStatement(CaseStatement) - Method in NestedBlockDepthAstVisitor
visitCatchStatement(CatchStatement) - Method in CommonCatchAstVisitor
visitCatchStatement(CatchStatement) - Method in EmptyCatchBlockAstVisitor
visitCatchStatement(CatchStatement) - Method in LoggingSwallowsStacktraceAstVisitor
visitCatchStatement(CatchStatement) - Method in NestedBlockDepthAstVisitor
visitCatchStatement(CatchStatement) - Method in ReturnNullFromCatchBlockAstVisitor
visitCatchStatement(CatchStatement) - Method in UnnecessaryFailAstVisitor
visitClass(ClassNode) - Method in AbstractAstVisitor
visitClassComplete(ClassNode) - Method in AbstractAstVisitor
visitClassComplete(ClassNode) - Method in GroovyLangImmutableAstVisitor
visitClassComplete(ClassNode) - Method in LoggingSwallowsStacktraceAstVisitor
visitClassComplete(ClassNode) - Method in PrintlnAstVisitor
visitClassComplete(ClassNode) - Method in UnusedPrivateMethodAstVisitor
visitClassEx(ClassNode) - Method in AbstractAstVisitor
visitClassEx(ClassNode) - Method in AbstractClassWithoutAbstractMethodAstVisitor
visitClassEx(ClassNode) - Method in AbstractMethodMetricAstVisitor
visitClassEx(ClassNode) - Method in AbstractTypeNameAstVisitor
visitClassEx(ClassNode) - Method in ClassSizeAstVisitor
visitClassEx(ClassNode) - Method in CloneableWithoutCloneAstVisitor
visitClassEx(ClassNode) - Method in ConfusingClassNamedExceptionAstVisitor
visitClassEx(ClassNode) - Method in ConfusingMethodNameAstVisitor
visitClassEx(ClassNode) - Method in ConstantsOnlyInterfaceAstVisitor
visitClassEx(ClassNode) - Method in DuplicateLiteralAstVisitor
visitClassEx(ClassNode) - Method in EqualsAndHashCodeAstVisitor
visitClassEx(ClassNode) - Method in ExceptionExtendsErrorAstVisitor
visitClassEx(ClassNode) - Method in LoggingSwallowsStacktraceAstVisitor
visitClassEx(ClassNode) - Method in MethodCountAstVisitor
visitClassEx(ClassNode) - Method in NestedBlockDepthAstVisitor
visitClassEx(ClassNode) - Method in PackageNameAstVisitor
visitClassEx(ClassNode) - Method in PrintlnAstVisitor
visitClassEx(ClassNode) - Method in ScopedConfusingMethodNameAstVisitor
visitClassEx(ClassNode) - Method in SerializableClassMustDefineSerialVersionUIDAstVisitor
visitClassEx(ClassNode) - Method in StatelessClassAstVisitor
visitClassEx(ClassNode) - Method in SynchronizedOnBoxedPrimitiveAstVisitor
visitClassEx(ClassNode) - Method in SynchronizedOnReentrantLockAstVisitor
visitClassEx(ClassNode) - Method in SynchronizedOnStringAstVisitor
visitClassEx(ClassNode) - Method in SynchronizedReadObjectMethodAstVisitor
visitClassEx(ClassNode) - Method in UnnecessaryConstructorAstVisitor
visitClassEx(ClassNode) - Method in UnnecessaryPublicModifierAstVisitor
visitClassEx(ClassNode) - Method in UnnecessarySemicolonAstVisitor
visitClassEx(ClassNode) - Method in UnusedPrivateMethodAstVisitor
visitClosureExpression(ClosureExpression) - Method in ImplementationAsTypeAstVisitor
visitClosureExpression(ClosureExpression) - Method in NestedBlockDepthAstVisitor
visitClosureExpression(ClosureExpression) - Method in NestedSynchronizationAstVisitor
visitClosureExpression(ClosureExpression) - Method in NullReturnTracker
visitClosureExpression(ClosureExpression) - Method in ParameterNameAstVisitor
visitClosureExpression(ClosureExpression) - Method in UnnecessaryReturnKeywordAstVisitor
visitConstantExpression(ConstantExpression) - Method in UnnecessaryGStringAstVisitor
visitConstructor(ConstructorNode) - Method in AbstractAstVisitor
visitConstructorCallExpression(ConstructorCallExpression) - Method in AbstractConstructorCallAstVisitor
visitConstructorCallExpression(ConstructorCallExpression) - Method in CoupledTestCaseAstVisitor
visitConstructorCallExpression(ConstructorCallExpression) - Method in ExplicitTypeInstantiationAstVisitor
visitConstructorCallExpression(ConstructorCallExpression) - Method in SimpleDateFormatMissingLocaleAstVisitor
visitConstructorCallExpression(ConstructorCallExpression) - Method in ThreadGroupAstVisitor
visitConstructorCallExpression(ConstructorCallExpression) - Method in UnnecessaryInstantiationAstVisitor
visitConstructorEx(ConstructorNode) - Method in AbstractAstVisitor
visitConstructorEx(ConstructorNode) - Method in ImplementationAsTypeAstVisitor
visitConstructorEx(ConstructorNode) - Method in ParameterNameAstVisitor
visitConstructorOrMethod(MethodNode, boolean) - Method in AbstractAstVisitor
visitConstructorOrMethodEx(MethodNode, boolean) - Method in AbstractAstVisitor
visitConstructorOrMethodEx(MethodNode, boolean) - Method in CloneableWithoutCloneAstVisitor
visitConstructorOrMethodEx(MethodNode, boolean) - Method in FinalClassWithProtectedMemberAstVisitor
visitConstructorOrMethodEx(MethodNode, boolean) - Method in MethodSizeAstVisitor
visitDeclarationExpression(DeclarationExpression) - Method in ImplementationAsTypeAstVisitor
visitDeclarationExpression(DeclarationExpression) - Method in UnusedVariableAstVisitor
visitDeclarationExpression(DeclarationExpression) - Method in VariableNameAstVisitor
visitExpressionStatement(ExpressionStatement) - Method in UnusedArrayAstVisitor
visitExpressionStatement(ExpressionStatement) - Method in UnusedObjectAstVisitor
visitField(FieldNode) - Method in AbstractAstVisitor
visitFieldEx(FieldNode) - Method in AbstractAstVisitor
visitFieldEx(FieldNode) - Method in DuplicateLiteralAstVisitor
visitFieldEx(FieldNode) - Method in FieldNameAstVisitor
visitFieldEx(FieldNode) - Method in FinalClassWithProtectedMemberAstVisitor
visitFieldEx(FieldNode) - Method in ImplementationAsTypeAstVisitor
visitFieldEx(FieldNode) - Method in LoggerForDifferentClassAstVisitor
visitFieldEx(FieldNode) - Method in LoggerWithWrongModifiersAstVisitor
visitFieldEx(FieldNode) - Method in LoggingSwallowsStacktraceAstVisitor
visitFieldEx(FieldNode) - Method in MultipleLoggersAstVisitor
visitFieldEx(FieldNode) - Method in ScopedConfusingMethodNameAstVisitor
visitFieldEx(FieldNode) - Method in SerialVersionUIDAstVisitor
visitFieldEx(FieldNode) - Method in StatelessClassAstVisitor
visitFieldEx(FieldNode) - Method in StaticCalendarFieldAstVisitor
visitFieldEx(FieldNode) - Method in StaticDateFormatFieldAstVisitor
visitFieldEx(FieldNode) - Method in StaticMatcherFieldAstVisitor
visitFieldEx(FieldNode) - Method in ThreadLocalNotStaticFinalAstVisitor
visitFieldEx(FieldNode) - Method in UnnecessaryTransientModifierAstVisitor
visitFieldEx(FieldNode) - Method in VolatileArrayFieldAstVisitor
visitFieldEx(FieldNode) - Method in VolatileLongOrDoubleFieldVisitor
visitForLoop(ForStatement) - Method in BusyWaitAstVisitor
visitForLoop(ForStatement) - Method in EmptyForStatementAstVisitor
visitForLoop(ForStatement) - Method in ForStatementBracesAstVisitor
visitForLoop(ForStatement) - Method in NestedBlockDepthAstVisitor
visitGStringExpression(GStringExpression) - Method in UnnecessaryGStringAstVisitor
visitIfElse(IfStatement) - Method in AssignmentInConditionalAstVisitor
visitIfElse(IfStatement) - Method in ConstantIfExpressionAstVisitor
visitIfElse(IfStatement) - Method in DoubleCheckedLockingAstVisitor
visitIfElse(IfStatement) - Method in ElseBlockBracesAstVisitor
visitIfElse(IfStatement) - Method in EmptyElseBlockAstVisitor
visitIfElse(IfStatement) - Method in EmptyIfStatementAstVisitor
visitIfElse(IfStatement) - Method in IfStatementBracesAstVisitor
visitIfElse(IfStatement) - Method in InvertedIfElseAstVisitor
visitIfElse(IfStatement) - Method in NestedBlockDepthAstVisitor
visitIfElse(IfStatement) - Method in UnnecessaryIfStatementAstVisitor
visitImports(ModuleNode) - Method in GroovyLangImmutableAstVisitor
visitImports(ModuleNode) - Method in UnnecessarySemicolonAstVisitor
visitListExpression(ListExpression) - Method in DuplicateLiteralAstVisitor
visitMapEntryExpression(MapEntryExpression) - Method in DuplicateLiteralAstVisitor
visitMapEntryExpression(MapEntryExpression) - Method in GStringAsMapKeyAstVisitor
visitMethod(MethodNode) - Method in AbstractAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in AssertionTrap
visitMethodCallExpression(MethodCallExpression) - Method in BooleanGetBooleanAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in ChainedTestAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in ConsecutiveLiteralAppendsAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in CoupledTestCaseAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in DuplicateLiteralAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in ExplicitCallToMethodAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in ExplicitGarbageCollectionAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in IntegerGetIntegerAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in JUnitAssertAlwaysFailsAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in JUnitAssertAlwaysSucceedsAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in JUnitFailWithoutMessageRuleAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in JUnitStyleAssertionsAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in PrintlnAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in PrintStackTraceAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in ReferenceCollector
visitMethodCallExpression(MethodCallExpression) - Method in RemoveAllOnSelfAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in SystemErrPrintAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in SystemOutPrintAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in SystemRunFinalizersOnExitAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in ThreadGroupAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in ThreadYieldAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnnecessaryBooleanInstantiationAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnnecessaryCallForLastElementAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnnecessaryCallToSubstringAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnnecessaryCollectCallAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnnecessaryCollectionCallAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnnecessaryGetterAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnnecessaryInstantiationToGetClassAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnusedPrivateFieldAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnusedPrivateMethodAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UnusedVariableAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UseAssertEqualsInsteadOfAssertTrueAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UseAssertFalseInsteadOfNegationAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UseAssertNullInsteadOfAssertEqualsAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UseAssertSameInsteadOfAssertTrueAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UseAssertTrueInsteadOfAssertEqualsAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UseAssertTrueInsteadOfNegationAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in UseOfNotifyMethodAstVisitor
visitMethodCallExpression(MethodCallExpression) - Method in WaitOutsideOfWhileLoopAstVisitor
visitMethodComplete(MethodNode) - Method in AbstractAstVisitor
visitMethodEx(MethodNode) - Method in AbstractAstVisitor
visitMethodEx(MethodNode) - Method in BooleanMethodReturnsNullAstVisitor
visitMethodEx(MethodNode) - Method in CloseWithoutCloseableAstVisitor
visitMethodEx(MethodNode) - Method in CompareToWithoutComparableAstVisitor
visitMethodEx(MethodNode) - Method in EmptyMethodAstVisitor
visitMethodEx(MethodNode) - Method in EmptyMethodInAbstractClassAstVisitor
visitMethodEx(MethodNode) - Method in EmptyStaticInitializerAstVisitor
visitMethodEx(MethodNode) - Method in GrailsPublicControllerMethodAstVisitor
visitMethodEx(MethodNode) - Method in ImplementationAsTypeAstVisitor
visitMethodEx(MethodNode) - Method in InconsistentPropertyLockingAstVisitor
visitMethodEx(MethodNode) - Method in InconsistentPropertySynchronizationAstVisitor
visitMethodEx(MethodNode) - Method in JUnitPublicNonTestMethodAstVisitor
visitMethodEx(MethodNode) - Method in JUnitSetUpCallsSuperAstVisitor
visitMethodEx(MethodNode) - Method in JUnitTearDownCallsSuperAstVisitor
visitMethodEx(MethodNode) - Method in JUnitTestMethodWithoutAssertAstVisitor
visitMethodEx(MethodNode) - Method in JUnitUnnecessarySetUpAstVisitor
visitMethodEx(MethodNode) - Method in JUnitUnnecessaryTearDownAstVisitor
visitMethodEx(MethodNode) - Method in MethodNameAstVisitor
visitMethodEx(MethodNode) - Method in ObjectOverrideMisspelledMethodNameAstVisitor
visitMethodEx(MethodNode) - Method in ParameterNameAstVisitor
visitMethodEx(MethodNode) - Method in ReturnsNullInsteadOfEmptyArrayAstVisitor
visitMethodEx(MethodNode) - Method in ReturnsNullInsteadOfEmptyCollectionRuleAstVisitor
visitMethodEx(MethodNode) - Method in ScopedConfusingMethodNameAstVisitor
visitMethodEx(MethodNode) - Method in SynchronizedMethodAstVisitor
visitMethodEx(MethodNode) - Method in SynchronizedReadObjectMethodAstVisitor
visitMethodEx(MethodNode) - Method in UnnecessaryDefInMethodDeclarationAstVisitor
visitMethodEx(MethodNode) - Method in UnnecessaryOverridingMethodAstVisitor
visitMethodEx(MethodNode) - Method in UnnecessaryPublicModifierAstVisitor
visitMethodEx(MethodNode) - Method in UnnecessaryReturnKeywordAstVisitor
visitMethodEx(MethodNode) - Method in UnnecessarySemicolonAstVisitor
visitMethodEx(MethodNode) - Method in UnusedPrivateFieldAstVisitor
visitMethodEx(MethodNode) - Method in UnusedPrivateMethodParameterAstVisitor
visitMethodPointerExpression(MethodPointerExpression) - Method in UnusedPrivateMethodAstVisitor
visitNotExpression(NotExpression) - Method in DoubleNegativeAstVisitor
visitNotExpression(NotExpression) - Method in UnnecessaryBooleanExpressionAstVisitor
visitObjectInitializerStatements(ClassNode) - Method in EmptyInstanceInitializerAstVisitor
visitProperty(PropertyNode) - Method in AbstractAstVisitor
visitPropertyEx(PropertyNode) - Method in AbstractAstVisitor
visitPropertyEx(PropertyNode) - Method in FieldNameAstVisitor
visitPropertyEx(PropertyNode) - Method in PropertyNameAstVisitor
visitPropertyEx(PropertyNode) - Method in SerialVersionUIDAstVisitor
visitPropertyEx(PropertyNode) - Method in UnusedPrivateFieldAstVisitor
visitPropertyExpression(PropertyExpression) - Method in UnusedPrivateFieldAstVisitor
visitReturnStatement(ReturnStatement) - Method in ArrayReturnTracker
visitReturnStatement(ReturnStatement) - Method in BooleanReturnTracker
visitReturnStatement(ReturnStatement) - Method in CollectionReturnTracker
visitReturnStatement(ReturnStatement) - Method in DuplicateLiteralAstVisitor
visitReturnStatement(ReturnStatement) - Method in NullReturnTracker
visitReturnStatement(ReturnStatement) - Method in ReturnFromFinallyBlockAstVisitor
visitShortTernaryExpression(ElvisOperatorExpression) - Method in AssignmentInConditionalAstVisitor
visitShortTernaryExpression(ElvisOperatorExpression) - Method in DuplicateLiteralAstVisitor
visitStaticMethodCallExpression(StaticMethodCallExpression) - Method in DuplicateLiteralAstVisitor
visitSwitch(SwitchStatement) - Method in DuplicateCaseStatementAstVisitor
visitSwitch(SwitchStatement) - Method in EmptySwitchStatementAstVisitor
visitSynchronizedStatement(SynchronizedStatement) - Method in EmptySynchronizedStatementAstVisitor
visitSynchronizedStatement(SynchronizedStatement) - Method in NestedBlockDepthAstVisitor
visitSynchronizedStatement(SynchronizedStatement) - Method in NestedSynchronizationAstVisitor
visitSynchronizedStatement(SynchronizedStatement) - Method in SynchronizedOnBoxedPrimitiveAstVisitor
visitSynchronizedStatement(SynchronizedStatement) - Method in SynchronizedOnGetClassAstVisitor
visitSynchronizedStatement(SynchronizedStatement) - Method in SynchronizedOnReentrantLockAstVisitor
visitSynchronizedStatement(SynchronizedStatement) - Method in SynchronizedOnStringAstVisitor
visitSynchronizedStatement(SynchronizedStatement) - Method in SynchronizedOnThisAstVisitor
visitTernaryExpression(TernaryExpression) - Method in AssignmentInConditionalAstVisitor
visitTernaryExpression(TernaryExpression) - Method in ConfusingTernaryAstVisitor
visitTernaryExpression(TernaryExpression) - Method in ConstantTernaryExpressionAstVisitor
visitTernaryExpression(TernaryExpression) - Method in UnnecessaryTernaryExpressionAstVisitor
visitThrowStatement(ThrowStatement) - Method in CommonThrowAstVisitor
visitThrowStatement(ThrowStatement) - Method in MissingNewInThrowStatementAstVisitor
visitThrowStatement(ThrowStatement) - Method in ThrowExceptionFromFinallyBlockAstVisitor
visitTryCatchFinally(TryCatchStatement) - Method in AbstractFinallyAstVisitor
visitTryCatchFinally(TryCatchStatement) - Method in EmptyFinallyBlockAstVisitor
visitTryCatchFinally(TryCatchStatement) - Method in EmptyTryBlockAstVisitor
visitTryCatchFinally(TryCatchStatement) - Method in NestedBlockDepthAstVisitor
visitTryCatchFinally(TryCatchStatement) - Method in UnnecessaryCatchBlockAstVisitor
visitVariableExpression(VariableExpression) - Method in GrailsServletContextReferenceAstVisitor
visitVariableExpression(VariableExpression) - Method in GrailsSessionReferenceAstVisitor
visitVariableExpression(VariableExpression) - Method in ReferenceCollector
visitVariableExpression(VariableExpression) - Method in UnusedPrivateFieldAstVisitor
visitVariableExpression(VariableExpression) - Method in UnusedVariableAstVisitor
visitVariableExpression(VariableExpression) - Method in VariableUsageFinder
visitWhileLoop(WhileStatement) - Method in AssignmentInConditionalAstVisitor
visitWhileLoop(WhileStatement) - Method in BusyWaitAstVisitor
visitWhileLoop(WhileStatement) - Method in EmptyWhileStatementAstVisitor
visitWhileLoop(WhileStatement) - Method in NestedBlockDepthAstVisitor
visitWhileLoop(WhileStatement) - Method in WaitOutsideOfWhileLoopAstVisitor
visitWhileLoop(WhileStatement) - Method in WhileStatementBracesAstVisitor
VolatileArrayFieldAstVisitor - Class in org.codenarc.rule.concurrency
VolatileArrayFieldRule - Class in org.codenarc.rule.concurrency
Volatile array fields are unsafe because the contents of the array are not treated as volatile.
VolatileLongOrDoubleFieldRule - Class in org.codenarc.rule.concurrency
This rule reports long or double fields which are declared as volatile.
VolatileLongOrDoubleFieldVisitor - Class in org.codenarc.rule.concurrency

W

WaitOutsideOfWhileLoopAstVisitor - Class in org.codenarc.rule.concurrency
WaitOutsideOfWhileLoopRule - Class in org.codenarc.rule.concurrency
Checks for calls to wait() that are not within a while loop.
WhileStatementBracesAstVisitor - Class in org.codenarc.rule.braces
WhileStatementBracesRule - Class in org.codenarc.rule.braces
Rule that checks that while statements use braces rather than a single statement.
WildcardPattern - Class in org.codenarc.util
Represents a string pattern that may optionally include wildcards ('*', '**' or '?')
WildcardPattern(String, boolean) - Constructor in WildcardPattern
Construct a new WildcardPattern instance on a single pattern or a comma-separated list of patterns.
writeReport(AnalysisContext, Results) - Method in AbstractReportWriter
Write out a report for the specified analysis results
writeReport(Writer, AnalysisContext, Results) - Method in HtmlReportWriter
Write out a report to the specified Writer for the analysis results
writeReport(AnalysisContext, Results) - Method in ReportWriter
Write out a report for the specified analysis results
writeReport(Writer, AnalysisContext, Results) - Method in TextReportWriter
writeReport(Writer, AnalysisContext, Results) - Method in XmlReportWriter

X

XmlFileRuleSet - Class in org.codenarc.ruleset
A RuleSet implementation that parses Rule definitions from XML read from a file.
XmlFileRuleSet(String) - Constructor in XmlFileRuleSet
Construct a new instance on the specified RuleSet file path
XmlReaderRuleSet - Class in org.codenarc.ruleset
A RuleSet implementation that parses Rule definitions from XML read from a Reader.
XmlReaderRuleSet(Reader) - Constructor in XmlReaderRuleSet
Construct a new instance on the specified Reader
XmlReportWriter - Class in org.codenarc.report
ReportWriter that generates an XML report.

Y


Z


_


Groovy Documentation