ruleset { description ''' A Sample Groovy RuleSet containing all CodeNarc Rules You can use this as a template for your own custom RuleSet. Just delete the rules that you don't want to include. ''' AbcMetric // Requires the GMetrics jar AbstractClassName AbstractClassWithPublicConstructor AbstractClassWithoutAbstractMethod AddEmptyString AssertWithinFinallyBlock AssignCollectionSort AssignCollectionUnique AssignmentInConditional AssignmentToStaticFieldFromInstanceMethod BigDecimalInstantiation BitwiseOperatorInConditional BlankLineBeforePackage BlockEndsWithBlankLine BlockStartsWithBlankLine BooleanGetBoolean BooleanMethodReturnsNull BracesForClass BracesForForLoop BracesForIfElse BracesForMethod BracesForTryCatchFinally BrokenNullCheck BrokenOddnessCheck BuilderMethodWithSideEffects BusyWait CatchArrayIndexOutOfBoundsException CatchError CatchException CatchIllegalMonitorStateException CatchIndexOutOfBoundsException CatchNullPointerException CatchRuntimeException CatchThrowable ChainedTest ClassEndsWithBlankLine ClassForName ClassJavadoc ClassName ClassNameSameAsFilename ClassNameSameAsSuperclass ClassSize ClassStartsWithBlankLine CloneWithoutCloneable CloneableWithoutClone CloseWithoutCloseable ClosureAsLastMethodParameter ClosureStatementOnOpeningLineOfMultipleLineClosure CollectAllIsDeprecated CompareToWithoutComparable ComparisonOfTwoConstants ComparisonWithSelf CompileStatic ConfusingClassNamedException ConfusingMethodName ConfusingMultipleReturns ConfusingTernary ConsecutiveBlankLines ConsecutiveLiteralAppends ConsecutiveStringConcatenation ConstantAssertExpression ConstantIfExpression ConstantTernaryExpression ConstantsOnlyInterface CouldBeElvis CouldBeSwitchStatement CoupledTestCase CrapMetric // Requires the GMetrics jar and a Cobertura coverage file CyclomaticComplexity // Requires the GMetrics jar DeadCode DirectConnectionManagement DoubleCheckedLocking DoubleNegative DuplicateCaseStatement DuplicateImport DuplicateListLiteral DuplicateMapKey DuplicateMapLiteral DuplicateNumberLiteral DuplicateSetValue DuplicateStringLiteral ElseBlockBraces EmptyCatchBlock EmptyClass EmptyElseBlock EmptyFinallyBlock EmptyForStatement EmptyIfStatement EmptyInstanceInitializer EmptyMethod EmptyMethodInAbstractClass EmptyStaticInitializer EmptySwitchStatement EmptySynchronizedStatement EmptyTryBlock EmptyWhileStatement EnumCustomSerializationIgnored EqualsAndHashCode EqualsOverloaded ExceptionExtendsError ExceptionExtendsThrowable ExceptionNotThrown ExplicitArrayListInstantiation ExplicitCallToAndMethod ExplicitCallToCompareToMethod ExplicitCallToDivMethod ExplicitCallToEqualsMethod ExplicitCallToGetAtMethod ExplicitCallToLeftShiftMethod ExplicitCallToMinusMethod ExplicitCallToModMethod ExplicitCallToMultiplyMethod ExplicitCallToOrMethod ExplicitCallToPlusMethod ExplicitCallToPowerMethod ExplicitCallToPutAtMethod ExplicitCallToRightShiftMethod ExplicitCallToXorMethod ExplicitGarbageCollection ExplicitHashMapInstantiation ExplicitHashSetInstantiation ExplicitLinkedHashMapInstantiation ExplicitLinkedListInstantiation ExplicitStackInstantiation ExplicitTreeSetInstantiation FactoryMethodName FieldName FieldTypeRequired FileCreateTempFile FileEndsWithoutNewline FinalClassWithProtectedMember ForLoopShouldBeWhileLoop ForStatementBraces GStringAsMapKey GStringExpressionWithinString GetterMethodCouldBeProperty GrailsDomainGormMethods GrailsDomainHasEquals GrailsDomainHasToString GrailsDomainReservedSqlKeywordName GrailsDomainStringPropertyMaxSize GrailsDomainWithServiceReference GrailsDuplicateConstraint GrailsDuplicateMapping GrailsMassAssignment GrailsPublicControllerMethod GrailsServletContextReference GrailsStatelessService GroovyLangImmutable HardCodedWindowsFileSeparator HardCodedWindowsRootDirectory HashtableIsObsolete IfStatementBraces IfStatementCouldBeTernary IllegalClassMember IllegalClassReference IllegalPackageReference IllegalRegex IllegalString IllegalSubclass ImplementationAsType ImplicitClosureParameter ImplicitReturnStatement ImportFromSamePackage ImportFromSunPackages InconsistentPropertyLocking InconsistentPropertySynchronization Indentation InsecureRandom Instanceof IntegerGetInteger InterfaceName InterfaceNameSameAsSuperInterface InvertedCondition InvertedIfElse JUnitAssertAlwaysFails JUnitAssertAlwaysSucceeds JUnitAssertEqualsConstantActualValue JUnitFailWithoutMessage JUnitLostTest JUnitPublicField JUnitPublicNonTestMethod JUnitPublicProperty JUnitSetUpCallsSuper JUnitStyleAssertions JUnitTearDownCallsSuper JUnitTestMethodWithoutAssert JUnitUnnecessarySetUp JUnitUnnecessaryTearDown JUnitUnnecessaryThrowsException JavaIoPackageAccess JavadocConsecutiveEmptyLines JavadocEmptyAuthorTag JavadocEmptyExceptionTag JavadocEmptyFirstLine JavadocEmptyLastLine JavadocEmptyParamTag JavadocEmptyReturnTag JavadocEmptySeeTag JavadocEmptySinceTag JavadocEmptyThrowsTag JavadocEmptyVersionTag JavadocMissingExceptionDescription JavadocMissingParamDescription JavadocMissingThrowsDescription JdbcConnectionReference JdbcResultSetReference JdbcStatementReference LineLength LocaleSetDefault LoggerForDifferentClass LoggerWithWrongModifiers LoggingSwallowsStacktrace LongLiteralWithLowerCaseL MethodCount MethodName MethodParameterTypeRequired MethodReturnTypeRequired MethodSize MisorderedStaticImports MissingBlankLineAfterImports MissingBlankLineAfterPackage MissingBlankLineBeforeAnnotatedField MissingNewInThrowStatement MissingOverrideAnnotation MultipleLoggers MultipleUnaryOperators NestedBlockDepth NestedForLoop NestedSynchronization NoDef NoDouble NoFloat NoJavaUtilDate NoScriptBindings NoTabCharacter NoWildcardImports NonFinalPublicField NonFinalSubclassOfSensitiveInterface ObjectFinalize ObjectOverrideMisspelledMethodName OptionalCollectionReturnType OptionalField OptionalMethodParameter PackageName PackageNameMatchesFilePath ParameterAssignmentInFilterClosure ParameterCount ParameterName ParameterReassignment PrintStackTrace Println PrivateFieldCouldBeFinal PropertyName PublicFinalizeMethod PublicInstanceField PublicMethodsBeforeNonPublicMethods RandomDoubleCoercedToZero RemoveAllOnSelf RequiredRegex RequiredString ReturnFromFinallyBlock ReturnNullFromCatchBlock ReturnsNullInsteadOfEmptyArray ReturnsNullInsteadOfEmptyCollection SerialPersistentFields SerialVersionUID SerializableClassMustDefineSerialVersionUID SimpleDateFormatMissingLocale SpaceAfterCatch SpaceAfterClosingBrace SpaceAfterComma SpaceAfterCommentDelimiter SpaceAfterFor SpaceAfterIf SpaceAfterMethodCallName SpaceAfterMethodDeclarationName SpaceAfterNotOperator SpaceAfterOpeningBrace SpaceAfterSemicolon SpaceAfterSwitch SpaceAfterWhile SpaceAroundClosureArrow SpaceAroundMapEntryColon SpaceAroundOperator SpaceBeforeClosingBrace SpaceBeforeCommentDelimiter SpaceBeforeOpeningBrace SpaceInsideParentheses SpockIgnoreRestUsed SpockMissingAssert StatelessClass StatelessSingleton StaticCalendarField StaticConnection StaticDateFormatField StaticFieldsBeforeInstanceFields StaticMatcherField StaticMethodsBeforeInstanceMethods StaticSimpleDateFormatField SwallowThreadDeath SynchronizedMethod SynchronizedOnBoxedPrimitive SynchronizedOnGetClass SynchronizedOnReentrantLock SynchronizedOnString SynchronizedOnThis SynchronizedReadObjectMethod SystemErrPrint SystemExit SystemOutPrint SystemRunFinalizersOnExit TernaryCouldBeElvis ThisReferenceEscapesConstructor ThreadGroup ThreadLocalNotStaticFinal ThreadYield ThrowError ThrowException ThrowExceptionFromFinallyBlock ThrowNullPointerException ThrowRuntimeException ThrowThrowable ToStringReturnsNull TrailingComma TrailingWhitespace UnnecessaryBigDecimalInstantiation UnnecessaryBigIntegerInstantiation UnnecessaryBooleanExpression UnnecessaryBooleanInstantiation UnnecessaryCallForLastElement UnnecessaryCallToSubstring UnnecessaryCast UnnecessaryCatchBlock UnnecessaryCollectCall UnnecessaryCollectionCall UnnecessaryConstructor UnnecessaryDefInFieldDeclaration UnnecessaryDefInMethodDeclaration UnnecessaryDefInVariableDeclaration UnnecessaryDotClass UnnecessaryDoubleInstantiation UnnecessaryElseStatement UnnecessaryFail UnnecessaryFinalOnPrivateMethod UnnecessaryFloatInstantiation UnnecessaryGString UnnecessaryGetter UnnecessaryGroovyImport UnnecessaryIfStatement UnnecessaryInstanceOfCheck UnnecessaryInstantiationToGetClass UnnecessaryIntegerInstantiation UnnecessaryLongInstantiation UnnecessaryModOne UnnecessaryNullCheck UnnecessaryNullCheckBeforeInstanceOf UnnecessaryObjectReferences UnnecessaryOverridingMethod UnnecessaryPackageReference UnnecessaryParenthesesForMethodCallWithClosure UnnecessaryPublicModifier UnnecessaryReturnKeyword UnnecessarySafeNavigationOperator UnnecessarySelfAssignment UnnecessarySemicolon UnnecessarySetter UnnecessaryStringInstantiation UnnecessaryTernaryExpression UnnecessaryToString UnnecessaryTransientModifier UnsafeArrayDeclaration UnsafeImplementationAsMap UnusedArray UnusedImport UnusedMethodParameter UnusedObject UnusedPrivateField UnusedPrivateMethod UnusedPrivateMethodParameter UnusedVariable UseAssertEqualsInsteadOfAssertTrue UseAssertFalseInsteadOfNegation UseAssertNullInsteadOfAssertEquals UseAssertSameInsteadOfAssertTrue UseAssertTrueInsteadOfAssertEquals UseAssertTrueInsteadOfNegation UseCollectMany UseCollectNested UseOfNotifyMethod VariableName VariableTypeRequired VectorIsObsolete VolatileArrayField VolatileLongOrDoubleField WaitOutsideOfWhileLoop WhileStatementBraces }