AbcMetricAstVisitor - Class in org.codenarc.rule.size
AbcMetricRule - Class in org.codenarc.rule.size
Rule that calculates the ABC metric score 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.
AbstractClassWithPublicConstructorAstVisitor - Class in org.codenarc.rule.design
AbstractClassWithPublicConstructorRule - Class in org.codenarc.rule.design
An abstract class cannot be instantiated, therefore a public constructor is useless and confusing.
AbstractCodeNarcPlugin - Class in org.codenarc.plugin
Abstract superclass for CodeNarcPlugin implementations.
AbstractConstructorCallAstVisitor - Class in org.codenarc.rule
Abstract superclass for AST Visitor classes that deal with constructor calls
AbstractEnhanceableAstVisitorRule - Class in org.codenarc.rule
Abstract superclass for Rules that use a Groovy AST Visitor and can optionally run in enhanced mode.
AbstractFieldVisitor - Class in org.codenarc.rule
This is the base class for AST Visitors that only need to visit the fields of
a class.
AbstractFinallyAstVisitor - Class in org.codenarc.rule.basic
Abstract superclass for AST Visitor classes that check for conditions within a finally block
AbstractHtmlReportWriter - Class in org.codenarc.report
Abstract superclass for HTML ReportWriter classes.
AbstractImportRule - Class in org.codenarc.rule.imports
Abstract class with common functionalities for import-related rules.
AbstractJavadocEmptyTagRule - Class in org.codenarc.rule.comments
Abstract superclass for rules that checks for empty javadoc tags.
AbstractJavadocMissingDescriptionRule - Class in org.codenarc.rule.comments
Abstract superclass for rules that checks for missing descriptions on javadoc tags.
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.
AbstractMethodCallExpressionVisitor - Class in org.codenarc.rule
This is the base class for AST Visitors that only need to visit the MethodCallExpressions of
a class.
AbstractMethodMetricAstVisitor - Class in org.codenarc.rule.size
Abstract superclass for AstVisitor classes that use method-level GMetrics Metrics.
AbstractMethodVisitor - Class in org.codenarc.rule
This is the base class for AST Visitors that only need to visit the methods of
a class.
AbstractReportWriter - Class in org.codenarc.report
Abstract superclass for ReportWriter implementation classes.
AbstractRule - Class in org.codenarc.rule
Abstract superclass for Rules.
AbstractRuleTestCase - Class in org.codenarc.rule
Abstract generic superclass for tests of Rule classes
AbstractSharedAstVisitorRule - Class in org.codenarc.rule
Abstract superclass for Rules that use a single, shared AstVisitor across all ClassNodes in a source (file).
AbstractSingleSpaceAfterKeywordAstVisitor - Class in org.codenarc.rule.formatting
Abstract superclass for AstVisitor classes that checks that there is exactly one space (blank) after a keyword
and before the opening parenthesis.
AbstractSourceAnalyzer - Class in org.codenarc.analyzer
Common functionality for SourceAnalyzers.
AbstractSourceCode - Class in org.codenarc.source
Abstract superclass for SourceCode implementations
AbstractSpaceAroundBraceAstVisitor - Class in org.codenarc.rule.formatting
Abstract superclass for AstVisitor classes dealing with space around braces
AbstractTestCase - Class in org.codenarc.test
Abstract superclass for tests
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.unnecessary
AddEmptyStringRule - Class in org.codenarc.rule.unnecessary
Finds empty string literals which are being added.
addError(String, ASTNode) - Method in AbstractFieldVisitor
addError(String, ASTNode) - Method in AbstractMethodCallExpressionVisitor
addError(String, ASTNode) - Method in AbstractMethodVisitor
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.
addViolation(FieldNode, String) - Method in AbstractFieldVisitor
Add a new Violation to the list of violations found by this visitor.
addViolation(MethodCallExpression, String) - Method in AbstractMethodCallExpressionVisitor
Add a new Violation to the list of violations found by this visitor.
addViolation(MetricResult, String) - Method in AbstractMethodMetricAstVisitor
addViolation(ClassNode, String) - Method in AbstractMethodVisitor
Add a new Violation to the list of violations found by this visitor.
addViolationForSunImport(ImportNode, SourceCode, List) - Method in ImportFromSunPackagesRule
ALL_RULES - Field in LookupTable
allowedFieldModifiersList - Field in IllegalClassMemberRule
allowedFieldModifiersString - Field in IllegalClassMemberRule
allowedMethodModifiersList - Field in IllegalClassMemberRule
allowedMethodModifiersString - Field in IllegalClassMemberRule
allowedPropertyModifiersList - Field in IllegalClassMemberRule
allowedPropertyModifiersString - Field in IllegalClassMemberRule
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 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
AnalyzerException - Class in org.codenarc.analyzer
Exception thrown by the SourceAnalyzer
AnalyzerException(String) - Constructor in AnalyzerException
AntFileSetSourceAnalyzer - Class in org.codenarc.ant
SourceAnalyzer implementation that gets source files from one or more Ant FileSets.
AntFileSetSourceAnalyzer(Project, FileSet) - Constructor in AntFileSetSourceAnalyzer
Construct a new instance on the specified Ant FileSet.
applyRuleTo(String) - Method in AbstractRuleTestCase
Apply the current Rule to the specified source (String) and return the resulting List of Violations.
applyTo(SourceCode, List<Violation>) - Method in AbstractAstVisitorRule
applyTo(SourceCode, List<Violation>) - Method in AbstractJavadocEmptyTagRule
applyTo(SourceCode, List<Violation>) - Method in AbstractJavadocMissingDescriptionRule
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<Violation>) - Method in AbstractSharedAstVisitorRule
applyTo(SourceCode, List<Violation>) - Method in BlankLineBeforePackageRule
applyTo(SourceCode, List<Violation>) - Method in BracesForClassRule
applyTo(SourceCode, List<Violation>) - Method in ClassJavadocRule
Apply the rule to the given source, writing violations to the given list.
applyTo(SourceCode, List<Violation>) - Method in ClassNameSameAsFilenameRule
applyTo(SourceCode, List<Violation>) - Method in ConsecutiveBlankLinesRule
Apply the rule to the given source, writing violations to the given list.
applyTo(SourceCode, List<Violation>) - Method in DuplicateImportRule
applyTo(SourceCode, List<Violation>) - Method in FileEndsWithoutNewlineRule
Apply the rule to the given source, writing violations to the given list.
applyTo(SourceCode, List<Violation>) - Method in IllegalRegexRule
applyTo(SourceCode, List<Violation>) - Method in IllegalStringRule
applyTo(SourceCode, List<Violation>) - Method in ImportFromSamePackageRule
applyTo(SourceCode, List<Violation>) - Method in ImportFromSunPackagesRule
applyTo(SourceCode, List<Violation>) - Method in IndentationRule
applyTo(SourceCode, List<Violation>) - Method in JavadocConsecutiveEmptyLinesRule
applyTo(SourceCode, List<Violation>) - Method in JavadocEmptyFirstLineRule
applyTo(SourceCode, List<Violation>) - Method in JavadocEmptyLastLineRule
applyTo(SourceCode, List<Violation>) - Method in LineLengthRule
applyTo(SourceCode, List<Violation>) - Method in MisorderedStaticImportsRule
applyTo(SourceCode, List<Violation>) - Method in MissingBlankLineAfterImportsRule
applyTo(SourceCode, List<Violation>) - Method in MissingBlankLineAfterPackageRule
applyTo(SourceCode, List<Violation>) - Method in NoTabCharacterRule
applyTo(SourceCode, List<Violation>) - Method in NoWildcardImportsRule
applyTo(SourceCode, List<Violation>) - Method in PackageNameMatchesFilePathRule
applyTo(SourceCode, List<Violation>) - Method in RequiredRegexRule
applyTo(SourceCode, List<Violation>) - 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<Violation>) - Method in StubRule
applyTo(SourceCode, List<Violation>) - Method in TrailingWhitespaceRule
applyTo(SourceCode, List<Violation>) - Method in UnnecessaryGroovyImportRule
applyTo(SourceCode, List<Violation>) - Method in UnnecessarySemicolonRule
applyTo(SourceCode, List<Violation>) - Method in UnusedImportRule
applyTo(SourceCode, List<Violation>) - Method in UnusedVariableRule
applyVisitor(AstVisitor, SourceCode) - Method in AbstractSharedAstVisitorRule
areJoinableConstants(Expression, Expression) - Method in ConsecutiveUtils
areTheSameConstantOrLiteralLists(ListExpression, ListExpression) - Method in DryUtil
@return true only if both ListExpressions have the same set of constant or literal values, in the same order.
areTheSameConstantOrLiteralMapEntryExpression(MapEntryExpression, MapEntryExpression) - Method in DryUtil
@return true only if both MapEntryExpressions have the same constant or literal key and value
areTheSameConstantOrLiteralMaps(MapExpression, MapExpression) - Method in DryUtil
@return true only if both MapExpressions have the same set of constant or literal keys and values, in the same order.
ArrayReturnTracker - Class in org.codenarc.rule.design
assertClassImplementsRuleInterface(Class) - Method in RuleSetUtil
assertInlineViolations(String) - Method in AbstractRuleTestCase
Apply the current Rule to the specified source (String) and assert that it results
in the violations specified inline within the source.
AssertionTrap - Class in org.codenarc.rule.junit
Visits code searching for assert statements or assert.* method calls.
assertNoViolations(String) - Method in AbstractRuleTestCase
Apply the current Rule to the specified source (String) and assert that it results
in no violations.
assertSingleViolation(String, Closure) - Method in AbstractRuleTestCase
Apply the current Rule to the specified source (String) and assert that it results
in a single violation and that the specified closure returns true.
assertTwoViolations(String, Integer, String, def, Integer, String, def) - Method in AbstractRuleTestCase
Apply the current Rule to the specified source (String) and assert that it results
in two violations with the specified line numbers and containing the specified source text values.
assertViolation(Violation, Integer, String, def) - Method in AbstractRuleTestCase
Assert that the specified violation is for the current rule, and has expected line number
and contains the specified source text and message text.
assertViolations(String, Map) - Method in AbstractRuleTestCase
Apply the current Rule to the specified source (String) and assert that it results
in the violations specified in violationMaps.
AssertWithinFinallyBlockAstVisitor - Class in org.codenarc.rule.basic
AssertWithinFinallyBlockRule - Class in org.codenarc.rule.basic
Rule that checks for assert statements within a finally block.
AssignCollectionSortAstVisitor - Class in org.codenarc.rule.groovyism
AssignCollectionSortRule - Class in org.codenarc.rule.groovyism
The Collections.sort() method mutates the list and returns the list as a value.
AssignCollectionUniqueAstVisitor - Class in org.codenarc.rule.groovyism
AssignCollectionUniqueRule - Class in org.codenarc.rule.groovyism
The unique() method mutates the original list.
AssignmentInConditionalAstVisitor - Class in org.codenarc.rule.basic
AssignmentInConditionalRule - Class in org.codenarc.rule.basic
An assignment operator (=) was used in a conditional test.
AssignmentToStaticFieldFromInstanceMethodAstVisitor - Class in org.codenarc.rule.design
AssignmentToStaticFieldFromInstanceMethodRule - Class in org.codenarc.rule.design
Checks for assignment to a static field from an instance method.
AssignmentTracker - Class in org.codenarc.rule.basic
AstUtil - Class in org.codenarc.util
Contains static utility methods and constants related to Groovy AST.
AstVisitor - Interface in org.codenarc.rule
Interface for Groovy AST Visitors used with Rules
AUTO_IMPORTED_CLASSES - Field in AstUtil
AUTO_IMPORTED_PACKAGES - Field in AstUtil
BASE_MESSAGES_BUNDLE - Field in AbstractReportWriter
baseDir - Field in CodeNarc
BaselineResultsPlugin - Class in org.codenarc.plugin.baseline
CodeNarc Plugin that removes matching violations specified in a Baseline report.
BaselineResultsPlugin(Resource) - Constructor in BaselineResultsPlugin
BaselineViolation - Class in org.codenarc.report
Represents a single violation within a baseline report
baselineViolationsMap - Field in BaselineResultsPlugin
BaselineXmlReportParser - Class in org.codenarc.report
Parser for the BaselineXmlReportWriter report
BaselineXmlReportWriter - Class in org.codenarc.report
ReportWriter that generates a baseline XML report.
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.
BitwiseOperatorInConditionalAstVisitor - Class in org.codenarc.rule.basic
BitwiseOperatorInConditionalRule - Class in org.codenarc.rule.basic
Checks for bitwise operations in conditionals, if you need to do a bitwise operation then it is best practice to extract a temp variable.
BlankLineBeforePackageRule - Class in org.codenarc.rule.formatting
Makes sure there are no blank lines before the package declaration of a source code file.
BlockEndsWithBlankLineAstVisitor - Class in org.codenarc.rule.formatting
BlockEndsWithBlankLineRule - Class in org.codenarc.rule.formatting
Checks that code blocks such as method bodies, closures and control structure bodies do not end with an empty line.
BlockStartsWithBlankLineAstVisitor - Class in org.codenarc.rule.formatting
BlockStartsWithBlankLineRule - Class in org.codenarc.rule.formatting
Checks that code blocks do not start with an empty line.
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.design
BooleanMethodReturnsNullRule - Class in org.codenarc.rule.design
Method with Boolean return type returns explicit null.
BooleanReturnTracker - Class in org.codenarc.rule.design
BracesForClassRule - Class in org.codenarc.rule.formatting
Checks the location of the opening brace ({) for classes.
BracesForForLoopAstVisitor - Class in org.codenarc.rule.formatting
BracesForForLoopRule - Class in org.codenarc.rule.formatting
Checks the location of the opening brace ({) for for loops.
BracesForIfElseAstVisitor - Class in org.codenarc.rule.formatting
BracesForIfElseRule - Class in org.codenarc.rule.formatting
Checks the location of the opening brace ({) for if statements and optionally closing and opening braces
for else statements.
BracesForMethodAstVisitor - Class in org.codenarc.rule.formatting
BracesForMethodRule - Class in org.codenarc.rule.formatting
Checks the location of the opening brace ({) for constructors and methods.
BracesForTryCatchFinallyAstVisitor - Class in org.codenarc.rule.formatting
BracesForTryCatchFinallyRule - Class in org.codenarc.rule.formatting
Checks the location of the opening brace ({) for try statements, the location
of the 'catch' keyword and corresponding opening braces, and the location of the 'finally'
keyword and the corresponding opening braces.
BrokenNullCheckAstVisitor - Class in org.codenarc.rule.basic
BrokenNullCheckRule - Class in org.codenarc.rule.basic
Looks for faulty checks for null in boolean conditions, e.g.
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).
buildBodySection(AnalysisContext, Results) - Method in AbstractHtmlReportWriter
buildBodySection(AnalysisContext, Results) - Method in HtmlReportWriter
buildBodySection(AnalysisContext, Results) - Method in SortableHtmlReportWriter
buildCSS() - Method in AbstractHtmlReportWriter
BuilderMethodWithSideEffectsAstVisitor - Class in org.codenarc.rule.design
BuilderMethodWithSideEffectsRule - Class in org.codenarc.rule.design
A builder method is defined as one that creates objects.
buildFileElement(FileResults) - Method in BaselineXmlReportWriter
buildFileElement(FileResults) - Method in JsonReportWriter
buildFileElement(FileResults) - Method in XmlReportWriter
buildFileElements(Results) - Method in BaselineXmlReportWriter
buildHeaderSection() - Method in AbstractHtmlReportWriter
buildLogo() - Method in AbstractHtmlReportWriter
buildMessageElement(Violation) - Method in BaselineXmlReportWriter
buildMessageElement(Violation) - Method in XmlReportWriter
buildPackageAttributeMap(Results) - Method in JsonReportWriter
buildPackageAttributeMap(Results) - Method in XmlReportWriter
buildPackageElement(Results) - Method in XmlReportWriter
buildPackageElements(Results) - Method in JsonReportWriter
buildPackageElements(Results) - Method in XmlReportWriter
buildProjectElement(AnalysisContext) - Method in BaselineXmlReportWriter
buildProjectElement(AnalysisContext) - Method in JsonReportWriter
buildProjectElement(AnalysisContext) - Method in XmlReportWriter
buildReportElement() - Method in BaselineXmlReportWriter
buildReportElement() - Method in JsonReportWriter
buildReportElement() - Method in XmlReportWriter
buildReportMetadata() - Method in AbstractHtmlReportWriter
buildRuleDescriptions(AnalysisContext) - Method in AbstractHtmlReportWriter
buildRulesElement(AnalysisContext) - Method in InlineXmlReportWriter
buildRulesElement(AnalysisContext) - Method in JsonReportWriter
buildRulesElement(AnalysisContext) - Method in XmlReportWriter
buildScript() - Method in AbstractHtmlReportWriter
buildScript() - Method in SortableHtmlReportWriter
buildSourceLineElement(Violation) - Method in XmlReportWriter
buildSummaryElement(Results) - Method in JsonReportWriter
buildTitle() - Method in AbstractHtmlReportWriter
buildViolationElement(Violation) - Method in BaselineXmlReportWriter
buildViolationElement(Violation) - Method in InlineXmlReportWriter
buildViolationElement(Violation) - Method in JsonReportWriter
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.
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 XmlReportUtil
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.
checkForSingleSpaceAndOpeningParenthesis(ASTNode, String) - Method in AbstractSingleSpaceAfterKeywordAstVisitor
checkMaxViolations(Results, int, int) - Method in CodeNarc
CLASS_LOADER_SYS_PROP - Field in RuleSetUtil
ClassConstraintsAndMapping - Class in org.codenarc.rule.grails
ClassEndsWithBlankLineAstVisitor - Class in org.codenarc.rule.formatting
ClassEndsWithBlankLineRule - Class in org.codenarc.rule.formatting
Check whether the class ends with a blank line.
ClassForNameAstVisitor - Class in org.codenarc.rule.basic
ClassForNameRule - Class in org.codenarc.rule.basic
Using Class.forName(...) is a common way to add dynamic behavior to a system.
ClassJavadocRule - Class in org.codenarc.rule.comments
Makes sure each class and interface definition is preceded by javadoc.
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.
ClassNameSameAsFilenameRule - Class in org.codenarc.rule.naming
Reports files containing only one top level class / enum / interface which is named differently than the file.
ClassNameSameAsSuperclassAstVisitor - Class in org.codenarc.rule.naming
ClassNameSameAsSuperclassRule - Class in org.codenarc.rule.naming
Checks for any class that has an identical name to its superclass, other than the package.
classNodeHasProperty(ClassNode, String) - Method in AstUtil
classNodeImplementsType(ClassNode, Class) - Method in AstUtil
This method tells you if a ClassNode implements or extends a certain class.
classNodeIndentLevels - Field in IndentationRule
classNodeType(ClassNode) - Method in ClassNameSameAsFilenameRule
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).
ClassReferenceAstVisitor - Class in org.codenarc.rule
AstVisitor that check for references for a named class
ClassReferenceAstVisitor(String, String) - Constructor in ClassReferenceAstVisitor
Constructor
ClassSizeAstVisitor - Class in org.codenarc.rule.size
ClassSizeRule - Class in org.codenarc.rule.size
Rule that checks the size of a class.
ClassStartsWithBlankLineAstVisitor - Class in org.codenarc.rule.formatting
ClassStartsWithBlankLineRule - Class in org.codenarc.rule.formatting
Check whether the class starts with a blank line.
CLEAR_METHOD_NAME - Field in ValueRecorder
clear() - Method in ValueRecorder
CloneableWithoutCloneAstVisitor - Class in org.codenarc.rule.design
CloneableWithoutCloneRule - Class in org.codenarc.rule.design
A class that implements Cloneable should define a clone() method.
CloneWithoutCloneableAstVisitor - Class in org.codenarc.rule.design
CloneWithoutCloneableRule - Class in org.codenarc.rule.design
The method clone() should only be declared if the class implements the Cloneable interface.
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.
CLOSURE_TEXT - Field in AbstractAstVisitorRule
ClosureAsLastMethodParameterAstVisitor - Class in org.codenarc.rule.groovyism
ClosureAsLastMethodParameterRule - Class in org.codenarc.rule.groovyism
If a method is called and the last parameter is an inline closure it can be declared outside of the method call brackets.
ClosureStatementOnOpeningLineOfMultipleLineClosureAstVisitor - Class in org.codenarc.rule.formatting
ClosureStatementOnOpeningLineOfMultipleLineClosureRule - Class in org.codenarc.rule.formatting
Checks for closure logic on first line (after ->) for a multi-line closure
CodeNarc - Class in org.codenarc
Command-line runner for CodeNarc.
CODENARC_PROPERTIES_FILE_PROP - Field in AbstractTestCase
CODENARC_URL - Field in AbstractReportWriter
CodeNarcPlugin - Interface in org.codenarc.plugin
The interface defining the set of hooks for a CodeNarc Plugin
CodeNarcRunner - Class in org.codenarc
Helper class to run CodeNarc.
CodeNarcTask - Class in org.codenarc.ant
Ant Task for running CodeNarc.
CodeNarcVersion - Class in org.codenarc.util
Utility class to return the current version of CodeNarc
CollectAllIsDeprecatedAstVisitor - Class in org.codenarc.rule.groovyism
CollectAllIsDeprecatedRule - Class in org.codenarc.rule.groovyism
collectAll is deprecated since Groovy 1.8.1.
CollectionReturnTracker - Class in org.codenarc.rule.design
collectViolations(SourceCode, RuleSet) - Method in AbstractSourceAnalyzer
CommentsUtil - Class in org.codenarc.rule.comments
Utility methods and constants related to comments rules
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
CompactTextReportWriter - Class in org.codenarc.report
ReportWriter that generates an simple ASCII text report, with one line per violation.
CompareToWithoutComparableAstVisitor - Class in org.codenarc.rule.design
CompareToWithoutComparableRule - Class in org.codenarc.rule.design
If you implement a compareTo method then you should also implement the Comparable interface.
COMPARISON_OPERATORS - Field in AstUtil
ComparisonOfTwoConstantsAstVisitor - Class in org.codenarc.rule.basic
ComparisonOfTwoConstantsRule - Class in org.codenarc.rule.basic
CodeNarc Rule.
ComparisonWithSelfAstVisitor - Class in org.codenarc.rule.basic
ComparisonWithSelfRule - Class in org.codenarc.rule.basic
CodeNarc Rule.
CompileStaticlVisitor - Class in org.codenarc.rule.convention
CompileStaticRule - Class in org.codenarc.rule.convention
Enforces classes are annotated either with one of the CompileStatic, GrailsCompileStatic or CompileDynamic
annotations
CompositeRuleSet - Class in org.codenarc.ruleset
A RuleSet
implementation that aggregates a set of RuleSets and Rules.
configure(RuleSet, String) - Method in PropertiesFileRuleSetConfigurer
Configure the rules within the RuleSet from the properties file (relative to the classpath).
configure(RuleSet, String) - Method in RuleSetConfigurer
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.
ConfusingMultipleReturnsAstVisitor - Class in org.codenarc.rule.groovyism
ConfusingMultipleReturnsRule - Class in org.codenarc.rule.groovyism
Multiple return values can be used to set several variables at once.
ConfusingTernaryAstVisitor - Class in org.codenarc.rule.convention
ConfusingTernaryRule - Class in org.codenarc.rule.convention
In an "if" expression with an "else" clause, avoid negation in the test.
ConsecutiveBlankLinesRule - Class in org.codenarc.rule.formatting
Makes sure there are no consecutive lines that are either blank or whitespace only.
ConsecutiveLiteralAppendsAstVisitor - Class in org.codenarc.rule.unnecessary
ConsecutiveLiteralAppendsRule - Class in org.codenarc.rule.unnecessary
Violations occur when method calls to append(Object) are chained together with literals as parameters.
ConsecutiveStringConcatenationAstVisitor - Class in org.codenarc.rule.unnecessary
ConsecutiveStringConcatenationRule - Class in org.codenarc.rule.unnecessary
Catches concatenation of two string literals on the same line.
ConsecutiveUtils - Class in org.codenarc.util
Utility class for Consecutive* rules.
ConstantAssertExpressionAstVisitor - Class in org.codenarc.rule.basic
ConstantAssertExpressionRule - Class in org.codenarc.rule.basic
Rule that checks for assert statements where the assert condition expressions is a constant value or literal value, such as:
assert true
assert false
assert Boolean.TRUE
assert Boolean.FALSE
assert null
assert 0
assert 99.7
assert ""
assert "abc"
assert [:]
assert [a:123, b:456]
assert [a, b, c]
ConstantExpressionExtractor - Class in org.codenarc.rule.groovyism
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:
if (true) { .. }
if (false) { .. }
if (Boolean.TRUE) { .. }
if (Boolean.FALSE) { .. }
if (null) { .. }
if (0) { .. }
if (99.7) { .. }
if ("") { .. }
if ("abc") { .. }
if ([a:123, b:456]) { .. }
if ([a, b]) { .. }
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:
CONSTRUCTOR_METHOD_NAME - Field in AbstractRuleTestCase
ConstructorsSkippingFieldReferenceAstVisitor - Class in org.codenarc.rule
AstVisitor that checks for references to fields outside of constructors
containsOnlyAsciiCharacters(String) - Method in SourceCodeUtil
CONTROLLERS_AND_TAGLIB_FILES - Field in GrailsUtil
CONTROLLERS_CLASSES - Field in GrailsUtil
CONTROLLERS_FILES - Field in GrailsUtil
CouldBeElvisAstVisitor - Class in org.codenarc.rule.convention
CouldBeElvisRule - Class in org.codenarc.rule.convention
Catch an if block that could be written as an elvis expression.
CouldBeSwitchStatementAstVisitor - Class in org.codenarc.rule.convention
CouldBeSwitchStatementRule - Class in org.codenarc.rule.convention
Checks for multiple if statements that could be converted to a switch
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.
CrapMetricAstVisitor - Class in org.codenarc.rule.size
CrapMetricAstVisitor(CrapMetric) - Constructor in CrapMetricAstVisitor
crapMetricClassName - Field in CrapMetricRule
CrapMetricRule - Class in org.codenarc.rule.size
Rule that calculates the CRAP Metric for methods/classes and checks against
configured threshold values.
createClasspath() - Method in CodeNarcTask
createCodeNarcRunner - Field in CodeNarc
createCodeNarcRunner - Field in CodeNarcTask
createErrorMessage() - Method in ExplicitTypeInstantiationAstVisitor
createInitialRuleSet() - Method in CodeNarcRunner
Create and return the RuleSet that provides the source of Rules to be applied.
createMetric() - Method in AbcMetricAstVisitor
createMetric() - Method in AbstractMethodMetricAstVisitor
createMetric() - Method in CrapMetricAstVisitor
createMetric() - Method in CyclomaticComplexityAstVisitor
createPrettyExpression(ASTNode) - Method in AstUtil
createRule() - Method in AbstractRuleTestCase
Create and return a new instance of the Rule class to be tested.
createSortedListOfAllRules() - Method in GenerateUtil
createSourceAnalyzer() - Method in CodeNarc
Create and return the SourceAnalyzer
createSourceAnalyzer() - Method in CodeNarcTask
Create and return the SourceAnalyzer
createViolation(SourceCode, ASTNode, String) - Method in AbstractRule
Create a new Violation for the AST node.
createViolationForImport(SourceCode, String, String, String) - Method in AbstractRule
Create and return a new Violation for this rule and the specified import className and alias
CSS_FILE - Field in AbstractHtmlReportWriter
currentClassNode - Field in AbstractMethodCallExpressionVisitor
CUSTOM_MESSAGES_BUNDLE - Field in AbstractReportWriter
CustomCompilerPhaseSourceDecorator - Class in org.codenarc.source
A
SourceCode decorator overriding the decorated source's returned AST
so that it meets the user's compilerPhase requirements.
CustomCompilerPhaseSourceDecorator(SourceCode, int) - Constructor in CustomCompilerPhaseSourceDecorator
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.
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_COMPILER_PHASE - Field in SourceCode
DEFAULT_CONST_NAME - Field in AbstractAstVisitorRule
DEFAULT_FIELD_NAME - Field in AbstractAstVisitorRule
DEFAULT_GORM_STATIC_METHOD_NAMES - Field in GrailsDomainGormMethodsRule
DEFAULT_OUTPUT_FILE - Field in HtmlReportWriter
DEFAULT_OUTPUT_FILE - Field in SortableHtmlReportWriter
DEFAULT_TEST_CLASS_NAMES - Field in AbstractAstVisitorRule
DEFAULT_TEST_CLASS_NAMES - Field in AbstractRuleTestCase
DEFAULT_TEST_FILES - Field in AbstractAstVisitorRule
DEFAULT_TEST_FILES - Field in AbstractRuleTestCase
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
DirectConnectionManagementAstVisitor - Class in org.codenarc.rule.jdbc
DirectConnectionManagementRule - Class in org.codenarc.rule.jdbc
The J2EE standard requires that applications use the container's resource management facilities to obtain
connections to resources.
DirectoryResults - Class in org.codenarc.results
Represents the results for a directory
DirectoryResults(String, int) - Constructor in DirectoryResults
Create a new instance with the specified path and number of files in the directory
disabledRuleNamesForLineNumber(Integer) - Method in LookupTable
DisableRulesInCommentsPlugin - Class in org.codenarc.plugin.disablerules
Plugin that enables enablement/disablement of rules (and removing their violations) using comments within the source code
DOMAIN_FILES - Field in GrailsUtil
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.
DryUtil - Class in org.codenarc.rule.dry
Utility methods for the DRY rule classes
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
DuplicateListLiteralAstVisitor - Class in org.codenarc.rule.dry
DuplicateListLiteralRule - Class in org.codenarc.rule.dry
Check for multiple instances of the same List literal, limited to Lists where the
values are all constants or literals.
DuplicateLiteralAstVisitor - Class in org.codenarc.rule.dry
Abstract superclass for rule AstVisitor classes that detect duplicate literal constants
DuplicateLiteralAstVisitor(List<Class>, Set, Closure) - Constructor in DuplicateLiteralAstVisitor
DuplicateMapKeyAstVisitor - Class in org.codenarc.rule.basic
DuplicateMapKeyRule - Class in org.codenarc.rule.basic
A map literal is created with duplicated key.
DuplicateMapLiteralAstVisitor - Class in org.codenarc.rule.dry
DuplicateMapLiteralRule - Class in org.codenarc.rule.dry
Check for multiple instances of the same Map literal, limited to Maps where the keys
and values are all constants or literals.
DuplicateNumberLiteralRule - Class in org.codenarc.rule.dry
Checks for duplication of constant number literal values.
DuplicateSetValueAstVisitor - Class in org.codenarc.rule.basic
DuplicateSetValueRule - Class in org.codenarc.rule.basic
A Set literal is created with duplicate constant value.
DuplicateStringLiteralRule - Class in org.codenarc.rule.dry
Code containing duplicate String literals can usually be improved by declaring the String as a constant field.
eachImportLine(SourceCode, Closure) - Method in AbstractImportRule
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
EmptyClassAstVisitor - Class in org.codenarc.rule.basic
EmptyClassRule - Class in org.codenarc.rule.basic
Reports classes without methods, fields or properties.
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
endsWithSemicolon(String, int) - Method in UnnecessarySemicolonRule
ENHANCED_MODE_SYSTEM_PROPERTY - Field in AbstractEnhanceableAstVisitorRule
Holds the name of the system property which allows to control the enhancedMode
property.
EnumCustomSerializationIgnoredAstVisitor - Class in org.codenarc.rule.serialization
EnumCustomSerializationIgnoredRule - Class in org.codenarc.rule.serialization
Checks for enums that define writeObject() or writeReplace() methods, or declare
serialPersistentFields or serialVersionUID fields, all of which are ignored for enums.
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.
EqualsOverloadedAstVisitor - Class in org.codenarc.rule.basic
EqualsOverloadedRule - Class in org.codenarc.rule.basic
The class has an equals method, but the parameter of the method is not of type Object.
ERROR_MESSAGE - Field in ParameterAssignmentInFilterClosureAstVisitor
ExceptionExtendsErrorAstVisitor - Class in org.codenarc.rule.exceptions
ExceptionExtendsErrorRule - Class in org.codenarc.rule.exceptions
Errors are system exceptions.
ExceptionExtendsThrowableAstVisitor - Class in org.codenarc.rule.exceptions
ExceptionExtendsThrowableRule - Class in org.codenarc.rule.exceptions
Checks for classes that extend Throwable.
ExceptionNotThrownAstVisitor - Class in org.codenarc.rule.exceptions
ExceptionNotThrownRule - Class in org.codenarc.rule.exceptions
Checks for an exception constructor call as the last statement within a catch block.
exclude(String) - Method in RuleSetDelegate
excludePattern - Field in NoDefRule
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
exists() - Method in ClassPathResource
@return true only if this resource exists and is accessible
exists() - Method in Resource
@return true only if this resource exists and is accessible
exists() - Method in UrlResource
@return true only if this resource exists and is accessible
ExplicitArrayListInstantiationRule - Class in org.codenarc.rule.groovyism
This rule checks for the explicit instantiation of an ArrayList using the no-arg constructor.
ExplicitCallToAndMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToAndMethodAstVisitor() - Constructor in ExplicitCallToAndMethodAstVisitor
ExplicitCallToAndMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the and(Object) method is called directly in code instead of using the & operator.
ExplicitCallToCompareToMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToCompareToMethodAstVisitor() - Constructor in ExplicitCallToCompareToMethodAstVisitor
ExplicitCallToCompareToMethodRule - Class in org.codenarc.rule.groovyism
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.groovyism
ExplicitCallToDivMethodAstVisitor() - Constructor in ExplicitCallToDivMethodAstVisitor
ExplicitCallToDivMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the div(Object) method is called directly in code instead of using the / operator.
ExplicitCallToEqualsMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToEqualsMethodAstVisitor() - Constructor in ExplicitCallToEqualsMethodAstVisitor
ExplicitCallToEqualsMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the equals(Object) method is called directly in code instead of using the == or !
ExplicitCallToGetAtMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToGetAtMethodAstVisitor() - Constructor in ExplicitCallToGetAtMethodAstVisitor
ExplicitCallToGetAtMethodRule - Class in org.codenarc.rule.groovyism
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.groovyism
ExplicitCallToLeftShiftMethodAstVisitor() - Constructor in ExplicitCallToLeftShiftMethodAstVisitor
ExplicitCallToLeftShiftMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the leftShift(Object) method is called directly in code instead of using the << operator.
ExplicitCallToMethodAstVisitor - Class in org.codenarc.rule.groovyism
Parent Visitor for "ExplicitCallToX" Rules.
ExplicitCallToMethodAstVisitor(String) - Constructor in ExplicitCallToMethodAstVisitor
@param methodName The method name to watch for.
ExplicitCallToMinusMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToMinusMethodAstVisitor() - Constructor in ExplicitCallToMinusMethodAstVisitor
ExplicitCallToMinusMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the minus(Object) method is called directly in code instead of using the - operator.
ExplicitCallToModMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToModMethodAstVisitor() - Constructor in ExplicitCallToModMethodAstVisitor
ExplicitCallToModMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the mod(Object) method is called directly in code instead of using the % operator.
ExplicitCallToMultiplyMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToMultiplyMethodAstVisitor() - Constructor in ExplicitCallToMultiplyMethodAstVisitor
ExplicitCallToMultiplyMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the multiply(Object) method is called directly in code instead of using the * operator.
ExplicitCallToOrMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToOrMethodAstVisitor() - Constructor in ExplicitCallToOrMethodAstVisitor
ExplicitCallToOrMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the or(Object) method is called directly in code instead of using the | operator.
ExplicitCallToPlusMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToPlusMethodAstVisitor() - Constructor in ExplicitCallToPlusMethodAstVisitor
ExplicitCallToPlusMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the plus(Object) method is called directly in code instead of using the + operator.
ExplicitCallToPowerMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToPowerMethodAstVisitor() - Constructor in ExplicitCallToPowerMethodAstVisitor
ExplicitCallToPowerMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the power(Object) method is called directly in code instead of using the ** operator.
ExplicitCallToPutAtMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToPutAtMethodAstVisitor() - Constructor in ExplicitCallToPutAtMethodAstVisitor
ExplicitCallToPutAtMethodRule - Class in org.codenarc.rule.groovyism
etects when the map.putAt(k, v) method is called directly rather than using map[k] = v.
ExplicitCallToRightShiftMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToRightShiftMethodAstVisitor() - Constructor in ExplicitCallToRightShiftMethodAstVisitor
ExplicitCallToRightShiftMethodRule - Class in org.codenarc.rule.groovyism
This rule detects when the rightShift(Object) method is called directly in code instead of using the >> operator.
ExplicitCallToXorMethodAstVisitor - Class in org.codenarc.rule.groovyism
ExplicitCallToXorMethodAstVisitor() - Constructor in ExplicitCallToXorMethodAstVisitor
ExplicitCallToXorMethodRule - Class in org.codenarc.rule.groovyism
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.groovyism
This rule checks for the explicit instantiation of a HashMap using the no-arg constructor.
ExplicitHashSetInstantiationRule - Class in org.codenarc.rule.groovyism
This rule checks for the explicit instantiation of a HashSet using the no-arg constructor.
ExplicitLinkedHashMapInstantiationRule - Class in org.codenarc.rule.groovyism
This rule checks for the explicit instantiation of a LinkedHashMap using the no-arg constructor.
ExplicitLinkedListInstantiationRule - Class in org.codenarc.rule.groovyism
This rule checks for the explicit instantiation of a LinkedList using the no-arg constructor.
ExplicitStackInstantiationRule - Class in org.codenarc.rule.groovyism
This rule checks for the explicit instantiation of a Stack using the no-arg constructor.
ExplicitTreeSetInstantiationRule - Class in org.codenarc.rule.groovyism
This rule checks for the explicit instantiation of a TreeSet using the no-arg constructor.
ExplicitTypeInstantiationAstVisitor - Class in org.codenarc.rule.groovyism
AstVisitor that checks for no-arg constructor calls for the type specified in the constructor.
ExplicitTypeInstantiationAstVisitor(String) - Constructor in ExplicitTypeInstantiationAstVisitor
expressionIsAssignment(ASTNode, String) - Method in AstUtil
expressionIsNullCheck(ASTNode) - Method in AstUtil
extractFrom(AnnotationNode) - Method in ConstantExpressionExtractor
extractMethodName(def) - Method in AbstractMethodMetricAstVisitor
FactoryMethodNameAstVisitor - Class in org.codenarc.rule.naming
FactoryMethodNameRule - Class in org.codenarc.rule.naming
A factory method is a method that creates objects, and they are typically named either buildFoo(), makeFoo(), or
createFoo().
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.
FieldReferenceAstVisitor - Class in org.codenarc.rule
AST Visitor that searches for references to the fields specified on the constructor
FieldReferenceAstVisitor(Collection<FieldNode>) - Constructor in FieldReferenceAstVisitor
fieldReferenced(String) - Method in ConstructorsSkippingFieldReferenceAstVisitor
fieldReferenced(String) - Method in FieldReferenceAstVisitor
FieldTypeRequiredAstVisitor - Class in org.codenarc.rule.convention
FieldTypeRequiredRule - Class in org.codenarc.rule.convention
Checks that field types are explicitly specified (and not using def)
FileCreateTempFileAstVisitor - Class in org.codenarc.rule.security
FileCreateTempFileRule - Class in org.codenarc.rule.security
The File.createTempFile() method is insecure, and has been deprecated by the ESAPI secure coding library.
FileEndsWithoutNewlineRule - Class in org.codenarc.rule.formatting
Makes sure the source code file ends with a newline character.
FileResults - Class in org.codenarc.results
Represents the results of applying a set of rules against a single sourcefile
FileResults(String, List, SourceCode) - 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.
FileViolations - Class in org.codenarc.plugin
Represents the violations and associated results metadata for a single file
FileViolations(FileResults) - Constructor in FileViolations
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
filterSuppressedViolations(Iterable<Violation>) - Method in SuppressionAnalyzer
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.
findClassDeclarationLineNumber(ClassNode, SourceCode) - Method in AstUtil
findFirstNonAnnotationLine(ASTNode, SourceCode) - Method in AstUtil
gets the first non annotation line number of a node, taking into account annotations.
findLineNumberOfFirstClassDeclaration(SourceCode) - Method in AbstractImportRule
Optimization: Stop checking lines for imports once a class/interface has been declared
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
firstNonWhitespaceColumn(String) - Method in IndentationAstVisitor
ForLoopShouldBeWhileLoopAstVisitor - Class in org.codenarc.rule.basic
ForLoopShouldBeWhileLoopRule - Class in org.codenarc.rule.basic
For loops where init and update statements are empty can be simplified to while loops.
formatSourceLine(String, int) - Method in AbstractHtmlReportWriter
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.
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.
GenerateRuleIndexPages - Class in org.codenarc.tool
Java application (main() method) that generates the "codenarc-rule-index.md.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.
getAllImports(SourceCode) - Method in ImportUtil
getAnnotation(AnnotatedNode, String) - Method in AstUtil
Return the AnnotationNode for the named annotation, or else null.
getApplyToClassNames() - Method in AbstractAstVisitorRule
getApplyToFileNames() - Method in AbstractRule
getApplyToFilesMatching() - Method in AbstractRule
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
getAstCompilerPhase() - Method in AbstractSourceCode
@return compiler phase (as in org.codehaus.groovy.control.Phases) up to which the AST will be processed
getAstCompilerPhase() - Method in CustomCompilerPhaseSourceDecorator
getAstCompilerPhase() - Method in SourceCode
@return compiler phase (as in org.codehaus.groovy.control.Phases) up to which the AST will be processed
getAstVisitor() - Method in AbstractAstVisitorRule
getAstVisitor(SourceCode) - Method in AbstractSharedAstVisitorRule
Subclasses can override to provide an AstVisitor with SourceCode or AST-specific initialization.
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 CrapMetricRule
getAstVisitor() - Method in DuplicateNumberLiteralRule
getAstVisitor() - Method in DuplicateStringLiteralRule
getAstVisitor() - Method in ExplicitArrayListInstantiationRule
getAstVisitor() - Method in ExplicitHashMapInstantiationRule
getAstVisitor() - Method in ExplicitHashSetInstantiationRule
getAstVisitor() - Method in ExplicitLinkedHashMapInstantiationRule
getAstVisitor() - Method in ExplicitLinkedListInstantiationRule
getAstVisitor() - Method in ExplicitStackInstantiationRule
getAstVisitor() - Method in ExplicitTreeSetInstantiationRule
getAstVisitor() - Method in GrailsDomainReservedSqlKeywordNameRule
getAstVisitor() - Method in HashtableIsObsoleteRule
getAstVisitor() - Method in IllegalClassReferenceRule
getAstVisitor() - Method in JdbcConnectionReferenceRule
getAstVisitor() - Method in JdbcResultSetReferenceRule
getAstVisitor() - Method in JdbcStatementReferenceRule
getAstVisitor() - Method in JUnitTestMethodWithoutAssertRule
getAstVisitor() - Method in ThrowErrorRule
getAstVisitor() - Method in ThrowExceptionRule
getAstVisitor() - Method in ThrowNullPointerExceptionRule
getAstVisitor() - Method in ThrowRuntimeExceptionRule
getAstVisitor() - Method in ThrowThrowableRule
getAstVisitor(SourceCode) - Method in UnusedPrivateFieldRule
getAstVisitor(SourceCode) - Method in UnusedPrivateMethodRule
getAstVisitor() - Method in VectorIsObsoleteRule
getAstVisitorClass() - Method in AbstractAstVisitorRule
Each concrete subclass must either set this property or define its own property with the same name
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
getColumn() - Method in Value
getCompilerPhase() - Method in AbstractEnhanceableAstVisitorRule
getCompilerPhase() - Method in AbstractRule
getCompilerPhase() - Method in Rule
getCssFile() - Method in AbstractHtmlReportWriter
getCurrentClassName() - Method in AbstractAstVisitor
getCurrentClassName() - Method in AbstractMethodVisitor
getCurrentClassNode() - Method in AbstractAstVisitor
getCurrentClassNode() - Method in AbstractMethodVisitor
getDeclaration(ASTNode, SourceCode) - Method in AstUtil
getDescription() - Method in AbstractRule
getDescriptionForRule(Rule) - Method in AbstractReportWriter
getDoNotApplyToClassNames() - Method in AbstractAstVisitorRule
getDoNotApplyToFileNames() - Method in AbstractRule
getDoNotApplyToFilesMatching() - Method in AbstractRule
getEmptyBlock(Statement) - Method in AstUtil
getFieldType(FieldNode) - Method in AstUtil
Supports discovering many common JDK types, but not all.
getFormattedTimestamp() - Method in AbstractReportWriter
getGormStaticMethodsNames() - Method in GrailsDomainGormMethodsRule
getHtmlDescriptionForRule(Rule) - Method in AbstractReportWriter
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(Object) - Method in AstUtil
getLastLineOfNodeText(ASTNode, SourceCode) - Method in AstUtil
getLineNumber(MetricResult) - 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)
getMaxClassAverageMethodMetricValue() - Method in AbcMetricAstVisitor
getMaxClassAverageMethodMetricValue() - Method in AbstractMethodMetricAstVisitor
getMaxClassAverageMethodMetricValue() - Method in CrapMetricAstVisitor
getMaxClassAverageMethodMetricValue() - Method in CyclomaticComplexityAstVisitor
getMaxClassMetricValue() - Method in AbcMetricAstVisitor
getMaxClassMetricValue() - Method in AbstractMethodMetricAstVisitor
getMaxClassMetricValue() - Method in CrapMetricAstVisitor
getMaxClassMetricValue() - Method in CyclomaticComplexityAstVisitor
getMaxMethodMetricValue() - Method in AbcMetricAstVisitor
getMaxMethodMetricValue() - Method in AbstractMethodMetricAstVisitor
getMaxMethodMetricValue() - Method in CrapMetricAstVisitor
getMaxMethodMetricValue() - Method in CyclomaticComplexityAstVisitor
getMethodArguments(ASTNode) - Method in AstUtil
Return the List of Arguments for the specified MethodCallExpression or a ConstructorCallExpression.
getMethodCallExpressions() - Method in AbstractSourceCode
getMethodCallExpressions() - Method in SourceCode
This method gives you all of the MethodCallExpressions defined in the AST without forcing you to walk the
entire tree on every request.
getMetricShortDescription() - Method in AbstractMethodMetricAstVisitor
getMovedOrRenamedMessageForRuleName(String) - Method in MovedRules
getName() - Method in AbstractRule
@return the unique name for this rule
getName() - Method in AbstractTestCase
getName() - Method in CustomCompilerPhaseSourceDecorator
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
getNodeText(ASTNode, SourceCode) - Method in AstUtil
getNonStaticImportsSortedByLineNumber(SourceCode) - Method in ImportUtil
getNullComparisonTarget(Object) - Method in AstUtil
getNumberOfFilesWithViolations(int, boolean) - Method in DirectoryResults
Return the number of files with violations
getNumberOfFilesWithViolations(int, boolean) - Method in FileResults
Return 1 if these results include at least one violation
getNumberOfFilesWithViolations(int, boolean) - Method in Results
Return the number of files with violations
getNumberOfFilesWithViolations(int, 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 - ignored
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 CustomCompilerPhaseSourceDecorator
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
getPlugins() - Method in CodeNarcRunner
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
getRawLine(SourceCode, int) - Method in AstUtil
getRawViolations() - Method in FileResults
Not intended for general use
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
getRule() - Method in AbstractAstVisitor
getRule() - Method in AbstractFieldVisitor
Gets the rule for this visitor.
getRule() - Method in AbstractMethodCallExpressionVisitor
Gets the rule for this visitor.
getRule() - Method in AbstractMethodVisitor
Gets the rule for this visitor.
getRuleClass(String) - Method in PropertiesFileRuleRegistry
Return the Rule Class for the specified name or else null
getRuleClass(String) - Method in RuleRegistry
getRuleExtraInformation() - Method in GenerateUtil
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 exclude(s) specified.
getRules() - Method in GroovyDslRuleSet
@return a List of Rule objects
getRules() - Method in JsonFileRuleSet
@return a List of Rule objects
getRules() - Method in JsonReaderRuleSet
@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
getSourceBetweenNodes(ASTNode, ASTNode, SourceCode) - Method in AstUtil
getSourceCode() - Method in AbstractAstVisitor
getSourceCode() - Method in AbstractFieldVisitor
getSourceCode() - Method in AbstractMethodCallExpressionVisitor
getSourceCode() - Method in AbstractMethodVisitor
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(Integer) - Method in AbstractMethodMetricAstVisitor
getSourceUnit() - Method in AbstractAstVisitor
getSourceUnit() - Method in AbstractFieldVisitor
getSourceUnit() - Method in AbstractMethodCallExpressionVisitor
getSourceUnit() - Method in AbstractMethodVisitor
getSourceUnit() - Method in ReferenceCollector
getSuppressionAnalyzer() - Method in CustomCompilerPhaseSourceDecorator
getSuppressionAnalyzer() - Method in SourceCode
Returns information about this classes' suppressed warnings.
getTag() - Method in AbstractJavadocEmptyTagRule
getTag() - Method in AbstractJavadocMissingDescriptionRule
getTag() - Method in JavadocEmptyAuthorTagRule
getTag() - Method in JavadocEmptyExceptionTagRule
getTag() - Method in JavadocEmptyParamTagRule
getTag() - Method in JavadocEmptyReturnTagRule
getTag() - Method in JavadocEmptySeeTagRule
getTag() - Method in JavadocEmptySinceTagRule
getTag() - Method in JavadocEmptyThrowsTagRule
getTag() - Method in JavadocEmptyVersionTagRule
getTag() - Method in JavadocMissingExceptionDescriptionRule
getTag() - Method in JavadocMissingParamDescriptionRule
getTag() - Method in JavadocMissingThrowsDescriptionRule
GetterMethodCouldBePropertyAstVisitor - Class in org.codenarc.rule.groovyism
GetterMethodCouldBePropertyRule - Class in org.codenarc.rule.groovyism
If a class defines a public method that follows the Java getter notation and returns a constant,
then it is cleaner to provide a Groovy property for the value rather than a Groovy method.
getText() - Method in CustomCompilerPhaseSourceDecorator
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
getUnreferencedFields() - Method in FieldReferenceAstVisitor
getValue() - Method in Value
getValues() - Method in ValueRecorder
getVariableExpressions(DeclarationExpression) - Method in AstUtil
Return the List of VariableExpression objects referenced by the specified DeclarationExpression.
getViolationLocationString(Violation, String) - Method in IdeTextReportWriter
getViolationLocationString(Violation, String) - Method in TextReportWriter
getViolationMessage(ConstructorCallExpression) - Method in AbstractConstructorCallAstVisitor
getViolationMessage() - Method in AbstractRule
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 ExplicitCallToPutAtMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToRightShiftMethodAstVisitor
getViolationMessage(MethodCallExpression) - Method in ExplicitCallToXorMethodAstVisitor
getViolationMessage(ConstructorCallExpression) - Method in UnnecessaryBooleanInstantiationAstVisitor
getViolationMessage(ConstructorCallExpression) - Method in UnnecessaryStringInstantiationAstVisitor
getViolations() - Method in AbstractAstVisitor
getViolations() - Method in AbstractFieldVisitor
Retrieve the List of Violations resulting from applying this visitor
getViolations() - Method in AbstractMethodCallExpressionVisitor
Retrieve the List of Violations resulting from applying this visitor
getViolations() - Method in AbstractMethodVisitor
Retrieve the List of Violations resulting from applying this visitor
getViolations(AstVisitor, SourceCode) - Method in AbstractSharedAstVisitorRule
getViolations() - Method in AstVisitor
Retrieve the List of Violations resulting from applying this visitor
getViolations() - Method in DirectoryResults
@return the List of all violations; may be empty
getViolations() - Method in FileResults
@return the List of all violations
getViolations() - Method in ImplicitClosureParameterAstVisitor
getViolations(AstVisitor, SourceCode) - Method in PrivateFieldCouldBeFinalRule
getViolations() - Method in Results
@return the List of all violations; may be empty
getViolations(AstVisitor, SourceCode) - Method in UnusedPrivateFieldRule
getViolations(AstVisitor, SourceCode) - Method in UnusedPrivateMethodRule
getViolations() - Method in VirtualResults
getVisited() - Method in AbstractAstVisitor
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
GrailsDomainCantReferenceServiceAstVisitor - Class in org.codenarc.rule.grails
GrailsDomainGormMethodsAstVisitor - Class in org.codenarc.rule.grails
GrailsDomainGormMethodsRule - Class in org.codenarc.rule.grails
Database operation should be performed by Data Services instead of calling GORM static and instance methods.
GrailsDomainHasEqualsAstVisitor - Class in org.codenarc.rule.grails
GrailsDomainHasEqualsRule - Class in org.codenarc.rule.grails
Checks that Grails domain classes redefine equals().
GrailsDomainHasToStringAstVisitor - Class in org.codenarc.rule.grails
GrailsDomainHasToStringRule - Class in org.codenarc.rule.grails
Checks that Grails domain classes redefine toString()
GrailsDomainReservedSqlKeywordNameAstVisitor - Class in org.codenarc.rule.grails
GrailsDomainReservedSqlKeywordNameAstVisitor(Set<String>, Set<String>) - Constructor in GrailsDomainReservedSqlKeywordNameAstVisitor
GrailsDomainReservedSqlKeywordNameRule - Class in org.codenarc.rule.grails
Forbids usage of SQL reserved keywords as class or field names in Grails domain classes.
GrailsDomainStringPropertyMaxSizeAstVisitor - Class in org.codenarc.rule.grails
GrailsDomainStringPropertyMaxSizeRule - Class in org.codenarc.rule.grails
String properties in Grails domain classes have to define maximum size otherwise the property is mapped to VARCHAR(255) causing runtime exceptions to occur
GrailsDomainWithServiceReferenceRule - Class in org.codenarc.rule.grails
Checks that Grails Domain classes do not have Service classes injected.
GrailsDuplicateConstraintAstVisitor - Class in org.codenarc.rule.grails
GrailsDuplicateConstraintRule - Class in org.codenarc.rule.grails
Check for duplicate constraints entry
GrailsDuplicateMappingAstVisitor - Class in org.codenarc.rule.grails
GrailsDuplicateMappingRule - Class in org.codenarc.rule.grails
Check for duplicate entry in a domain class mapping
GrailsMassAssignmentAstVisitor - Class in org.codenarc.rule.grails
GrailsMassAssignmentRule - Class in org.codenarc.rule.grails
Untrusted input should not be allowed to set arbitrary object fields without restriction.
GrailsPublicControllerMethodAstVisitor - Class in org.codenarc.rule.grails
GrailsPublicControllerMethodRule - Class in org.codenarc.rule.grails
Rule that checks for public methods on Grails controller classes.
GrailsPublicControllerMethodRule() - Constructor in GrailsPublicControllerMethodRule
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.
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.groovyism
GroovyLangImmutableRule - Class in org.codenarc.rule.groovyism
The groovy.lang.Immutable annotation has been deprecated and replaced by groovy.transform.Immutable.
GroovyVersion - Class in org.codenarc.util
Utility class to provide Groovy system information
group(String) - Method in CommentsUtil
GStringAsMapKeyAstVisitor - Class in org.codenarc.rule.groovyism
GStringAsMapKeyRule - Class in org.codenarc.rule.groovyism
A rule that disallows GStrings as map keys as they might change
their hashcode over time.
GStringExpressionWithinStringAstVisitor - Class in org.codenarc.rule.groovyism
GStringExpressionWithinStringRule - Class in org.codenarc.rule.groovyism
Check for regular (single quote) strings containing a GString-type expression (${..}).
IdeTextReportWriter - Class in org.codenarc.report
ReportWriter that generates an simple ASCII text report, and includes IDE-compatible
(Eclipse, Idea) hyperlinks to source code for violations.
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.
IfStatementCouldBeTernaryAstVisitor - Class in org.codenarc.rule.convention
IfStatementCouldBeTernaryRule - Class in org.codenarc.rule.convention
Checks for:
IllegalClassMemberAstVisitor - Class in org.codenarc.rule.generic
IllegalClassMemberRule - Class in org.codenarc.rule.generic
Checks for classes containing fields/properties/methods matching configured illegal member modifiers.
IllegalClassReferenceRule - Class in org.codenarc.rule.generic
Checks for reference to any of the named classes.
illegalFieldModifiersList - Field in IllegalClassMemberRule
illegalFieldModifiersString - Field in IllegalClassMemberRule
illegalMethodModifiersList - Field in IllegalClassMemberRule
illegalMethodModifiersString - Field in IllegalClassMemberRule
IllegalPackageReferenceAstVisitor - Class in org.codenarc.rule.generic
IllegalPackageReferenceRule - Class in org.codenarc.rule.generic
Checks for reference to any of the named packages.
illegalPropertyModifiersList - Field in IllegalClassMemberRule
illegalPropertyModifiersString - Field in IllegalClassMemberRule
IllegalRegexRule - Class in org.codenarc.rule.generic
Checks for a specified illegal regular expression within the source code.
IllegalStringRule - Class in org.codenarc.rule.generic
Checks for a specified illegal string within the source code.
IllegalSubclassAstVisitor - Class in org.codenarc.rule.generic
IllegalSubclassRule - Class in org.codenarc.rule.generic
Checks for classes that extend one of the specified set of illegal superclasses.
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
ImplicitClosureParameterAstVisitor - Class in org.codenarc.rule.convention
ImplicitClosureParameterCodeVisitor - Class in org.codenarc.rule.convention
ImplicitClosureParameterRule - Class in org.codenarc.rule.convention
Checks that the implicit it closure parameter is not used and that parameters are declared explicitly instead
ImplicitReturnStatementAstVisitor - Class in org.codenarc.rule.convention
ImplicitReturnStatementRule - Class in org.codenarc.rule.convention
Checks for methods that are missing an explicit return statement.
ImportFromSamePackageRule - Class in org.codenarc.rule.imports
Checks for an import of a class that is within the same package as the importing class.
ImportFromSunPackagesRule - Class in org.codenarc.rule.imports
Avoid importing anything from the 'sun.*' packages.
ImportUtil - Class in org.codenarc.util
Contains static utility methods and constants related to Import statements.
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.
IndentationAstVisitor - Class in org.codenarc.rule.formatting
IndentationRule - Class in org.codenarc.rule.formatting
Check indentation for class and method declarations
indexOfClosingBrace(String, int) - Method in AbstractSpaceAroundBraceAstVisitor
initialize() - Method in AbstractCodeNarcPlugin
initialize() - Method in BaselineResultsPlugin
initialize() - Method in CodeNarcPlugin
Perform plugin initialization
initializeDefaultResourceBundle() - Method in AbstractReportWriter
initializeResourceBundle - Field in AbstractReportWriter
initializeRuleRegistry() - Method in RuleRegistryInitializer
initializeWildcardPatterns() - Method in FilesystemSourceAnalyzer
inlineViolation(String) - Method in AbstractRuleTestCase
Prepares an inline violation with a given message, escaping all '#' characters and preventing accidental
escaping of next inline violation's start when the message ends with a '\' character.
inlineViolation(String) - Method in InlineViolationsParser
InlineViolationsParser - Class in org.codenarc.rule
Parser for inline violation metadata within Rule test classes
InlineViolationsParser.ParseResult - Class in org.codenarc.rule
InlineXmlReportWriter - Class in org.codenarc.report
ReportWriter that generates an XML report with inline rule descriptions.
inMultilineComment - Field in MultilineCommentChecker
InsecureRandomAstVisitor - Class in org.codenarc.rule.security
InsecureRandomRule - Class in org.codenarc.rule.security
Reports usages of java.util.Random, which can produce very predictable results.
InstanceofAstVisitor - Class in org.codenarc.rule.design
InstanceofRule - Class in org.codenarc.rule.design
Checks for use of the instanceof operator.
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.
InterfaceNameSameAsSuperInterfaceAstVisitor - Class in org.codenarc.rule.naming
InterfaceNameSameAsSuperInterfaceRule - Class in org.codenarc.rule.naming
Checks for any interface that has an identical name to its super-interface, other than the package.
InvertedConditionAstVisitor - Class in org.codenarc.rule.convention
InvertedConditionRule - Class in org.codenarc.rule.convention
An inverted condition is one where a constant expression is used on the left hand side of the equals comparision.
InvertedIfElseAstVisitor - Class in org.codenarc.rule.convention
InvertedIfElseRule - Class in org.codenarc.rule.convention
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.
isAscii(char) - Method in SourceCodeUtil
isAssertCallWithConstantValue(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.
isAssertCallWithLiteralValue(MethodCallExpression, String, boolean) - Method in JUnitUtil
Return true if the MethodCallExpression represents a JUnit assert method call with the specified
method name and constant argument value.
isAssertCallWithNonNullConstantValue(MethodCallExpression, String) - Method in JUnitUtil
isBinaryExpressionType(Expression, List<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, Object) - Method in AstUtil
Tells you if an expression is the expected constant.
isConstantOrConstantLiteral(Expression) - Method in AstUtil
Returns true if an expression is a constant or else a literal that contains only constant values.
isConstantOrLiteral(Expression) - Method in AstUtil
Tells you if an expression is a constant or literal.
isConstructorCall(Expression, String) - Method in AstUtil
Return true if the expression is a constructor call on a class that matches the supplied.
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
isDefinedInJpaEntity(FieldNode) - Method in PrivateFieldCouldBeFinalRule
isDirectoryContainingFiles(Results) - Method in AbstractHtmlReportWriter
Return true if the Results represents a directory that contains at least one file
isDirectoryContainingFilesWithViolations(Results) - Method in AbstractHtmlReportWriter
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
isEnabled() - Method in AbstractRule
isEnhancedMode() - Method in AbstractEnhanceableAstVisitorRule
isFalse(Expression) - Method in AstUtil
Tells you if the expression is the false expression, either literal or constant.
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(Object) - 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.
isGroovyVersion2() - Method in GroovyVersion
isIgnoredMethodName(String) - Method in AbstractMethodMetricAstVisitor
isInstanceOfCheck(Object) - Method in AstUtil
isJoinableType(Expression) - Method in ConsecutiveUtils
isLastStatementInBlock(Statement) - Method in AbstractLastStatementInBlockAstVisitor
isListLiteralWithOnlyConstantValues(Expression) - Method in AstUtil
Returns true if a List literal that contains only entries that are constants.
isMapLiteralWithOnlyConstantValues(Expression) - Method in AstUtil
Returns true if a Map literal that contains only entries where both key and value are constants.
isMatchingLoggerDefinition(Expression) - Method in LogUtil
isMethodCall(Expression, String, Range) - 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 particular object (which is represented as a String).
isMethodNamed(MethodCallExpression, String) - Method in AstUtil
isMethodNode(ASTNode, String) - Method in AstUtil
isNotCharacter(String, char, int) - Method in AbstractSpaceAroundBraceAstVisitor
isNotGroovyVersion2() - Method in GroovyVersion
isNotInsideGString() - Method in AbstractSpaceAroundBraceAstVisitor
isNotNullCheck(Object) - Method in AstUtil
isNotWhitespace(String, int) - Method in AbstractSpaceAroundBraceAstVisitor
Return true if the specified (1-based) index is valid and the character at that index is not a whitespace character
isNull(ASTNode) - Method in AstUtil
Tells you if the expression is the null literal.
isNullCheck(Object) - Method in AstUtil
isOneLiner(Object) - Method in AstUtil
isPropertyNamed(Expression, Object) - Method in AstUtil
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 CrapMetricRule
isReady() - Method in IllegalClassMemberRule
isReady() - Method in IllegalClassReferenceRule
isReady() - Method in IllegalPackageReferenceRule
isReady() - Method in IllegalRegexRule
isReady() - Method in IllegalStringRule
isReady() - Method in IllegalSubclassRule
isReady() - Method in InterfaceNameRule
isReady() - Method in PackageNameMatchesFilePathRule
isReady() - Method in RequiredRegexRule
isReady() - Method in RequiredStringRule
isReady() - Method in StatelessClassRule
isRoot(Results) - Method in JsonReportWriter
isRoot(Results) - Method in XmlReportWriter
isRuleSuppressed(Rule) - Method in SuppressionAnalyzer
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
isSuperReference(Expression) - Method in AstUtil
isTearDownMethod(MethodNode) - Method in JUnitUtil
isTestMethod(ASTNode) - Method in JUnitUtil
Tells you if an ASTNode is a test MethodNode.
isThisReference(Expression) - Method in AstUtil
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
isValidColumn(int) - Method in IndentationAstVisitor
isVariable(ASTNode, String) - Method in AstUtil
Tells you if the given ASTNode is a VariableExpression with the given name.
isViolationSuppressed(Violation) - Method in SuppressionAnalyzer
isWriteAsSingleLine() - Method in JsonReportWriter
isWriteToStandardOut() - Method in AbstractReportWriter
JAVADOC_ANY_LINES - Field in CommentsUtil
JAVADOC_EMPTY_LINE - Field in CommentsUtil
JAVADOC_END - Field in CommentsUtil
JAVADOC_LINE_PREFIX - Field in CommentsUtil
JAVADOC_LINE_WITH_TEXT - Field in CommentsUtil
JAVADOC_START - Field in CommentsUtil
JavadocConsecutiveEmptyLinesRule - Class in org.codenarc.rule.comments
Checks for javadoc comments with more than one consecutive empty line
JavadocEmptyAuthorTagRule - Class in org.codenarc.rule.comments
Checks for empty @author tags in javadoc.
JavadocEmptyExceptionTagRule - Class in org.codenarc.rule.comments
Checks for empty @exception tag within javadoc.
JavadocEmptyFirstLineRule - Class in org.codenarc.rule.comments
Check for javadoc comments with an empty top line
JavadocEmptyLastLineRule - Class in org.codenarc.rule.comments
Check for javadoc comments with an empty line at the bottom
JavadocEmptyParamTagRule - Class in org.codenarc.rule.comments
Checks for empty @param tags within javadoc
JavadocEmptyReturnTagRule - Class in org.codenarc.rule.comments
Checks for empty @return tags within javadoc.
JavadocEmptySeeTagRule - Class in org.codenarc.rule.comments
Checks for empty @see tags within javadoc.
JavadocEmptySinceTagRule - Class in org.codenarc.rule.comments
Checks for empty @since tags within javadoc.
JavadocEmptyThrowsTagRule - Class in org.codenarc.rule.comments
Checks for empty @throws tag within javadoc
JavadocEmptyVersionTagRule - Class in org.codenarc.rule.comments
Checks for empty @version tags within javadoc.
JavadocMissingExceptionDescriptionRule - Class in org.codenarc.rule.comments
Checks for missing description within @exception javadoc tag
JavadocMissingParamDescriptionRule - Class in org.codenarc.rule.comments
Checks for missing description within @param javadoc tags
JavadocMissingThrowsDescriptionRule - Class in org.codenarc.rule.comments
Checks for missing description within @throws javadoc tag
JavaIoPackageAccessAstVisitor - Class in org.codenarc.rule.security
JavaIoPackageAccessRule - Class in org.codenarc.rule.security
This rule reports violations of the Enterprise JavaBeans specification by using the java.io package to access files or the file system.
JdbcConnectionReferenceRule - Class in org.codenarc.rule.jdbc
Check for direct use of java.sql.Connection.
JdbcResultSetReferenceRule - Class in org.codenarc.rule.jdbc
Check for direct use of java.sql.ResultSet, which is not necessary if using the Groovy Sql facility or an
ORM framework such as Hibernate.
JdbcStatementReferenceRule - Class in org.codenarc.rule.jdbc
Check for direct use of java.sql.Statement, PreparedStatement, or CallableStatement, which is not necessary if
using the Groovy Sql facility or an ORM framework such as Hibernate.
JsonFileRuleSet - Class in org.codenarc.ruleset
A RuleSet
implementation that parses Rule definitions from JSON read from a
file.
JsonFileRuleSet(String) - Constructor in JsonFileRuleSet
Construct a new instance on the specified RuleSet file path
JsonReaderRuleSet - Class in org.codenarc.ruleset
A RuleSet
implementation that parses Rule definitions from Json read from a
Reader
.
JsonReaderRuleSet(Reader) - Constructor in JsonReaderRuleSet
Construct a new instance on the specified Reader
JsonReportWriter - Class in org.codenarc.report
ReportWriter that generates an JSON report.
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.
JUnitAssertEqualsConstantActualValueAstVisitor - Class in org.codenarc.rule.junit
JUnitAssertEqualsConstantActualValueRule - Class in org.codenarc.rule.junit
Reports usages of org.junit.Assert.assertEquals([message,] expected, actual) where the 'actual' parameter
is a constant or a literal.
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
JUnitLostTestAstVisitor - Class in org.codenarc.rule.junit
JUnitLostTestRule - Class in org.codenarc.rule.junit
Rule that checks if a JUnit 4 test class contains public, instance, void, no-arg methods
named test*() that are NOT abstract and NOT annotated with
Test.:
JUnitPublicFieldAstVisitor - Class in org.codenarc.rule.junit
JUnitPublicFieldRule - Class in org.codenarc.rule.junit
Checks for public field on a JUnit test class.
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 withBefore: and @After
Methods annotated withBeforeClass: and @AfterClass
Public, non-test methods on a test class violate conventional usage of test classes,
and can be confusing.
JUnitPublicPropertyAstVisitor - Class in org.codenarc.rule.junit
JUnitPublicPropertyRule - Class in org.codenarc.rule.junit
Checks for public properties defined on JUnit test classes.
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()
.
JUnitUnnecessaryThrowsExceptionAstVisitor - Class in org.codenarc.rule.junit
JUnitUnnecessaryThrowsExceptionRule - Class in org.codenarc.rule.junit
Check for throws clauses on JUnit test methods.
JUnitUtil - Class in org.codenarc.rule.junit
Utility methods for JUnit rule classes.
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 GenerateRuleIndexPages
Write out rule index by rule category to the 'codenarc-rule-index.apt' APT file,
and the rule index by name to the 'codenarc-rule-index-by-name.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
manuallyApplyRule(String) - Method in AbstractRuleTestCase
Apply the current Rule to the specified source (String) and return the resulting List of Violations.
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.
matchesAnyModifiers(Integer, List<Integer>) - Method in ModifiersUtil
matchesModifiers(Integer, Integer) - Method in ModifiersUtil
Return true only if the actualModifiers int value contains all of the bits (enabled) from the expectedModifiers
MathRandomTracker - Class in org.codenarc.rule.basic
MAX_SOURCE_LINE_LENGTH - Field in AbstractHtmlReportWriter
maxPriority1Violations - Field in CodeNarc
maxPriority2Violations - Field in CodeNarc
maxPriority3Violations - Field in CodeNarc
measureRuleProcessingTime(Rule, Closure) - Method in AbstractSourceAnalyzer
MESSAGE - Field in CollectAllIsDeprecatedRule
MESSAGE_DEF_FIELD - Field in NoDefRule
MESSAGE_DEF_PARAMETER - Field in NoDefRule
MESSAGE_DEF_RETURN - Field in NoDefRule
MESSAGE - Field in NoDefRule
MESSAGE - Field in UnnecessarySemicolonRule
MESSAGE - Field in UseCollectManyRule
MESSAGE - Field in UseCollectNestedRule
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.
MethodParameterTypeRequired - Class in org.codenarc.rule.convention
Checks that method parameters are not dynamically typed, that is they are explicitly stated and different than def.
MethodParameterTypeRequiredAstVisitor - Class in org.codenarc.rule.convention
MethodReturnTypeRequiredAstVisitor - Class in org.codenarc.rule.convention
MethodReturnTypeRequiredRule - Class in org.codenarc.rule.convention
Checks that method return types are not dynamic, that they are explicitly stated and different than def.
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
MisorderedStaticImportsRule - Class in org.codenarc.rule.imports
Static imports should be before nonstatic imports
MissingBlankLineAfterImportsRule - Class in org.codenarc.rule.formatting
Makes sure there is a blank line after the imports of a source code file.
MissingBlankLineAfterPackageRule - Class in org.codenarc.rule.formatting
Makes sure there is a blank line after the package statement of a source code file.
MissingBlankLineBeforeAnnotatedFieldRule - Class in org.codenarc.rule.formatting
Checks that there is a blank line before a field declaration that uses annotations.
MissingBlankLineBeforeAnnotatedFieldRuleAstVisitor - Class in org.codenarc.rule.formatting
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.
MissingOverrideAnnotationAstVisitor - Class in org.codenarc.rule.enhanced
MissingOverrideAnnotationRule - Class in org.codenarc.rule.enhanced
Checks for methods that override a method in a super class or implement a method in an interface but are not annotated with @Override.
ModifiersUtil - Class in org.codenarc.util
Provide static utility methods for parsing AST member modifiers, e.g. public/protected/private, static, final, etc.
MovedRules - Class in org.codenarc.ruleset
Helper class to manage information for moved or renamed rules, and provide helpful error message.
MultilineCommentChecker - Class in org.codenarc.util
A class that is used to hold the state of a the presence of multiline comments.
MultilineCommentChecker() - Constructor in MultilineCommentChecker
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.
MultipleUnaryOperatorsAstVisitor - Class in org.codenarc.rule.basic
MultipleUnaryOperatorsRule - Class in org.codenarc.rule.basic
Checks for multiple consecutive unary operators.
PackageNameAstVisitor - Class in org.codenarc.rule.naming
packageNameForImport(ImportNode) - Method in ImportUtil
Return the package name for the specified import statement or else an empty String
PackageNameMatchesFilePathRule - Class in org.codenarc.rule.naming
A package source file's path should match the package declaration.
PackageNameRule - Class in org.codenarc.rule.naming
Rule that verifies that the package name of a class matches a regular expression.
ParameterAssignmentInFilterClosureAstVisitor - Class in org.codenarc.rule.basic
ParameterAssignmentInFilterClosureRule - Class in org.codenarc.rule.basic
An assignment operator was used on a parameter in a filtering closure.
ParameterCountAstVisitor - Class in org.codenarc.rule.size
ParameterCountRule - Class in org.codenarc.rule.size
Checks if the number of parameters in method/constructor exceeds the number of parameters
specified by the maxParameters property.
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.
ParameterReassignmentAstVisitor - Class in org.codenarc.rule.convention
ParameterReassignmentRule - Class in org.codenarc.rule.convention
Checks for a method or closure parameter being reassigned to a new value within the body of the
method/closure, which is a confusing, questionable practice.
parse(String) - Method in InlineViolationsParser
parseArgs(String) - Method in CodeNarc
parseBaselineXmlReport(String) - Method in BaselineXmlReportParser
parseModifiers(String) - Method in ModifiersUtil
Parse a group of whitespace-delimited modifier names
parseModifiersList(String) - Method in ModifiersUtil
Parse comma-separated list of modifier groups
parseRuleNames(String, String) - Method in LookupTable
PathUtil - Class in org.codenarc.util
Path-related utility methods.
plugins - Field in CodeNarc
plugins - Field in CodeNarcRunner
PLUGINS_PROPERTY - Field in CodeNarcRunner
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()
.
printRuleProcessingTimes() - Method in AbstractSourceAnalyzer
PrintStackTraceAstVisitor - Class in org.codenarc.rule.logging
PrintStackTraceRule - Class in org.codenarc.rule.logging
Rule that checks for calls to printStackTrace()
.
PrivateFieldCouldBeFinalAstVisitor - Class in org.codenarc.rule.design
PrivateFieldCouldBeFinalRule - Class in org.codenarc.rule.design
Rule that checks for private fields that are only set within a constructor or field initializer.
processLine(String) - Method in MultilineCommentChecker
Processes a line of code sets the inMultilineComment state based on the status of the current line.
processReports(List<ReportWriter>) - Method in AbstractCodeNarcPlugin
processReports(List<ReportWriter>) - Method in BaselineResultsPlugin
processReports(List<ReportWriter>) - Method in CodeNarcPlugin
Process the list of ReportWriter.
processRules(List<Rule>) - Method in AbstractCodeNarcPlugin
processRules(List<Rule>) - Method in CodeNarcPlugin
Process the list of Rules.
processViolationsForFile(FileViolations) - Method in AbstractCodeNarcPlugin
processViolationsForFile(FileViolations) - Method in BaselineResultsPlugin
processViolationsForFile(FileViolations) - Method in CodeNarcPlugin
Process the violations for a single file.
processViolationsForFile(FileViolations) - Method in DisableRulesInCommentsPlugin
Remove any violations for rules disabled by comments within the source code.
PROPERTIES_FILE - Field in GenerateCodeNarcRulesProperties
PROPERTIES_FILE - Field in PropertiesFileRuleRegistry
propertiesFile - Field in GenerateCodeNarcRulesProperties
propertiesFilename - Field in CodeNarc
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
PublicFinalizeMethodAstVisitor - Class in org.codenarc.rule.security
PublicFinalizeMethodRule - Class in org.codenarc.rule.security
Creates a violation when the program violates secure coding principles by declaring a finalize() method public.
PublicInstanceFieldAstVisitor - Class in org.codenarc.rule.design
PublicInstanceFieldRule - Class in org.codenarc.rule.design
Using public fields is considered to be a bad design.
PublicMethodsBeforeNonPublicMethodsAstVisitor - Class in org.codenarc.rule.convention
PublicMethodsBeforeNonPublicMethodsRule - Class in org.codenarc.rule.convention
Enforce that all public methods are above protected and private methods.
RandomDoubleCoercedToZeroAstVisitor - Class in org.codenarc.rule.basic
RandomDoubleCoercedToZeroRule - Class in org.codenarc.rule.basic
The Math.random() method returns a double result greater than or equal to 0.0 and less than 1.0.
RECORD_METHOD_NAME - Field in ValueRecorder
record(Object, int) - Method in ValueRecorder
ReferenceCollector - Class in org.codenarc.rule.unused
Class visitor that collects the names of all method call and variable references
registerPlugin(CodeNarcPlugin) - Method in CodeNarcRunner
registerPluginsForClassNames(String) - Method in CodeNarcRunner
RELUCTANT - Field in CommentsUtil
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.
removeIllegalCharacters(String) - Method in XmlReportUtil
removeInlineViolations(String) - Method in AbstractRuleTestCase
Removes all inline violations from a source.
removePathPrefix(String, String) - Method in PathUtil
removeViolation(Violation) - Method in DirectoryResults
removeViolation(Violation) - Method in FileResults
removeViolation(Violation) - Method in Results
Remove the specified violation
removeViolation(Violation) - Method in VirtualResults
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 element nested within a element
for the CodeNarc Ant Task.
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.design
ReturnsNullInsteadOfEmptyArrayRule - Class in org.codenarc.rule.design
This rule detects when null is returned from a method that might return an
array.
ReturnsNullInsteadOfEmptyCollectionRule - Class in org.codenarc.rule.design
This rule detects when null is returned from a method that might return a
collection.
ReturnsNullInsteadOfEmptyCollectionRuleAstVisitor - Class in org.codenarc.rule.design
Rule - Interface in org.codenarc.rule
Represents a source code analysis rule .
rule - Field in AbstractRuleTestCase
RULE_INDEX_BY_CATEGORY_FILE - Field in GenerateRuleIndexPages
RULE_INDEX_BY_NAME_FILE - Field in GenerateRuleIndexPages
rule(String, Closure) - Method in TopLevelDelegate
ruleIndexByCategoryFile - Field in GenerateRuleIndexPages
ruleIndexByNameFile - Field in GenerateRuleIndexPages
ruleProcessingTimes - Field in AbstractSourceAnalyzer
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 CodeNarc
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.
RuleSetConfigurer - Interface in org.codenarc.ruleset
Represents a configurer for a ruleset
ruleSetConfigurer - Field in CodeNarcRunner
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.
ScopedConfusingMethodNameAstVisitor - Class in org.codenarc.rule.naming
ScopedConfusingMethodNameAstVisitor(AbstractAstVisitor) - Constructor in ScopedConfusingMethodNameAstVisitor
SerializableClassMustDefineSerialVersionUIDAstVisitor - Class in org.codenarc.rule.serialization
SerializableClassMustDefineSerialVersionUIDRule - Class in org.codenarc.rule.serialization
Classes that implement Serializable should define a serialVersionUID.
SerialPersistentFieldsAstVisitor - Class in org.codenarc.rule.serialization
SerialPersistentFieldsRule - Class in org.codenarc.rule.serialization
To use a Serializable object's serialPersistentFields correctly, it must be declared private, static, and final.
SerialVersionUIDAstVisitor - Class in org.codenarc.rule.serialization
SerialVersionUIDRule - Class in org.codenarc.rule.serialization
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.
setAllowedFieldModifiers(String) - Method in IllegalClassMemberRule
setAllowedMethodModifiers(String) - Method in IllegalClassMemberRule
setAllowedPropertyModifiers(String) - Method in IllegalClassMemberRule
setApplyToClassNames(String) - Method in AbstractAstVisitorRule
setApplyToFileNames(String) - Method in AbstractRule
setApplyToFilesMatching(String) - Method in AbstractRule
setClasspathRef(Reference) - Method in CodeNarcTask
Adds a reference to a classpath defined elsewhere to be used when compiling analysed classes.
setDefaultsIfNecessary() - Method in CodeNarc
setDescription(String) - Method in AbstractRule
setDoNotApplyToClassNames(String) - Method in AbstractAstVisitorRule
setDoNotApplyToFileNames(String) - Method in AbstractRule
setDoNotApplyToFilesMatching(String) - Method in AbstractRule
setEnabled(boolean) - Method in AbstractRule
setEnhancedMode(boolean) - Method in AbstractEnhanceableAstVisitorRule
setExcludeRegex(String) - Method in NoDefRule
setGormStaticMethodsNames(String) - Method in GrailsDomainGormMethodsRule
setIgnoreMethodsWithAnnotations(String) - Method in JUnitPublicNonTestMethodRule
setIllegalFieldModifiers(String) - Method in IllegalClassMemberRule
setIllegalMethodModifiers(String) - Method in IllegalClassMemberRule
setIllegalPropertyModifiers(String) - Method in IllegalClassMemberRule
setMaxParameters(int) - Method in ParameterCountRule
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 AbstractAstVisitor
setRule(Rule) - Method in AbstractFieldVisitor
Set the Rule associated with this visitor
setRule(Rule) - Method in AbstractMethodCallExpressionVisitor
Set the Rule associated with this visitor
setRule(Rule) - Method in AbstractMethodVisitor
Set the Rule associated with this visitor
setRule(Rule) - Method in AstVisitor
Set the Rule associated with this visitor
setRule(Rule) - Method in ImplicitClosureParameterAstVisitor
setSourceCode(SourceCode) - Method in AbstractAstVisitor
setSourceCode(SourceCode) - Method in AbstractFieldVisitor
Set the SourceCode associated with this visitor
setSourceCode(SourceCode) - Method in AbstractMethodCallExpressionVisitor
Set the SourceCode associated with this visitor
setSourceCode(SourceCode) - Method in AbstractMethodVisitor
Set the SourceCode associated with this visitor
setSourceCode(SourceCode) - Method in AstVisitor
Set the SourceCode associated with this visitor
setSourceCode(SourceCode) - Method in ImplicitClosureParameterAstVisitor
setSuppressionAnalyzer(SuppressionAnalyzer) - Method in AbstractSourceCode
Setter exists to avoid circular dependency.
setUpAbstractRuleTestCase() - Method in AbstractRuleTestCase
setUpAbstractTestCase() - Method in AbstractTestCase
setViolationMessage(String) - Method in AbstractRule
setVisited(Set<Object>) - Method in AbstractAstVisitor
shouldApplyThisRuleTo(ClassNode) - Method in AbstractAstVisitorRule
Return true if this rule should be applied for the specified ClassNode, based on the
configuration of this rule.
shouldIgnoreField(FieldNode) - Method in GrailsStatelessServiceRule
shouldIgnoreField(FieldNode) - Method in StatelessClassRule
Subclasses can optionally override to provide more specific filtering of fields
shouldSkipViolation(Object) - Method in UnnecessaryBigDecimalInstantiationAstVisitor
shouldSkipViolation(Object) - Method in UnnecessaryInstantiationAstVisitor
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
shouldVisitMethod(MethodNode) - Method in AbstractAstVisitor
shouldVisitMethod(MethodNode) - Method in ReturnNullFromCatchBlockAstVisitor
SimpleDateFormatMissingLocaleAstVisitor - Class in org.codenarc.rule.design
SimpleDateFormatMissingLocaleRule - Class in org.codenarc.rule.design
Be sure to specify a Locale when creating a new instance of SimpleDateFormat; the class is locale-sensitive.
SortableHtmlReportWriter - Class in org.codenarc.report
ReportWriter that generates an HTML report that can be dynamically sorted in multiple ways.
sortRules(List) - Method in GenerateUtil
SOURCE_LINE_LAST_SEGMENT_LENGTH - Field in AbstractHtmlReportWriter
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).
sourceCodeName - Field in AbstractRuleTestCase
sourceCodeNameWithoutExtension(SourceCode) - Method in ClassJavadocRule
sourceCodePath - Field in AbstractRuleTestCase
SourceCodeUtil - Class in org.codenarc.util
Contains source related static utility methods
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 raw source line corresponding to the specified AST node
sourceLineAndNumberForImport(SourceCode, ImportNode) - Method in ImportUtil
Return the source line and line number for the specified import
sourceLineAndNumberForNonStarImport(SourceCode, ImportNode) - Method in ImportUtil
sourceLineAndNumberForStarImport(SourceCode, ImportNode) - Method in ImportUtil
Return the source line and line number for the specified import class name and alias
sourceLineOrEmpty(ASTNode) - Method in AbstractSpaceAroundBraceAstVisitor
sourceLinesBetween(SourceCode, int, int, int, int) - Method in SourceCodeUtil
Retrieves source lines between the start line and column and end line and column.
sourceLinesBetweenNodes(SourceCode, ASTNode, ASTNode) - Method in SourceCodeUtil
sourceLineTrimmed(ASTNode) - Method in AbstractAstVisitor
Return the trimmed source line corresponding to the specified AST node
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
SpaceAfterCatchRule - Class in org.codenarc.rule.formatting
Check that there is exactly one space (blank) after the catch keyword and before the opening parenthesis.
SpaceAfterClosingBraceAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterClosingBraceRule - Class in org.codenarc.rule.formatting
Check that there is at least one space (blank) or whitespace after each closing brace ("}").
SpaceAfterCommaAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterCommaRule - Class in org.codenarc.rule.formatting
Check that there is at least one space (blank) or whitespace following each comma.
SpaceAfterElseAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterForAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterForRule - Class in org.codenarc.rule.formatting
Check that there is exactly one space (blank) after the for keyword and before the opening parenthesis.
SpaceAfterIfAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterIfRule - Class in org.codenarc.rule.formatting
Check that there is exactly one space (blank) after the if keyword and before the opening parenthesis.
SpaceAfterMethodCallNameRule - Class in org.codenarc.rule.formatting
Checks that there is no whitespace at the end of the method name when a method call contains parenthesis or that
there is at most one space after the method name if the call does not contain parenthesis
SpaceAfterMethodCallNameRuleAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterMethodDeclarationNameRule - Class in org.codenarc.rule.formatting
Check whether method declarations do not contain unnecessary whitespace between method name and the opening
parenthesis for parameter list.
SpaceAfterMethodDeclarationNameRuleAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterNotOperatorRule - Class in org.codenarc.rule.formatting
Check that there are no whitespace characters directly after the not (!)
SpaceAfterNotOperatorRuleAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterOpeningBraceAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterOpeningBraceRule - Class in org.codenarc.rule.formatting
Check that there is at least one space (blank) or whitespace after each opening brace ("{").
SpaceAfterSemicolonAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterSemicolonRule - Class in org.codenarc.rule.formatting
Check that there is at least one space (blank) or whitespace following a semicolon that separates:
- multiple statements on a single line
- the clauses within a classic for loop, e.g. for (i=0;i<10;i++)
SpaceAfterSwitchAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterSwitchRule - Class in org.codenarc.rule.formatting
Check that there is exactly one space (blank) after the switch keyword and before the opening parenthesis.
SpaceAfterWhileAstVisitor - Class in org.codenarc.rule.formatting
SpaceAfterWhileRule - Class in org.codenarc.rule.formatting
Check that there is exactly one space (blank) after the while keyword and before the opening parenthesis.
SpaceAroundClosureArrowAstVisitor - Class in org.codenarc.rule.formatting
SpaceAroundClosureArrowRule - Class in org.codenarc.rule.formatting
Checks that there is whitespace around the closure arrow (->) symbol
SpaceAroundMapEntryColonAstVisitor - Class in org.codenarc.rule.formatting
SpaceAroundMapEntryColonRule - Class in org.codenarc.rule.formatting
Check for configured formatting of whitespace around colons for literal Map entries
SpaceAroundOperatorAstVisitor - Class in org.codenarc.rule.formatting
SpaceAroundOperatorRule - Class in org.codenarc.rule.formatting
Check that there is at least one space (blank) or whitespace around each binary operator,
including: +, -, *, /, >>, <<, &&, ||, &, |, ?
SpaceBeforeClosingBraceAstVisitor - Class in org.codenarc.rule.formatting
SpaceBeforeClosingBraceRule - Class in org.codenarc.rule.formatting
Check that there is at least one space (blank) or whitespace before each closing brace ("}").
SpaceBeforeOpeningBraceAstVisitor - Class in org.codenarc.rule.formatting
SpaceBeforeOpeningBraceRule - Class in org.codenarc.rule.formatting
Check that there is at least one space (blank) or whitespace before each opening brace ("{").
SpaceInsideParenthesesAstVisitor - Class in org.codenarc.rule.formatting
SpaceInsideParenthesesRule - Class in org.codenarc.rule.formatting
Check for whitespace after opening parentheses and before closing parentheses
SpockIgnoreRestUsedAstVisitor - Class in org.codenarc.rule.junit
SpockIgnoreRestUsedRule - Class in org.codenarc.rule.junit
If Spock's
IgnoreRest: on any method, all non-annotated test methods are not executed.
STANDARD_PLUGIN_CLASSES - Field in CodeNarcRunner
StatelessClassAstVisitor - Class in org.codenarc.rule.generic
StatelessClassRule - Class in org.codenarc.rule.generic
Rule that checks for non-final
fields on a class.
StatelessSingletonAstVisitor - Class in org.codenarc.rule.design
StatelessSingletonRule - Class in org.codenarc.rule.design
There is no benefit in creating a stateless Singleton.
STATIC_IMPORT_PATTERN - Field in AbstractImportRule
StaticCalendarFieldAstVisitor - Class in org.codenarc.rule.concurrency
StaticCalendarFieldRule - Class in org.codenarc.rule.concurrency
Calendar objects should not be used as static fields.
StaticConnectionAstVisitor - Class in org.codenarc.rule.concurrency
StaticConnectionRule - Class in org.codenarc.rule.concurrency
Creates violations when a java.sql.Connection object is used as a static field.
StaticDateFormatFieldAstVisitor - Class in org.codenarc.rule.concurrency
StaticDateFormatFieldRule - Class in org.codenarc.rule.concurrency
DateFormat objects should not be used as static fields.
StaticFieldsBeforeInstanceFieldsAstVisitor - Class in org.codenarc.rule.convention
StaticFieldsBeforeInstanceFieldsRule - Class in org.codenarc.rule.convention
Enforce that all static fields are above all instance fields within a class
StaticMatcherFieldAstVisitor - Class in org.codenarc.rule.concurrency
StaticMatcherFieldRule - Class in org.codenarc.rule.concurrency
Matcher objects should not be used as static fields.
StaticMethodsBeforeInstanceMethodsAstVisitor - Class in org.codenarc.rule.convention
StaticMethodsBeforeInstanceMethodsRule - Class in org.codenarc.rule.convention
Enforce that all static methods within each visibility level (public, protected, private) are above
all instance methods within that same visibility level.
StaticSimpleDateFormatFieldAstVisitor - Class in org.codenarc.rule.concurrency
StaticSimpleDateFormatFieldRule - Class in org.codenarc.rule.concurrency
SimpleDateFormat objects should not be used as static fields.
StringSourceAnalyzer - Class in org.codenarc.analyzer
Analyzes Strings.
StringSourceAnalyzer(String) - Constructor in StringSourceAnalyzer
StubRule - Class in org.codenarc.rule
Stub implementation of the Rule interface for testing
StubRule(int) - Constructor in StubRule
SuppressionAnalyzer - Class in org.codenarc.analyzer
This class encapsulates all of the logic for determining if an rule is suppressed or not.
SuppressionAnalyzer(SourceCode) - Constructor in SuppressionAnalyzer
SwallowThreadDeathAstVisitor - Class in org.codenarc.rule.exceptions
SwallowThreadDeathRule - Class in org.codenarc.rule.exceptions
Detects code that catches java.lang.ThreadDeath without re-throwing it.
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()
.
systemExit - Field in CodeNarc
SystemExitAstVisitor - Class in org.codenarc.rule.security
SystemExitRule - Class in org.codenarc.rule.security
Web applications should never call System.exit().
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.
unescapeXml(String) - Method in BaselineXmlReportParser
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.
UnnecessaryCastAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryCastRule - Class in org.codenarc.rule.unnecessary
Checks for unnecessary cast operations
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.
UnnecessaryDefInFieldDeclarationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryDefInFieldDeclarationRule - Class in org.codenarc.rule.unnecessary
If a field has a visibility modifier or a type declaration, then the def keyword is unneeded.
UnnecessaryDefInMethodDeclarationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryDefInMethodDeclarationRule - Class in org.codenarc.rule.unnecessary
If a method has a visibility modifier or a type declaration, then the def keyword is unneeded.
UnnecessaryDefInVariableDeclarationAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryDefInVariableDeclarationRule - Class in org.codenarc.rule.unnecessary
If a variable has a visibility modifier or a type declaration, then the def keyword is unneeded.
UnnecessaryDotClassAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryDotClassRule - Class in org.codenarc.rule.unnecessary
To make a reference to a class, it is unnecessary to specify the '.class' identifier.
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.
UnnecessaryElseStatementAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryElseStatementRule - Class in org.codenarc.rule.unnecessary
When an if statement block ends with a return statement the else is unnecessary
UnnecessaryFailAstVisitor - Class in org.codenarc.rule.junit
UnnecessaryFailRule - Class in org.codenarc.rule.junit
In a unit test, catching an exception and immediately calling Assert.fail() is pointless and hides the stack trace.
UnnecessaryFinalOnPrivateMethodAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryFinalOnPrivateMethodRule - Class in org.codenarc.rule.unnecessary
A private method is marked final.
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 non-static imports from any packages that are
automatically imported by Groovy, including:
java.io
java.lang
java.net
java.util
java.math.BigDecimal
java.math.BigInteger
groovy.lang
groovy.util
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.
UnnecessaryInstanceOfCheckAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryInstanceOfCheckRule - Class in org.codenarc.rule.unnecessary
This rule finds instanceof checks that cannot possibly evaluate to true.
UnnecessaryInstantiationAstVisitor - Class in org.codenarc.rule.unnecessary
Base visitor for unnecessary constructor calls.
UnnecessaryInstantiationAstVisitor(Class, List<Class>, 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.
UnnecessaryPackageReferenceAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryPackageReferenceRule - Class in org.codenarc.rule.unnecessary
Checks for explicit package reference for classes that Groovy imports by default, such as java.lang.String,
java.util.Map and groovy.lang.Closure, as well as classes that were explicitly imported.
UnnecessaryParenthesesForMethodCallWithClosureAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryParenthesesForMethodCallWithClosureRule - Class in org.codenarc.rule.unnecessary
If a method is called and the only parameter to that method is an inline closure then the brackets of the method call can be omitted.
UnnecessaryPublicModifierAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryPublicModifierRule - Class in org.codenarc.rule.unnecessary
The 'public' modifier is not required on methods, constructors or classes.
UnnecessaryReturnKeywordAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryReturnKeywordRule - Class in org.codenarc.rule.unnecessary
In Groovy, the return keyword is often optional.
UnnecessarySafeNavigationOperatorAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessarySafeNavigationOperatorRule - Class in org.codenarc.rule.unnecessary
Check for safe navigation operator (?.)
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.
UnnecessarySetterAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessarySetterRule - Class in org.codenarc.rule.unnecessary
Checks for explicit calls to setter methods which can, for the most part, be replaced by assignment to property.
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.
UnnecessarySubstringAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessarySubstringRule - Class in org.codenarc.rule.unnecessary
This rule finds usages of String.substring(int) and String.substring(int, int) that can be replaced by use of the subscript operator.
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.
UnnecessaryToStringAstVisitor - Class in org.codenarc.rule.unnecessary
UnnecessaryToStringRule - Class in org.codenarc.rule.unnecessary
Checks for unnecessary calls to toString().
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.
unreferencedFieldMap - Field in FieldReferenceAstVisitor
UnsafeArrayDeclarationAstVisitor - Class in org.codenarc.rule.security
UnsafeArrayDeclarationRule - Class in org.codenarc.rule.security
Triggers a violation when an array is declared public, final, and static.
UnsafeImplementationAsMapAstVisitor - Class in org.codenarc.rule.security
UnsafeImplementationAsMapRule - Class in org.codenarc.rule.security
Reports incomplete interface implementations created by map-to-interface coercions.
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
UnusedMethodParameterAstVisitor - Class in org.codenarc.rule.unused
UnusedMethodParameterRule - Class in org.codenarc.rule.unused
This rule finds instances of method parameters not being used.
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).
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
UnusedPrivateMethodAstVisitor(Map<String, MethodNode>, List<String>) - Constructor in UnusedPrivateMethodAstVisitor
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.
UseCollectManyAstVisitor - Class in org.codenarc.rule.groovyism
UseCollectManyRule - Class in org.codenarc.rule.groovyism
In many case collectMany() yields the same result as collect{}.flatten.
UseCollectNestedAstVisitor - Class in org.codenarc.rule.groovyism
UseCollectNestedRule - Class in org.codenarc.rule.groovyism
Instead of nested collect{}-calls use collectNested{}
UseOfNotifyMethodAstVisitor - Class in org.codenarc.rule.concurrency
UseOfNotifyMethodRule - Class in org.codenarc.rule.concurrency
This code calls notify() rather than notifyAll().