- AbstractAstVisitor - Class in org.codenarc.rule
-
Abstract superclass for Groovy AST Visitors used with Rules
- AbstractAstVisitor() - Constructor for class org.codenarc.rule.AbstractAstVisitor
-
- AbstractAstVisitorRule - Class in org.codenarc.rule
-
Abstract superclass for Rules that use a Groovy AST Visitor.
- AbstractAstVisitorRule() - Constructor for class org.codenarc.rule.AbstractAstVisitorRule
-
- AbstractEnhanceableAstVisitorRule - Class in org.codenarc.rule
-
Abstract superclass for Rules that use a Groovy AST Visitor and can optionally run in enhanced mode.
- AbstractEnhanceableAstVisitorRule() - Constructor for class org.codenarc.rule.AbstractEnhanceableAstVisitorRule
-
- AbstractFieldVisitor - Class in org.codenarc.rule
-
This is the base class for AST Visitors that only need to visit the fields of
a class.
- AbstractFieldVisitor() - Constructor for class org.codenarc.rule.AbstractFieldVisitor
-
- AbstractMethodCallExpressionVisitor - Class in org.codenarc.rule
-
This is the base class for AST Visitors that only need to visit the MethodCallExpressions of
a class.
- AbstractMethodCallExpressionVisitor() - Constructor for class org.codenarc.rule.AbstractMethodCallExpressionVisitor
-
- AbstractMethodVisitor - Class in org.codenarc.rule
-
This is the base class for AST Visitors that only need to visit the methods of
a class.
- AbstractMethodVisitor() - Constructor for class org.codenarc.rule.AbstractMethodVisitor
-
- AbstractRule - Class in org.codenarc.rule
-
Abstract superclass for Rules.
- AbstractRule() - Constructor for class org.codenarc.rule.AbstractRule
-
- AbstractSharedAstVisitorRule - Class in org.codenarc.rule
-
Abstract superclass for Rules that use a single, shared AstVisitor across all ClassNodes in a source (file).
- AbstractSharedAstVisitorRule() - Constructor for class org.codenarc.rule.AbstractSharedAstVisitorRule
-
- addError(String, ASTNode) - Method in class org.codenarc.rule.AbstractFieldVisitor
-
- addError(String, ASTNode) - Method in class org.codenarc.rule.AbstractMethodCallExpressionVisitor
-
- addError(String, ASTNode) - Method in class org.codenarc.rule.AbstractMethodVisitor
-
- addViolation(ASTNode, String) - Method in class org.codenarc.rule.AbstractAstVisitor
-
Add a new Violation to the list of violations found by this visitor.
- addViolation(Violation) - Method in class org.codenarc.rule.AbstractAstVisitor
-
Add a new Violation to the list of violations found by this visitor.
- addViolation(FieldNode, String) - Method in class org.codenarc.rule.AbstractFieldVisitor
-
Add a new Violation to the list of violations found by this visitor.
- addViolation(MethodCallExpression, String) - Method in class org.codenarc.rule.AbstractMethodCallExpressionVisitor
-
Add a new Violation to the list of violations found by this visitor.
- addViolation(ASTNode, String) - Method in class org.codenarc.rule.AbstractMethodVisitor
-
Add a new Violation to the list of violations found by this visitor.
- addViolation(MethodNode, String) - Method in class org.codenarc.rule.AbstractMethodVisitor
-
Add a new Violation to the list of violations found by this visitor.
- addViolation(ClassNode, String) - Method in class org.codenarc.rule.AbstractMethodVisitor
-
Add a new Violation to the list of violations found by this visitor.
- analyze(RuleSet) - Method in class org.codenarc.ant.AntFileSetSourceAnalyzer
-
Analyze all source code using the specified RuleSet and return the report results.
- AntFileSetSourceAnalyzer - Class in org.codenarc.ant
-
SourceAnalyzer implementation that gets source files from one or more Ant FileSets.
- AntFileSetSourceAnalyzer(Project, FileSet) - Constructor for class org.codenarc.ant.AntFileSetSourceAnalyzer
-
Construct a new instance on the specified Ant FileSet.
- applyTo(SourceCode, List<Violation>) - Method in class org.codenarc.rule.AbstractAstVisitorRule
-
- applyTo(SourceCode, List<Violation>) - Method in class org.codenarc.rule.AbstractRule
-
Apply this rule to the specified source and return a list of violations (or an empty List)
- applyTo(SourceCode) - Method in class org.codenarc.rule.AbstractRule
-
Apply this rule to the specified source and return a list of violations (or an empty List).
- applyTo(SourceCode, List<Violation>) - Method in class org.codenarc.rule.AbstractSharedAstVisitorRule
-
- applyTo(SourceCode) - Method in interface org.codenarc.rule.Rule
-
Apply this rule to the specified source and return a list of violations (or an empty List)
- applyVisitor(AstVisitor, SourceCode) - Method in class org.codenarc.rule.AbstractSharedAstVisitorRule
-
- AstUtil - Class in org.codenarc.util
-
Contains static utility methods and constants related to Groovy AST.
- AUTO_IMPORTED_CLASSES - Static variable in class org.codenarc.util.AstUtil
-
- AUTO_IMPORTED_PACKAGES - Static variable in class org.codenarc.util.AstUtil
-
- getAnnotation(AnnotatedNode, String) - Static method in class org.codenarc.util.AstUtil
-
Return the AnnotationNode for the named annotation, or else null.
- getApplyToClassNames() - Method in class org.codenarc.rule.AbstractAstVisitorRule
-
- getApplyToFileNames() - Method in class org.codenarc.rule.AbstractRule
-
- getApplyToFilesMatching() - Method in class org.codenarc.rule.AbstractRule
-
- getArgumentNames(MethodCallExpression) - Static method in class org.codenarc.util.AstUtil
-
Gets the argument names of a method call.
- getAstVisitor() - Method in class org.codenarc.rule.AbstractAstVisitorRule
-
- getAstVisitor(SourceCode) - Method in class org.codenarc.rule.AbstractSharedAstVisitorRule
-
Subclasses can override to provide an AstVisitor with SourceCode or AST-specific initialization.
- getAstVisitorClass() - Method in class org.codenarc.rule.AbstractAstVisitorRule
-
Each concrete subclass must either set this property or define its own property with the same name
- getColumn() - Method in class org.codehaus.groovy.transform.powerassert.Value
-
- getCompilerPhase() - Method in class org.codenarc.rule.AbstractEnhanceableAstVisitorRule
-
- getCompilerPhase() - Method in class org.codenarc.rule.AbstractRule
-
- getCompilerPhase() - Method in interface org.codenarc.rule.Rule
-
- getCurrentClassName() - Method in class org.codenarc.rule.AbstractAstVisitor
-
- getCurrentClassName() - Method in class org.codenarc.rule.AbstractMethodVisitor
-
- getCurrentClassNode() - Method in class org.codenarc.rule.AbstractAstVisitor
-
- getCurrentClassNode() - Method in class org.codenarc.rule.AbstractMethodVisitor
-
- getDeclaration(ASTNode, SourceCode) - Static method in class org.codenarc.util.AstUtil
-
- getDescription() - Method in class org.codenarc.rule.AbstractRule
-
- getDoNotApplyToClassNames() - Method in class org.codenarc.rule.AbstractAstVisitorRule
-
- getDoNotApplyToFileNames() - Method in class org.codenarc.rule.AbstractRule
-
- getDoNotApplyToFilesMatching() - Method in class org.codenarc.rule.AbstractRule
-
- getEmptyBlock(Statement) - Static method in class org.codenarc.util.AstUtil
-
- getFieldType(ClassNode, String) - Static method in class org.codenarc.util.AstUtil
-
Supports discovering many common JDK types, but not all.
- getFieldType(FieldNode) - Static method in class org.codenarc.util.AstUtil
-
Supports discovering many common JDK types, but not all.
- getInstanceOfTarget(Object) - Static method in class org.codenarc.util.AstUtil
-
- getLastLineOfNodeText(ASTNode, SourceCode) - Static method in class org.codenarc.util.AstUtil
-
- getMethodArguments(ASTNode) - Static method in class org.codenarc.util.AstUtil
-
Return the List of Arguments for the specified MethodCallExpression or a ConstructorCallExpression.
- getName() - Method in class org.codenarc.rule.AbstractRule
-
- getName() - Method in interface org.codenarc.rule.Rule
-
- getNodeText(ASTNode, SourceCode) - Static method in class org.codenarc.util.AstUtil
-
- getNullComparisonTarget(Object) - Static method in class org.codenarc.util.AstUtil
-
- getParameterNames(MethodNode) - Static method in class org.codenarc.util.AstUtil
-
Gets the parameter names of a method node.
- getPriority() - Method in class org.codenarc.rule.AbstractRule
-
- getPriority() - Method in interface org.codenarc.rule.Rule
-
- getRawLine(SourceCode, int) - Static method in class org.codenarc.util.AstUtil
-
- getRule() - Method in class org.codenarc.rule.AbstractAstVisitor
-
- getRule() - Method in class org.codenarc.rule.AbstractFieldVisitor
-
Gets the rule for this visitor.
- getRule() - Method in class org.codenarc.rule.AbstractMethodCallExpressionVisitor
-
Gets the rule for this visitor.
- getRule() - Method in class org.codenarc.rule.AbstractMethodVisitor
-
Gets the rule for this visitor.
- getSourceCode() - Method in class org.codenarc.rule.AbstractAstVisitor
-
- getSourceCode() - Method in class org.codenarc.rule.AbstractFieldVisitor
-
- getSourceCode() - Method in class org.codenarc.rule.AbstractMethodCallExpressionVisitor
-
- getSourceCode() - Method in class org.codenarc.rule.AbstractMethodVisitor
-
- getSourceDirectories() - Method in class org.codenarc.ant.AntFileSetSourceAnalyzer
-
- getSourceUnit() - Method in class org.codenarc.rule.AbstractAstVisitor
-
- getSourceUnit() - Method in class org.codenarc.rule.AbstractFieldVisitor
-
- getSourceUnit() - Method in class org.codenarc.rule.AbstractMethodCallExpressionVisitor
-
- getSourceUnit() - Method in class org.codenarc.rule.AbstractMethodVisitor
-
- getValue() - Method in class org.codehaus.groovy.transform.powerassert.Value
-
- getValues() - Method in class org.codehaus.groovy.transform.powerassert.ValueRecorder
-
- getVariableExpressions(DeclarationExpression) - Static method in class org.codenarc.util.AstUtil
-
Return the List of VariableExpression objects referenced by the specified DeclarationExpression.
- getViolationMessage() - Method in class org.codenarc.rule.AbstractRule
-
- getViolations() - Method in class org.codenarc.rule.AbstractAstVisitor
-
- getViolations() - Method in class org.codenarc.rule.AbstractFieldVisitor
-
Retrieve the List of Violations resulting from applying this visitor
- getViolations() - Method in class org.codenarc.rule.AbstractMethodCallExpressionVisitor
-
Retrieve the List of Violations resulting from applying this visitor
- getViolations() - Method in class org.codenarc.rule.AbstractMethodVisitor
-
Retrieve the List of Violations resulting from applying this visitor
- getViolations(AstVisitor, SourceCode) - Method in class org.codenarc.rule.AbstractSharedAstVisitorRule
-
- getVisited() - Method in class org.codenarc.rule.AbstractAstVisitor
-
- isBinaryExpressionType(Expression, String) - Static method in class org.codenarc.util.AstUtil
-
Returns true if the expression is a binary expression with the specified token.
- isBinaryExpressionType(Expression, List<String>) - Static method in class org.codenarc.util.AstUtil
-
Returns true if the expression is a binary expression with the specified token.
- isBlock(Statement) - Static method in class org.codenarc.util.AstUtil
-
Return true if the Statement is a block
- isBoolean(Expression) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the expression is either the true or false literal.
- isClosureDeclaration(ASTNode) - Static method in class org.codenarc.util.AstUtil
-
Returns true if the ASTNode is a declaration of a closure, either as a declaration
or a field.
- isConstant(Expression, Object) - Static method in class org.codenarc.util.AstUtil
-
Tells you if an expression is the expected constant.
- isConstantOrConstantLiteral(Expression) - Static method in class org.codenarc.util.AstUtil
-
Returns true if an expression is a constant or else a literal that contains only constant values.
- isConstantOrLiteral(Expression) - Static method in class org.codenarc.util.AstUtil
-
Tells you if an expression is a constant or literal.
- isConstructorCall(Expression, List<String>) - Static method in class org.codenarc.util.AstUtil
-
Return true if the expression is a constructor call on any of the named classes, with any number of parameters.
- isConstructorCall(Expression, String) - Static method in class org.codenarc.util.AstUtil
-
Return true if the expression is a constructor call on a class that matches the supplied.
- isEmptyBlock(Statement) - Static method in class org.codenarc.util.AstUtil
-
Return true if the Statement is a block and it is empty (contains no "meaningful" statements).
- isEnabled() - Method in class org.codenarc.rule.AbstractRule
-
- isEnhancedMode() - Method in class org.codenarc.rule.AbstractEnhanceableAstVisitorRule
-
- isFalse(Expression) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the expression is the false expression, either literal or constant.
- isFinalVariable(DeclarationExpression, SourceCode) - Static method in class org.codenarc.util.AstUtil
-
Return true if the DeclarationExpression represents a 'final' variable declaration.
- isFirstVisit(Object) - Method in class org.codenarc.rule.AbstractAstVisitor
-
Return true if the AST expression has not already been visited.
- isFromGeneratedSourceCode(ASTNode) - Static method in class org.codenarc.util.AstUtil
-
- isInstanceOfCheck(Object) - Static method in class org.codenarc.util.AstUtil
-
- isListLiteralWithOnlyConstantValues(Expression) - Static method in class org.codenarc.util.AstUtil
-
Returns true if a List literal that contains only entries that are constants.
- isMapLiteralWithOnlyConstantValues(Expression) - Static method in class org.codenarc.util.AstUtil
-
Returns true if a Map literal that contains only entries where both key and value are constants.
- isMethodCall(Statement, String, String, int) - Static method in class org.codenarc.util.AstUtil
-
Return true only if the Statement represents a method call for the specified method object (receiver),
method name, and with the specified number of arguments.
- isMethodCall(MethodCallExpression, String, String, int) - Static method in class org.codenarc.util.AstUtil
-
Return true only if the MethodCallExpression represents a method call for the specified method object (receiver),
method name, and with the specified number of arguments.
- isMethodCall(Expression, String, String, int) - Static method in class org.codenarc.util.AstUtil
-
Return true only if the expression is a MethodCallExpression representing a method call for the specified
method object (receiver), method name, and with the specified number of arguments.
- isMethodCall(Expression, String, String) - Static method in class org.codenarc.util.AstUtil
-
Return true only if the expression represents a method call (MethodCallExpression) for the specified
method object (receiver) and method name.
- isMethodCall(MethodCallExpression, List<String>, List<String>, Integer) - Static method in class org.codenarc.util.AstUtil
-
Return true only if the MethodCallExpression represents a method call for any one of the specified method
objects (receivers) and any one of the method names.
- isMethodCall(MethodCallExpression, List<String>, List<String>) - Static method in class org.codenarc.util.AstUtil
-
- isMethodCall(Expression, String, int) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the expression is a method call for a certain method name with a certain
number of arguments.
- isMethodCall(Expression, String, Range) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the expression is a method call for a certain method name with a certain
number of arguments.
- isMethodCallOnObject(Expression, String) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the expression is a method call on a particular object (which is represented as a String).
- isMethodNamed(MethodCallExpression, String, Integer) - Static method in class org.codenarc.util.AstUtil
-
Return true only if the MethodCallExpression represents a method call for the specified method name
- isMethodNamed(MethodCallExpression, String) - Static method in class org.codenarc.util.AstUtil
-
- isMethodNode(ASTNode, String, Integer, Class) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the ASTNode is a method node for the given name, arity, and return type.
- isMethodNode(ASTNode, String, Integer) - Static method in class org.codenarc.util.AstUtil
-
- isMethodNode(ASTNode, String) - Static method in class org.codenarc.util.AstUtil
-
- isNotNullCheck(Object) - Static method in class org.codenarc.util.AstUtil
-
- isNull(ASTNode) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the expression is the null literal.
- isNullCheck(Object) - Static method in class org.codenarc.util.AstUtil
-
- isOneLiner(Object) - Static method in class org.codenarc.util.AstUtil
-
- isPropertyNamed(Expression, Object) - Static method in class org.codenarc.util.AstUtil
-
- isPublic(ASTNode) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the ASTNode has a public modifier on it.
- isReady() - Method in class org.codenarc.rule.AbstractRule
-
Allows rules to check whether preconditions are satisfied and short-circuit execution
(i.e., do nothing) if those preconditions are not satisfied.
- isRuleSuppressed(Rule) - Method in class org.codenarc.analyzer.SuppressionAnalyzer
-
- isSafe(Expression) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the expression is a null safe dereference.
- isSpreadSafe(Expression) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the expression is a spread operator call
- isSuperReference(Expression) - Static method in class org.codenarc.util.AstUtil
-
- isThisReference(Expression) - Static method in class org.codenarc.util.AstUtil
-
- isTrue(Expression) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the expression is true, which can be true or Boolean.TRUE.
- isVariable(ASTNode, String) - Static method in class org.codenarc.util.AstUtil
-
Tells you if the given ASTNode is a VariableExpression with the given name.
- isViolationSuppressed(Violation) - Method in class org.codenarc.analyzer.SuppressionAnalyzer
-