CodeNarc
-------------------------------------------------------------------------------
http://www.codenarc.org
Changes in version 0.24 (July 2015)
--------------------------------------
NEW RULES
- #110: AssignmentToStaticFieldFromInstanceMethod rule (design) - Checks for assignment to a static field from an instance method.
- #111: ClassNameSameAsSuperclass rule (naming) - Checks for any class that has an identical name to its superclass, other than the package. This can be very confusing.
- #111: InterfaceNameSameAsSuperInterface rule (naming) - Checks for any interface that has an identical name to its super-interface, other than the package. This can be very confusing.
UPDATED/ENHANCED RULES AND BUG FIXES
- #91: ClassJavadoc rule: Allow regular comments or annotations before Javadoc section. (Thanks to Sébastien Launay)
- #90: UnnecessarySafeNavigationOperator rule: Fix false positive on spread operator.
- #95: Some tests incompatible with Java 8. (Thanks to Artur Gajowy)
- #107: FileEndsWithoutNewlineRule to handle empty source. (Thanks to René Scheibe)
- #108: Fix NPE when analyzing file with trait; fix #93. (Thanks to Dominik Przybysz)
FRAMEWORK AND INFRASTRUCTURE
- #92: New SortableHtmlReportWriter, report type "sortable". Sort by rules (with the most violations) and files (with the most violations), as well as rule name and rule priority.
- #89: Provide mechanism for excluding a baseline violations file. Add "baseline" report type and associated "excludeBaseline" property to Ant Task.
- #39: Convert project to Gradle. (Thanks very much to Tomasz Przybysz, Marcin Erdmann and Kyle Boon)
- #100: Remove IDE project files from source control. Use Gradle IDEA Plugin.
- #106: HtmlReportWriter add includeRuleDescriptions property.
- #109: Enable @SuppressWarnings to work on constructors.
- #112: Fix file encoding for CHANGELOG.txt in codenarc.groovy command-line script
Changes in version 0.23 (Feb 2015)
--------------------------------------
NEW RULES
- #73: NestedForLoop rule (design) - Checks for nested for loops. (Thanks to Maciej Ziarko)
- #80: ParameterCount rule (size) - Checks if the number of parameters in method/constructor exceeds the number of parameters specified by the maxParameters property. (Thanks to Maciej Ziarko)
UPDATED/ENHANCED RULES AND BUG FIXES
- #69: PrivateFieldCouldBeFinal rule support for JPA entities. (Thanks to Maciej Ziarko)
- #70: GStringExpressionWithinString rule should ignore quasi GString expressions inside annotations. (Thanks to Maciej Ziarko)
- #76: SpaceAfterClosingBrace and SpaceBeforeOpeningBrace rules: GStrings with embedded closures incorrectly cause violations. (Thanks to Maciej Ziarko)
- #59: SpaceAfterClosingBrace false violation if string contains closing brace. (fixed by #76)
- #79: JUnitTestMethodWithoutAssert support for JUnit's ExpectedException way to verify exceptions. (Thanks to Maciej Ziarko)
- #66: SpaceAfterComma rule doesn't check constructor calls or constructor declarations.
- #82: IdeTextReportWriter violation link (loc=..) does not work in Eclipse.
- #81: XML Report: Escape illegal XML characters within the source line or message.
- #84: XML Report: Remove illegal (non-escapable) XML characters from the source line or message.
- #88: UseAssertTrueInsteadOfAssertEquals: Only check assert statements if checkAssertStatements property is true; defaults to false.
FRAMEWORK AND INFRASTRUCTURE
- #86: Upgrade to Groovy 2.x. (>= 2.1.0) [BREAKING CHANGE]
- #67: Don't depend on groovy-all jar, but only on the specifically required groovy artifacts.
- #68: Cleaned up and fixed HtmlReportWriterTest.
- #74: Improved codenarc.groovy to remove Rule suffix from rule name. (Thanks to Maciej Ziarko)
- #87: Switch pom.xml to use Groovy-Eclipse Compiler.
- #83: HtmlReportWriter: Optionally skip violation summary by package. Add includeSummaryByPackage property; defaults to true.
Changes in version 0.22 (Oct 2014)
--------------------------------------
NEW RULES
- #56: PackageMatchesFilePath rule (naming) - A package source file's path should match the package itself. (Thanks to Simon Tost)
- #150: Instanceof rule (design) - Checks for use of the instanceof operator. Use ignoreTypeNames property to configure ignored type names.
- #423: UnnecessarySafeNavigationOperator rule (unnecessary) - Check for the safe navigation operator (?.) applied to constants and literals, which can never be null.
- #63: NoDef rule (convention) - Check for all uses of the def keyword. (Thanks to Dominik Przybysz)
UPDATED/ENHANCED RULES AND BUG FIXES
- #157: Enable optionally using Thread Context classpath for loading rule scripts. Introduce "codenarc.useCurrentThreadContextClassLoader" system property. See https://jira.grails.org/browse/GPCODENARC-32.
- #55: FieldName rule - Add private static final field name regex. (Thanks to Dominik Przybysz)
- #54: Invalid Cast to BigDecimal. In an XML ruleset or "codenarc.properties", specifying a BigDecimal property value throws an exception.
- #51: CodeNarc command-line runner always returns 0, even for failure/error. Now return exit status of 1 for all errors.
- #58: SpaceBeforeOpeningBrace rule: Allow for opening parenthesis before opening brace. (Thanks to Dominik Przybysz)
- #158 SpaceAfterClosingBrace rule: allow semicolons following closing brace.
- #155: SpaceAroundMapEntryColon rule: Using spread map operator (*:) causes to fail with ArrayIndexOutOfBoundsException
- #154: Line numbers for violations of TrailingWhitespace rule are 0-based. Same for IllegalRegex rule. Fix AbstractSourceCode.getLineNumberForCharacterIndex() to be 1-based.
- #159: ToStringReturnsNullRule: throws "No signature of method handleClosure()" exception if toString() contains a Closure.
- #53: SpockIgnoreRestUsed not working in tests extending a class that descends from Specification. Add specificationSuperclassNames and specificationClassNames properties.
- #160: PackageName rule: Fix to allow package name containing numbers in first part, e.g. "t3". Change package name regex to /[a-z]+[a-z0-9]*(\.[a-z0-9]+)*/.
- #161: ReturnNullFromCatchBlock: Reports return statement from within a void method. Add boolean shouldVisitMethod(MethodNode node) to AbstractAstVisitor.
- #62: GrailsDuplicateConstraint: consider importFrom includes: constraints when checking for duplicate constraint violations. (Thanks to Dan Tanner)
- #64: SpaceAfterOpeningBrace and SpaceBeforeClosingBrace rules: Add ignoreEmptyBlock property to allow no spaces between braces for empty blocks. (Thanks to Dominik Przybysz)
- #65: HtmlReportWriter and TextReportWriter do not properly parse the maxPriority report option.
FRAMEWORK AND INFRASTRUCTURE
- #435: IdeTextReportWriter: Text report formatter that includes automatic IDE (Eclipse/Idea) hyperlinks to source code. Provide new "ide" report type in ReportWriterFactory.
- #157: Enable optionally using Thread Context classloader. Also see GPCODENARC-32. Introduce codenarc.useCurrentThreadContextClassLoader system property.
Changes in version 0.21 (April 2014)
-------------------------------------------
NEW RULES
- #30: GrailsMassAssignment rule (grails) - Checks for mass assignment from a params Map within Grails domain classes. (Thanks to Brian Soby)
- #38: NoWildcardImports rule (imports) - Wildcard imports, static or otherwise, should not be used. (Thanks to Kyle Boon)
- #41: ConsecutiveBlankLines rule (formatting) - Makes sure there are no consecutive lines that are either blank or whitespace only. (Thanks to Joe Sondow)
- #42: BlankLineBeforePackage rule (formatting) - Makes sure there are no blank lines before the package declaration of a source code file. (Thanks to Joe Sondow)
- #43: FileEndsWithoutNewline rule (formatting) - Makes sure the source code file ends with a newline character. (Thanks to Joe Sondow)
- #44: MissingBlankLineAfterImports rule (formatting) - Makes sure there is a blank line after the imports of a source code file. (Thanks to Joe Sondow)
- #46: MissingBlankLineAfterPackage rule (formatting) - Makes sure there is a blank line after the package statement of a source code file. (Thanks to Joe Sondow)
- #47: TrailingWhitespaceRule (formatting) - Checks that no lines of source code end with whitespace characters. (Thanks to Joe Sondow)
- #411: ExceptionExtendsThrowable rule (exceptions) - Checks for classes that extend Throwable. Custom exception classes should subclass Exception or one of its descendants.
- #341: UnnecessaryCast rule (unnecessary) - Checks for unnecessary cast operations.
- #149: IllegalSubclass rule (generic) - Checks for classes that extend one of the specified set of illegal superclasses.
- #157: UnnecessaryToString rule (unnecessary) - Checks for unnecessary calls to toString().
- #152: JUnitPublicProperty rule (junit) - Checks for public properties defined on JUnit test classes.
- #422: ToStringReturnsNull rule (design) - Checks for toString() methods that return null.
- #143: MultipleUnaryOperators rule (basic) - Checks for multiple consecutive unary operators.
UPDATED/ENHANCED RULES AND BUG FIXES
- #31: UnusedImportRule: Extended to now also detect cases where the imported class name occurs as a substring in the source code. (Thanks to Ren? Scheibe)
- #36: UnnecessaryDefInMethodDeclaration: Prevent false positives from modifiers within quoted method name. (Thanks to Ren? Scheibe)
- #37: LineLengthRule: Flags to ignore import and package statements line length. (Thanks to Kyle Boon)
- #35: UnnecessaryPackageReferenceRule: raises confusing violation for Script with package.
- #48: Fix Method chaining breaks SpaceAfterComma.
- #49: Fix SpaceBeforeOpeningBrace doesn't work on switch statements.
- #50: Fix UnnecessaryDotClass doesn't work if class is qualified
- #153: Fix ClosureStatementOnOpeningLineOfMultipleLineClosure does not catch multiline closure with only a single statement.
Changes in version 0.20 (Dec 2013)
-------------------------------------------
NEW RULES
- #425: LocaleSetDefault rule (design) - Checks for calls to Locale.setDefault(), which sets the Locale across the entire JVM. (Thanks to Ming Huang and Rob Patrick)
- #114: IllegalString rule (generic) - Checks for a specified illegal string within the source code.
- #430: SpaceAroundMapEntryColon rule (formatting) - Check for proper formatting of whitespace around ':' for literal Map entries.
- #427: ClosureStatementOnOpeningLineOfMultipleLineClosure rule (formatting) - Checks for closure logic on first line (after ->) for a multi-line closure.
UPDATED/ENHANCED RULES
- #426: Disable GrailsPublicControllerMethod by default.
- #424: Expand SpaceAroundOperator rule to also check for "as" operator.
- #432: Add checkLastStatementImplicitElse property on IfStatementCouldBeTernary and UnnecessaryIfStatement.
BUG FIXES
- #409: Fix bug ClassNameSameAsFilenameRule when sourceCode.name is null.
- #22: Fix DuplicateStringLiteral: Allow empty strings within ignoreStrings. (Thanks to Ei Kageyama)
- #21: Fix ClassJavadoc rule has no effect. Also ignore blank lines between javadoc and class declaration.
- #143: Fix UnsafeImplementationAsMap - duplicate violation.
- #135: Fix CoupledTestCase incorrectly thrown when referencing the current class.
- #24: Enable Groovy ruleset to find custom rules (pass the current ClassLoader to the GroovyShell). (Thanks John Engelman)
- #26: Fix MissingMethodException error on custom rule with recent Groovy. (Thanks to Joe Sondow)
- #146: Fix SpaceAroundOperator: Does not catch some violations with elvis operator (?:)
- #139: Fix JUnitPublicField to ignore interfaces.
FRAMEWORK AND INFRASTRUCTURE
- #23: Inline violations support within rule tests. (Thanks to Artur Gajowy)
- #428: Use ClassNode if present in ImportNode to get line number and possibly source text
- #431: Remove unused "samples" folder.
- #434: Remove duplicate logging of CodeNarc results.
- #433: Rename BaseSourceAnalyzer to AbstractSourceAnalyzer.
Changes in version 0.19 (Jul 2013)
-------------------------------------------
NEW RULES
- #349: New EmptyClass rule (basic) - Reports classes without methods, fields or properties. Why would you need a class like this?
- #409: New ClassNameSameAsFilename rule (naming) - Reports files containing only one top level class / enum / interface which is named differently than the file.
- #214: New ThisReferenceEscapesConstructor rule (concurrency) - Reports constructors passing the 'this' reference to other methods. Thanks to Artur Gajowy. (pull request #15)
- #340: New GrailsDomainReservedSqlKeywordName rule (grails) - Check for Grails domain class with class or field name which is a reserved SQL keyword. Thanks to Artur Gajowy. (pull request #13)
- #339: New GrailsDomainWithServiceReference rule (grails) - Check for Grails domain class with reference to service class (field). Thanks to Artur Gajowy. (pull request #12)
- #382: New JUnitPublicField rule (junit) - There is usually no reason to have a public field (even a constant) on a test class.
- #407: New GStringExpressionWithinString rule (groovyism) - Check for regular (single quote) strings containing a GString-type expression (${..}).
- #417: New IllegalClassMember rule (generic) - Checks for classes containing fields/properties/methods matching configured illegal member modifiers or not matching any of the configured allowed member modifiers.
- #412: New EnumCustomSerializationIgnored rule (serialization) - Checks for enums that define writeObject() or writeReplace() methods, or declare serialPersistentFields or serialVersionUID fields, all of which are ignored for enums.
- #421: SpaceAroundClosureArrow rule (formatting) - Checks that there is whitespace around the closure arrow (->) symbol
New "Enhanced Classpath" Ruleset: These rules require application classes on CodeNarc's classpath:
- #329: New UnsafeImplementationAsMap rule - Reports incomplete interface implementations created by map-to-interface coercions. By default, this rule does not apply to test files. Thanks to Artur Gajowy. (pull request #14)
- #364: New CloneWithoutCloneable rule - The method clone() should only be declared if the class implements the Cloneable interface. Thanks to Artur Gajowy. (pull request #14)
- #278: New JUnitAssertEqualsConstantActualValue rule - Reports usages of org.junit.Assert.assertEquals([message,] expected, actual) where the 'actual' parameter is a constant or a literal. Most likely it was intended to be the 'expected' value.
UPDATED/ENHANCED RULES
- #371: CouldBeElvis rule. Added support for IF statements without braces.
- #408: SerialVersionUID rule: Also check that serialVersionUID field is declared private.
- #414: Extend UnnecessaryIfStatement rule: if (condition){ return true }; return false.
- #415: Extend IfStatementCouldBeTernary rule: if (condition) { return 1 }; return 2.
- #416: Enhance JUnitAssertAlwaysSucceeds and JUnitAssertAlwaysFails to catch String or number constant or List or Map literal passed in as condition parameter; and add support for checking assertNotNull().
BUG FIXES
- Fix bug in UnnecessaryDefInFieldDeclarationRule making it report false positives with 'def' on right hand side of assignment
- #135: CoupledTestCase incorrect violation when referencing the current class.
- #19: Fix BracesForMethod rule for single-line methods.
- #20: HTML Report Anchor Fix. Thanks to Jeff Beck.
- #137: Mistake in ExplicitHashSetInstantiationRule violation message.
- #138: SpaceAroundOperators: Add violation for isEcpr?processRecords(records[0]):''
FRAMEWORK AND INFRASTRUCTURE
- Added support for per-rule custom compilation phase, allowing for more type information in AST when required.
NOTE: New rules that use a later compilation phase require that CodeNarc have the application classes being
analyzed on the classpath. This adds a new int getCompilerPhase() method to Rule. Thanks to Artur Gajowy. (pull request #14)
- #419: Add maxPriority property to HTML and Text ReportWriters - filter out lower priority violations.
Changes in version 0.18.1 (Feb 2013)
-------------------------------------------
BUG FIXES
- Fix #3596256: SpaceAroundOperatorRule: False positive if source line contains unicode chars.
Also affects (known limitation): SpaceAfterClosingBrace, SpaceBeforeOpeningBrace, SpaceBeforeClosingBrace - Known limitation: will not catch violations on same line following unicode char literal.
- Fix #3598154: SpaceAroundOperator: bad/duplicate violation for ?: after closure. Ignore standalone elvis expression statements (known limitation).
- Fix #3598717: BracesForClassRule failing on annotation types. (Known limitation: ignore for @interface). Thanks to Marcin Gryszko.
- Fix #3598732: BracesForMethodRule fixed for methods with closure parameters. Thanks to Marcin Gryszko.
- Fix #3596323: BracesForClassRule ignored for enums and Groovy 1.7. Thanks to Marcin Gryszko.
- Fix for CodeNarc GitHub issue #10: No such property: maxMethodComplexity for class: org.codenarc.rule.size.AbcMetricRule.
- Fix #3604095: AssignCollectionSort ignore calls that pass in mutate=false; add checks for two-arg calls.
- Fix #3603257: UnusedVariable reported for variable used in (more than one) for loop.
Changes in version 0.18 (Dec 2012 )
-------------------------------------------
NEW RULES
- #3531554: New JUnitLostTest rule. Checks for classes that import JUnit 4 classes and contain a public, instance, void, no-arg method named test* that is not annotated with @Test.
- #3509530: New SpaceAfterComma rule. Checks that there is at least one space or whitespace following each comma. That includes checks for method and closure declaration parameter lists, method call parameter lists, Map literals and List literals.
- #3583257: New SpaceAfterSemicolon rule. Checks that there is at least one space or whitespace following a semicolon that separates classic for loop clauses and also multiple statements per line.
- #3509532: New SpaceAroundOperator rule. Check that there is at least one space (blank) or whitespace around each binary operator, including: +, -, *, /, >>, <<, &&, ||, &, |, ?:, =.
- #3583262: New SpaceBeforeOpeningBrace rule. Check that there is at least one space (blank) or whitespace before each opening brace ("{"). This checks method/class/interface declarations, closure expressions and block statements.
- #3583262: New SpaceAfterOpeningBrace rule. Check that there is at least one space (blank) or whitespace after each opening brace ("{"). This checks method/class/interface declarations, closure expressions and block statements.
- #3583262: New SpaceAfterClosingBrace rule. Check that there is at least one space (blank) or whitespace after each closing brace ("}"). This checks method/class/interface declarations, closure expressions and block statements.
- #3583262: New SpaceBeforeClosingBrace rule. Check that there is at least one space (blank) or whitespace before each closing brace ("}"). This checks method/class/interface declarations, closure expressions and block statements.
- #3589701: New SpaceAfterIf rule. Check that there is exactly one space (blank) after the if keyword and before the opening parenthesis.
- #3589701: New SpaceAfterWhile rule. Check that there is exactly one space (blank) after the while keyword and before the opening parenthesis.
- #3589701: New SpaceAfterFor rule. Check that there is exactly one space (blank) after the for keyword and before the opening parenthesis.
- #3589701: New SpaceAfterSwitch rule. Check that there is exactly one space (blank) after the switch keyword and before the opening parenthesis.
- #3589701: New SpaceAfterCatch rule. Check that there is exactly one space (blank) after the catch keyword and before the opening parenthesis.
- #3581377: New JUnitUnnecessaryThrowsException rule. Check for throws clauses on JUnit test methods. That is not necessary in Groovy.
- #3575859: New GrailsDuplicateMapping rule. Check for duplicate entry in a domain class mapping.
- #3575861: New GrailsDuplicateConstraint rule. Check for duplicate constraints entry
- #3592678: New IfStatementCouldBeTernary rule - Checks for if statements where both the if and else blocks contain only a single return statement with a value
- #3581378: New ExceptionNotThrown rule - Checks for an exception constructor call without a throw as the last statement within a catch block.
UPDATED/ENHANCED RULES
- Pull request #2: Adding support for catch, finally, and else brace placement validation. Thanks to Matias Bjarland.
- #3521130: PrintStackTrace: Also check for StackTraceUtils.printSanitizedStackTrace().
- #3589971: Add threshold for max class metric value for CyclomaticComplexity, AbcMetric and CrapMetric.
- #3574257: Rename AbcComplexity rule to AbcMetric. Deprecate old AbcComplexity rule and set enabled=false. Rename properties, e.g. maxMethodAbcScore.
- Pull request #5: Enhanced UnusedVariableRule to enable ignoring some variables (ignoreVariableNames). Thanks to René Scheibe.
BUG FIXES
- Fix #3555096: UnusedPrivateMethod - StringIndexOutOfBoundsException for zero-length method name.
- Fix #3524882: False positive UnnecessaryPackageReference violation for Enums.
- Fix #3558623: UnnecessarySemicolon - violations inside classes were ignored. Thanks to Marcin Erdmann.
- Fix #3574259: CyclomaticComplexity, CrapMetric and AbcComplexity: Do not check class-level metric value if maxClassAverageMethodXX value is null or 0.
- Fix #3526749: The FieldName rule should ignore serialVersionUID fields by default.
- Fix #3543848: Online docs; formatting on Naming rules doc.
- Fix #3441842: Online docs; UnnecessarySubstring documentation is misleading.
- Fix #3511004: PrivateFieldCouldBeFinal false positive (-- and ++ operators).
- Fix Pull request #4: parseReport doesn't work with absolute paths on windows. Thanks to Gavin Matthews.
FRAMEWORK AND INFRASTRUCTURE
- #3546737: Migrate source code from Subversion to GitHub. Many thanks to Marcin Erdmann.
- #3578372: Add notes to rule index and sample rule sets that ABC/CC rules require the GMetrics jar.
- #3578909: Move helper methods from AbstractTestCase into new TestUtil class (to enable use by other test frameworks, e.g. Spock)
- #3578909: Upgrade tests and test framework to JUnit 4.
- #3578909: Move test framework classes into src/main/groovy, so that they are included in the CodeNarc jar:
AbstractTestCase, InMemoryAppender, TestUtil, AbstractRuleTestCase, StubRule
- Switch to Sonatype OSS Maven Repository
Changes in version 0.17 (March 2012)
-------------------------------------------
NEW RULES
- #3433042: New PrivateFieldCouldBeFinal rule: Checks for private fields that are only set within a constructor or field initializer. Such fields can safely be made final.
- #3432991: New ParameterReassignment rule: Checks for a method or closure parameter being reassigned to a new value within the body of the method/closure, which is a confusing, bad practice. Use a temporary variable instead.
- #3108331: New TernaryCouldBeElvis rule: Checks for ternary with boolean and true expressions are the same; can be simplified to an Elvis expression.
- #3489801: New AssertWithinFinallyBlock rule: Checks for assert statements within a finally block. An assert can throw an exception, hiding the original exception, if there is one.
- #3489800: New ConstantAssertExpression rule: Checks for assert statements where the assert condition expressions is a constant value or literal value.
- #3161693: New BrokenNullCheck rule: Looks for faulty checks for null that can cause a NullPointerException.
- #3495466: New VectorIsObsolete rule: Checks for references to the (effectively) obsolete java.util.Vector class. Use the Java Collections Framework classes instead including ArrayList or Collections.synchronizedList().
- #3495466: New HashtableIsObsolete rule: Checks for references to the (effectively) obsolete java.util.Hashtable class. Use the Java Collections Framework classes instead including HashMap or ConcurrentHashMap.
- #3485545: New CrapMetric rule: Checks the CRAP metric score for methods. This metric is based on the cyclomatic complexity and test coverage for individual methods. Requires a Cobertura XML coverage file and GMetrics 0.5.
UPDATED/ENHANCED RULES
- #3476844: Extend GetterMethodCouldBeProperty to also check static getter methods.
- #3477351: UnnecessaryConstructor: Also catch constructor containing only call to super().
- #3460463: StatelessClassRule and GrailsStatelessServiceRule: Ignore fields annotated with @Inject.
- #3460463: GrailsStatelessServiceRule: Ignore non-static properties (i.e., no visibility modifier specified) declared with "def".
- #3485544: AssignmentInConditional: Also catch nested binary expressions, e.g. if (x==1 || x=3)
- #3488705: GrailsDomainHasToString: Ignore classes annotated with @ToString or @Canonical.
- #3488704: GrailsDomainHasEquals: Ignore classes annotated with @EqualsAndHashCode or @Canonical.
- #3501349: UnnecessaryPackageReference: Also check for explicitly-imported classes.
- #3509542: UnnecessaryPackageReference: Also check for package references in "as <Class>".
BUG FIXES
- #3463408: Remove dependency on Java 1.6 (String.isEmpty()).
- #3475170: Fix duplicate violations for SimpleDateFormatMissingLocale.
- #3477085. Fix UnusedImport violations missing line numbers for imports with semicolons.
- #3477162: Fix duplicate violations for UnnecessaryDotClass.
- #3487448: Fix UnnecessaryNullCheckBeforeInstanceOf should also check standalone binary (boolean) expressions, e.g. boolean ready = x != null && x instanceof Integer
- #3496557: Fix UseCollectNestedRule: GroovyCastException: Cannot cast object VariableExpression to class ClosureExpression
- #3496696: Fix UnusedPrivateFieldRule: GroovyCastException: Cannot cast object with class 'org.codehaus.groovy.ast.FieldNode' to class 'groovy.lang.MetaClass'.
FRAMEWORK AND INFRASTRUCTURE
- #3495841: Support Groovy 2.x.
- #3496463: Support GMetrics 0.5.
- #3476394: Include PMD report in project reports; Fix/resolve violations.
- Introduce AbstractSharedAstVisitorRule. Refactor UnusedPrivateFieldRule and UnusedPrivateMethodRule to use it.
- Add exists() method to org.codenarc.util.io.Resource and implementations