CodeNarc Report

Report title:
Date:Feb 24, 2011 9:32:38 PM
Generated with:CodeNarc v0.12

Summary by Package

PackageTotal FilesFiles with ViolationsPriority 1Priority 2Priority 3
All Packages103323
src/main11212
src/main/code21--1
src/main/test3111-
src/main/test/noviolations4----

Package: src.main

➥ MyAction.groovy

Rule NamePriorityLine #Source Line / Message
RULE11111

[SRC]if (file) {

RULE11111

[SRC]if (file) {

RULE22222

[MSG]bad stuff

RULE33333

[SRC]throw new Exception() // Some very long message 12345678..901234567890

[MSG]Other info

RULE33333

[SRC]throw new Exception() // Some very long message 12345678..901234567890

[MSG]Other info

Package: src.main.code

➥ src/main/MyAction2.groovy

Rule NamePriorityLine #Source Line / Message
RULE33333

[SRC]throw new Exception() // Some very long message 12345678..901234567890

[MSG]Other info

Package: src.main.test

➥ src/main/MyActionTest.groovy

Rule NamePriorityLine #Source Line / Message
RULE11111

[SRC]if (file) {

RULE22222

[MSG]bad stuff

Rule Descriptions

#Rule NameDescription
1DuplicateImportDuplicate import statements are unnecessary.
2ReturnFromFinallyBlockReturning from a finally block is confusing and can hide the original exception.
3ThrowExceptionFromFinallyBlockThrowing an exception from a finally block is confusing and can hide the original exception.
4UnnecessaryBooleanInstantiationUse Boolean.valueOf() for variable values or Boolean.TRUE and Boolean.FALSE for constant values instead of calling the Boolean() constructor directly or calling Boolean.valueOf(true) or Boolean.valueOf(false).
5UnnecessaryStringInstantiationUse a String literal (e.g., "...") instead of calling the corresponding String constructor (new String("..")) directly.