Last Published: 06 Mar 2011
General
Home
Downloads
Road Map
Javadocs
Mailing Lists
Bug Tracker
SourceForge Project
Running
Ant Task Usage
Command-Line
Run as a Test
Other Tools/Frameworks
Using
Creating a RuleSet
Creating a Rule
Configuring Rules
Starter RuleSet (All)
Report Types
HTML (HtmlReportWriter)
XML (XmlReportWriter)
Text (TextReportWriter)
Sample Reports
Sample HTML Report
Open Source Projects
Rules
Rule Index
Basic Rules
Braces Rules
Concurrency Rules
Design Rules
DRY Rules
Exceptions Rules
Generic Rules
Grails Rules
Imports Rules
JUnit Rules
Logging Rules
Naming Rules
Size/Complexity Rules
Unnecessary Rules
Unused Rules
Developing
Developer Guide
Project Documentation
Project Information
Project Reports
Rule Index
CodeNarc
includes 206 rules.
Basic
AddEmptyString
AssignmentInConditional
BigDecimalInstantiation
BooleanGetBoolean
BooleanMethodReturnsNull
BrokenOddnessCheck
CloneableWithoutClone
CompareToWithoutComparable
ConfusingTernary
ConsecutiveLiteralAppends
ConsecutiveStringConcatenation
ConstantIfExpression
ConstantTernaryExpression
DeadCode
DoubleNegative
DuplicateCaseStatement
EmptyCatchBlock
EmptyElseBlock
EmptyFinallyBlock
EmptyForStatement
EmptyIfStatement
EmptyInstanceInitializer
EmptyMethod
EmptyStaticInitializer
EmptySwitchStatement
EmptySynchronizedStatement
EmptyTryBlock
EmptyWhileStatement
EqualsAndHashCode
ExplicitArrayListInstantiation
ExplicitCallToAndMethod
ExplicitCallToCompareToMethod
ExplicitCallToDivMethod
ExplicitCallToEqualsMethod
ExplicitCallToGetAtMethod
ExplicitCallToLeftShiftMethod
ExplicitCallToMinusMethod
ExplicitCallToModMethod
ExplicitCallToMultiplyMethod
ExplicitCallToOrMethod
ExplicitCallToPlusMethod
ExplicitCallToPowerMethod
ExplicitCallToRightShiftMethod
ExplicitCallToXorMethod
ExplicitGarbageCollection
ExplicitHashMapInstantiation
ExplicitHashSetInstantiation
ExplicitLinkedListInstantiation
ExplicitStackInstantiation
ExplicitTreeSetInstantiation
GStringAsMapKey
GroovyLangImmutable
IntegerGetInteger
InvertedIfElse
RemoveAllOnSelf
ReturnFromFinallyBlock
ReturnsNullInsteadOfEmptyArray
ReturnsNullInsteadOfEmptyCollection
SerialVersionUID
SerializableClassMustDefineSerialVersionUID
SimpleDateFormatMissingLocale
ThrowExceptionFromFinallyBlock
Braces
ElseBlockBraces
ForStatementBraces
IfStatementBraces
WhileStatementBraces
Concurrency
BusyWait
DoubleCheckedLocking
InconsistentPropertyLocking
InconsistentPropertySynchronization
NestedSynchronization
StaticCalendarField
StaticDateFormatField
StaticMatcherField
SynchronizedMethod
SynchronizedOnBoxedPrimitive
SynchronizedOnGetClass
SynchronizedOnReentrantLock
SynchronizedOnString
SynchronizedOnThis
SynchronizedReadObjectMethod
SystemRunFinalizersOnExit
ThreadGroup
ThreadLocalNotStaticFinal
ThreadYield
UseOfNotifyMethod
VolatileArrayField
VolatileLongOrDoubleField
WaitOutsideOfWhileLoop
Design
AbstractClassWithoutAbstractMethod
CloseWithoutCloseable
ConstantsOnlyInterface
EmptyMethodInAbstractClass
FinalClassWithProtectedMember
ImplementationAsType
Dry
DuplicateNumberLiteral
DuplicateStringLiteral
Exceptions
CatchArrayIndexOutOfBoundsException
CatchError
CatchException
CatchIllegalMonitorStateException
CatchIndexOutOfBoundsException
CatchNullPointerException
CatchRuntimeException
CatchThrowable
ConfusingClassNamedException
ExceptionExtendsError
MissingNewInThrowStatement
ReturnNullFromCatchBlock
ThrowError
ThrowException
ThrowNullPointerException
ThrowRuntimeException
ThrowThrowable
Generic
IllegalRegex
RequiredRegex
StatelessClass
Grails
GrailsPublicControllerMethod
GrailsServletContextReference
GrailsSessionReference
GrailsStatelessService
Imports
DuplicateImport
ImportFromSamePackage
UnnecessaryGroovyImport
UnusedImport
Logging
LoggerForDifferentClass
LoggerWithWrongModifiers
LoggingSwallowsStacktrace
MultipleLoggers
PrintStackTrace
Println
SystemErrPrint
SystemOutPrint
Junit
ChainedTest
CoupledTestCase
JUnitAssertAlwaysFails
JUnitAssertAlwaysSucceeds
JUnitFailWithoutMessage
JUnitPublicNonTestMethod
JUnitSetUpCallsSuper
JUnitStyleAssertions
JUnitTearDownCallsSuper
JUnitTestMethodWithoutAssert
JUnitUnnecessarySetUp
JUnitUnnecessaryTearDown
UnnecessaryFail
UseAssertEqualsInsteadOfAssertTrue
UseAssertFalseInsteadOfNegation
UseAssertNullInsteadOfAssertEquals
UseAssertSameInsteadOfAssertTrue
UseAssertTrueInsteadOfAssertEquals
UseAssertTrueInsteadOfNegation
Naming
AbstractClassName
ClassName
ConfusingMethodName
FieldName
InterfaceName
MethodName
ObjectOverrideMisspelledMethodName
PackageName
ParameterName
PropertyName
VariableName
Size
AbcComplexity
ClassSize
CyclomaticComplexity
MethodCount
MethodSize
NestedBlockDepth
Unnecessary
UnnecessaryBigDecimalInstantiation
UnnecessaryBigIntegerInstantiation
UnnecessaryBooleanExpression
UnnecessaryBooleanInstantiation
UnnecessaryCallForLastElement
UnnecessaryCallToSubstring
UnnecessaryCatchBlock
UnnecessaryCollectCall
UnnecessaryCollectionCall
UnnecessaryConstructor
UnnecessaryDefInMethodDeclaration
UnnecessaryDoubleInstantiation
UnnecessaryFloatInstantiation
UnnecessaryGString
UnnecessaryGetter
UnnecessaryIfStatement
UnnecessaryInstantiationToGetClass
UnnecessaryIntegerInstantiation
UnnecessaryLongInstantiation
UnnecessaryModOne
UnnecessaryNullCheck
UnnecessaryNullCheckBeforeInstanceOf
UnnecessaryObjectReferences
UnnecessaryOverridingMethod
UnnecessaryPublicModifier
UnnecessaryReturnKeyword
UnnecessarySelfAssignment
UnnecessarySemicolon
UnnecessaryStringInstantiation
UnnecessaryTernaryExpression
UnnecessaryTransientModifier
Unused
UnusedArray
UnusedObject
UnusedPrivateField
UnusedPrivateMethod
UnusedPrivateMethodParameter
UnusedVariable