[Codenarc-user] [ANN] Announcing CodeNarc 0.17
Brought to you by:
chrismair
From: Chris M. <chr...@ea...> - 2012-03-25 12:04:25
|
The CodeNarc Team is proud to announce the release of version 0.17. CodeNarc <http://codenarc.sourceforge.net/> is a static analysis tool for Groovy source code. Version 0.17 adds 9 new rules (bringing the total to 286 rules) and a bunch of bug fixes and enhancements. You can soon try it out on the CodeNarc web console <http://meetcodenarc.appspot.com/edit/14001> , running on Google App Engine. New Rules . New PrivateFieldCouldBeFinal rule (#3433042): Checks for private fields that are only set within a constructor or field initializer. Such fields can safely be made final. . New ParameterReassignment rule (#3432991): 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. . New TernaryCouldBeElvis rule (#3108331): Checks for a ternary expression with boolean and true expressions that are the same; this can be simplified to an Elvis expression. . New AssertWithinFinallyBlock rule (#3489801): Checks for assert statements within a finally block. An assert can throw an exception, hiding the original exception, if there is one. . New ConstantAssertExpression rule (#3489800): Checks for assert statements where the assert condition expressions is a constant value or literal value. . New BrokenNullCheck rule (#3161693): Looks for faulty checks for null that can cause a NullPointerException. . New VectorIsObsolete rule (#3495466): Checks for references to the (effectively) obsolete java.util.Vector class. Use the Java Collections Framework classes instead, including ArrayList or Collections.synchronizedList(). . New HashtableIsObsolete rule (#3495466): Checks for references to the (effectively) obsolete java.util.Hashtable class. Use the Java Collections Framework classes instead, including HashMap or ConcurrentHashMap. . New CrapMetric rule (#3485545): 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 and 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 unintended 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. Visit the CodeNarc Home Page <http://codenarc.sourceforge.net/> |