CodeNarc Report

Report title:Grails 1.3.7
Date:Mar 5, 2011 10:23:33 PM
Generated with:CodeNarc v0.13

Summary by Package

PackageTotal FilesFiles with ViolationsPriority 1Priority 2Priority 3
All Packages745410-2001240
scripts7028-16714
src/grails/grails-app/conf5----
src/grails/grails-app/conf/spring1----
src/grails/plugin/grails-app/conf1----
src/java/grails/doc33-101
src/java/grails/doc/ant11-2-
src/java/grails/doc/filters32-42
src/java/grails/spring11-8-
src/java/grails/test109-6219
src/java/grails/util43-344
src/java/grails/validation1----
src/java/grails/web11--1
src/java/org/codehaus/groovy/grails/cli1----
src/java/org/codehaus/groovy/grails/commons/cfg22-7-
src/java/org/codehaus/groovy/grails/commons/metaclass11-1-
src/java/org/codehaus/groovy/grails/compiler11-1-
src/java/org/codehaus/groovy/grails/documentation1----
src/java/org/codehaus/groovy/grails/orm/hibernate11--1
src/java/org/codehaus/groovy/grails/orm/hibernate/cfg122-13-
src/java/org/codehaus/groovy/grails/plugins88-951
src/java/org/codehaus/groovy/grails/plugins/codecs114-95
src/java/org/codehaus/groovy/grails/plugins/converters11-71
src/java/org/codehaus/groovy/grails/plugins/converters/codecs2----
src/java/org/codehaus/groovy/grails/plugins/datasource11-13-
src/java/org/codehaus/groovy/grails/plugins/i18n11-2-
src/java/org/codehaus/groovy/grails/plugins/logging11-112
src/java/org/codehaus/groovy/grails/plugins/orm/hibernate11-462
src/java/org/codehaus/groovy/grails/plugins/publishing11-2-
src/java/org/codehaus/groovy/grails/plugins/scaffolding11-7-
src/java/org/codehaus/groovy/grails/plugins/services11-6-
src/java/org/codehaus/groovy/grails/plugins/support11-1-
src/java/org/codehaus/groovy/grails/plugins/testing41--1
src/java/org/codehaus/groovy/grails/plugins/web33-581
src/java/org/codehaus/groovy/grails/plugins/web/filters63-125
src/java/org/codehaus/groovy/grails/plugins/web/mapping11-13-
src/java/org/codehaus/groovy/grails/plugins/web/mimes11-6-
src/java/org/codehaus/groovy/grails/plugins/web/taglib98-873
src/java/org/codehaus/groovy/grails/resolve44-383
src/java/org/codehaus/groovy/grails/scaffolding11-7-
src/java/org/codehaus/groovy/grails/support11--2
src/java/org/codehaus/groovy/grails/test31-1-
src/java/org/codehaus/groovy/grails/test/event2----
src/java/org/codehaus/groovy/grails/test/io2----
src/java/org/codehaus/groovy/grails/test/junit411-21
src/java/org/codehaus/groovy/grails/test/junit4/listener21-3-
src/java/org/codehaus/groovy/grails/test/junit4/result1----
src/java/org/codehaus/groovy/grails/test/junit4/runner31--2
src/java/org/codehaus/groovy/grails/test/report/junit1----
src/java/org/codehaus/groovy/grails/test/support73-51
src/java/org/codehaus/groovy/grails/validation1----
src/java/org/codehaus/groovy/grails/web/converters32-2-
src/java/org/codehaus/groovy/grails/web/converters/configuration11--4
src/java/org/codehaus/groovy/grails/web/filters1----
src/java/org/codehaus/groovy/grails/web/i18n1----
src/java/org/codehaus/groovy/grails/web/mapping11-11
src/java/org/codehaus/groovy/grails/web/metaclass32-5-
src/java/org/codehaus/groovy/grails/web/mime32-5-
src/java/org/codehaus/groovy/grails/web/pages22-61
src/java/org/codehaus/groovy/grails/web/pages/ext/jsp74-30-
src/java/org/codehaus/groovy/grails/web/plugins/support11-11-
src/java/org/codehaus/groovy/grails/web/servlet/mvc22-142
src/java/org/codehaus/groovy/grails/web/servlet/mvc/exceptions1----
src/java/org/codehaus/groovy/grails/web/taglib22-91
src/java/org/codehaus/groovy/grails/web/util11-15-
src/java/org/codehaus/groovy/grails/webflow11-163
src/java/org/codehaus/groovy/grails/webflow/context/servlet11--1
src/java/org/codehaus/groovy/grails/webflow/engine/builder86-343
src/jsp21/org/codehaus/groovy/grails/web/pages/ext/jsp22-6-
src/test/grails/ant11-2-
src/test/grails/build/eclipse11-1-
src/test/grails/persistence11-1-
src/test/grails/spring31-171
src/test/grails/test1210-817
src/test/grails/util76-512
src/test/grails/web1----
src/test/org/codehaus/groovy/grails/cli21-7-
src/test/org/codehaus/groovy/grails/cli/support22-82
src/test/org/codehaus/groovy/grails/commons117-482
src/test/org/codehaus/groovy/grails/commons/cfg5----
src/test/org/codehaus/groovy/grails/commons/metaclass32-111
src/test/org/codehaus/groovy/grails/compiler11-22
src/test/org/codehaus/groovy/grails/compiler/injection1----
src/test/org/codehaus/groovy/grails/context/support11-4-
src/test/org/codehaus/groovy/grails/documentation11-22
src/test/org/codehaus/groovy/grails/domain8----
src/test/org/codehaus/groovy/grails/orm/hibernate19092-30538
src/test/org/codehaus/groovy/grails/orm/hibernate/binding32-7-
src/test/org/codehaus/groovy/grails/orm/hibernate/cfg52-2-
src/test/org/codehaus/groovy/grails/orm/hibernate/metaclass11--2
src/test/org/codehaus/groovy/grails/orm/hibernate/support22-520
src/test/org/codehaus/groovy/grails/orm/hibernate/validation81-311
src/test/org/codehaus/groovy/grails/orm/support11-1-
src/test/org/codehaus/groovy/grails/plugins107-153
src/test/org/codehaus/groovy/grails/plugins/datasource11-2-
src/test/org/codehaus/groovy/grails/plugins/grails-app/conf2----
src/test/org/codehaus/groovy/grails/plugins/grails-app/services1----
src/test/org/codehaus/groovy/grails/plugins/i18n11-5-
src/test/org/codehaus/groovy/grails/plugins/logging11-71
src/test/org/codehaus/groovy/grails/plugins/metadata1----
src/test/org/codehaus/groovy/grails/plugins/publishing1----
src/test/org/codehaus/groovy/grails/plugins/scaffolding11-2-
src/test/org/codehaus/groovy/grails/plugins/services22-21
src/test/org/codehaus/groovy/grails/plugins/testing3----
src/test/org/codehaus/groovy/grails/plugins/web53-143
src/test/org/codehaus/groovy/grails/plugins/web/filters52-35
src/test/org/codehaus/groovy/grails/plugins/web/mapping11-1-
src/test/org/codehaus/groovy/grails/plugins/webflow21-2-
src/test/org/codehaus/groovy/grails/reload42-5-
src/test/org/codehaus/groovy/grails/resolve21-21-
src/test/org/codehaus/groovy/grails/scaffolding22-21
src/test/org/codehaus/groovy/grails/scaffolding/view22-3-
src/test/org/codehaus/groovy/grails/test/support1----
src/test/org/codehaus/groovy/grails/validation74-51
src/test/org/codehaus/groovy/grails/web/binding134-62
src/test/org/codehaus/groovy/grails/web/codecs113-9-
src/test/org/codehaus/groovy/grails/web/context11-4-
src/test/org/codehaus/groovy/grails/web/converters63-54
src/test/org/codehaus/groovy/grails/web/errors11-3-
src/test/org/codehaus/groovy/grails/web/filters21--3
src/test/org/codehaus/groovy/grails/web/i18n11-13-
src/test/org/codehaus/groovy/grails/web/json1----
src/test/org/codehaus/groovy/grails/web/mapping2214-10618
src/test/org/codehaus/groovy/grails/web/mapping/filter22-12
src/test/org/codehaus/groovy/grails/web/metaclass3----
src/test/org/codehaus/groovy/grails/web/mime21-2-
src/test/org/codehaus/groovy/grails/web/pages189-153
src/test/org/codehaus/groovy/grails/web/pages/ext/jsp99-392
src/test/org/codehaus/groovy/grails/web/servlet65-71
src/test/org/codehaus/groovy/grails/web/servlet/filter11-1-
src/test/org/codehaus/groovy/grails/web/servlet/mvc1912-416
src/test/org/codehaus/groovy/grails/web/servlet/view11-11
src/test/org/codehaus/groovy/grails/web/sitemesh32-12-
src/test/org/codehaus/groovy/grails/web/taglib3621-1076
src/test/org/codehaus/groovy/grails/web/util32-9-
src/test/org/codehaus/groovy/grails/webflow55-147
src/test/org/codehaus/groovy/grails/webflow/engine/builder88-221
src/test/org/codehaus/groovy/grails/webflow/support11-151

Package: scripts

➥ BugReport.groovy

Rule NamePriorityLine #Source Line / Message
SimpleDateFormatMissingLocale243

[SRC]def date = new java.text.SimpleDateFormat("ddMMyyyy").fo..(new Date())

[MSG]Created an instance of SimpleDateFormat without specifying a Locale

➥ Console.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod297

[SRC]void focusLost(java.awt.event.FocusEvent e){}

[MSG]The method focusLost is both empty and not marked with @Override

➥ Help_.groovy

Rule NamePriorityLine #Source Line / Message
NestedBlockDepth2116

[SRC]if (!helpFile.exists()) {

[MSG]The nested block depth is 6

UnusedVariable270

[SRC]def helpText = ""

[MSG]The variable [helpText] is not used

UnnecessaryCollectCall268

[SRC]def scripts = pluginSettings.availableScripts.collect { it.file }

[MSG]The call to collect could probably be rewritten as a spread expression: pluginSettings.availableScripts*.file

UnnecessaryGetter2112

[SRC]grails ${scriptName} -- ${getDefaultDescription()}

[MSG]getDefaultDescription() can probably be rewritten as defaultDescription

UnnecessaryGetter255

[SRC]String scriptname = script.getName()

[MSG]getName() can probably be rewritten as name

➥ Init.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [69.2]

➥ IntegrateWith.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [72.8]

UnnecessaryObjectReferences288

[SRC]ant.copy(todir:basedir) {

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences291

[SRC]ant.move(file: "${basedir}/ideaGrailsProject.iml", tofil..write: true)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences292

[SRC]ant.move(file: "${basedir}/ideaGrailsProject.ipr", tofil..write: true)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences293

[SRC]ant.move(file: "${basedir}/ideaGrailsProject.iws", tofil..write: true)

[MSG]The code could be more concise by using a with() or identity() block

➥ ListPluginUpdates.groovy

Rule NamePriorityLine #Source Line / Message
NestedBlockDepth234

[SRC]plugin.'release'.each {

[MSG]The nested block depth is 6

NestedBlockDepth235

[SRC]if (!"${it.'@version'}".endsWith("SNAPSHOT") && "${it.'@..> version) {

[MSG]The nested block depth is 7

UnnecessaryGetter261

[SRC]def availablePluginVersions = getAvailablePluginVersions()

[MSG]getAvailablePluginVersions() can probably be rewritten as availablePluginVersions

UnnecessaryGetter262

[SRC]def installedPluginVersions = getInstalledPluginVersions()

[MSG]getInstalledPluginVersions() can probably be rewritten as installedPluginVersions

➥ ReleasePlugin.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2705

[SRC]catch (SVNException e) {

[MSG]The catch block is empty

EmptyCatchBlock2710

[SRC]catch (SVNException e) {

[MSG]The catch block is empty

EmptyCatchBlock2715

[SRC]catch (SVNException e) {

[MSG]The catch block is empty

EmptyCatchBlock2419

[SRC]catch (SVNException e) {

[MSG]The catch block is empty

EmptyCatchBlock2445

[SRC]catch (e) {

[MSG]The catch block is empty

EmptyCatchBlock2530

[SRC]catch (e) {

[MSG]The catch block is empty

EmptyCatchBlock2918

[SRC]catch(e) {

[MSG]The catch block is empty

InvertedIfElse2753

[SRC]if (!pluginsListFile.exists()) {

[MSG]Testing the negative condition first can make an if statement confusing

InvertedIfElse2506

[SRC]if (!pluginMetaDir.exists()) {

[MSG]Testing the negative condition first can make an if statement confusing

AddEmptyString2180

[SRC]ant.antProject.setNewProperty usr, ""+tokenizeUrl[KEY_USER_NAME]

[MSG]Concatenating an empty string is an inefficient way to convert an object to a String. Consider using toString() or String.valueOf(Object)

AssignmentInConditional2809

[SRC]while (line = reader.readLine()) {

[MSG]Assignment used as conditional value, which always results in true. Use the == operator instead

AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [333.6]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [80]

NestedBlockDepth2362

[SRC]if (notInRepository) {

[MSG]The nested block depth is 6

NestedBlockDepth2365

[SRC]else {

[MSG]The nested block depth is 6

NestedBlockDepth2784

[SRC]if (remoteRevision > localRevision) {

[MSG]The nested block depth is 6

NestedBlockDepth2788

[SRC]repo.getDir('', -1,null,(Collection)null).each() { entry ->

[MSG]The nested block depth is 7

NestedBlockDepth2790

[SRC]if (entry.name.startsWith(PREFIX)) {

[MSG]The nested block depth is 8

NestedBlockDepth2801

[SRC]line.eachMatch(/Revision (.*):/) {

[MSG]The nested block depth is 6

NestedBlockDepth2804

[SRC]if (remoteRevision > localRevision) {

[MSG]The nested block depth is 6

NestedBlockDepth2809

[SRC]while (line = reader.readLine()) {

[MSG]The nested block depth is 7

NestedBlockDepth2810

[SRC]line.eachMatch(/<li><a href="grails-(.+?)">/) {

[MSG]The nested block depth is 8

UnusedVariable2720

[SRC]def wcClient = new SVNWCClient((ISVNAuthenticationManage..nager, null)

[MSG]The variable [wcClient] is not used

UnusedVariable21001

[SRC]def ver = repo.getFile(file , (long)-1L, props , baos)

[MSG]The variable [ver] is not used

UnusedVariable2176

[SRC]ISVNAuthenticationManager aAuthManager

[MSG]The variable [aAuthManager] is not used

UnusedVariable2503

[SRC]def addClient = new SVNWCClient((ISVNAuthenticationManag..nager, null)

[MSG]The variable [addClient] is not used

UnnecessaryGetter2466

[SRC]remoteRevision = repo.getLatestRevision().toString()

[MSG]getLatestRevision() can probably be rewritten as latestRevision

UnnecessaryGetter2783

[SRC]remoteRevision = repo.getLatestRevision()

[MSG]getLatestRevision() can probably be rewritten as latestRevision

UnnecessaryGetter21047

[SRC]repo.getLatestRevision()

[MSG]getLatestRevision() can probably be rewritten as latestRevision

UnnecessaryGetter21059

[SRC]repo.getLatestRevision()

[MSG]getLatestRevision() can probably be rewritten as latestRevision

UnusedImport335

[SRC]import org.codehaus.groovy.grails.plugins.PluginManagerHolder

UnnecessaryDefInMethodDeclaration3548

[SRC]private def commitNewestPluginList(File pluginMetaDir, S..ortClient) {

[MSG]The def keyword is unneeded when a method is marked private

➥ SchemaExport.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [110.9]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [43]

➥ SetVersion.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse249

[SRC]if (!args) {

[MSG]Testing the negative condition first can make an if statement confusing

➥ Upgrade.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToEqualsMethod2115

[SRC]if (!new File(baseFile, '/grails-app/conf').listFiles()...mplate) }) {

[MSG]Explicit call to it.name.equals(template) method can be rewritten as it.name == (template)

AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [111.8]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [28]

NestedBlockDepth2116

[SRC]copy(tofile: "${basedir}/grails-app/conf/${template}") {

[MSG]The nested block depth is 6

NestedBlockDepth2117

[SRC]fileset(file: "${grailsHome}/src/grails/grails-app/conf/..emplate}") {

[MSG]The nested block depth is 7

NestedBlockDepth2127

[SRC]copy(tofile: "${basedir}/grails-app/conf/${template}") {

[MSG]The nested block depth is 6

NestedBlockDepth2128

[SRC]fileset(file: "${grailsHome}/src/grails/grails-app/conf/..emplate}") {

[MSG]The nested block depth is 7

NestedBlockDepth2140

[SRC]fileset(file: "${grailsHome}/src/grails/grails-app/conf/..emplate}") {

[MSG]The nested block depth is 6

➥ _GrailsArgParsing.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter226

[SRC]if (getBinding().variables.containsKey("_grails_arg_pars..ed")) return

[MSG]getBinding() can probably be rewritten as binding

➥ _GrailsBootstrap.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [81.3]

UnnecessaryGetter2130

[SRC]ClassLoader contextLoader = Thread.currentThread().getCo..lassLoader()

[MSG]getContextClassLoader() can probably be rewritten as contextClassLoader

➥ _GrailsClasspath.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [85.2]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [23]

UnnecessaryGetter230

[SRC]if (getBinding().variables.containsKey("_grails_classpat..ed")) return

[MSG]getBinding() can probably be rewritten as binding

UnnecessaryGetter275

[SRC]jarFiles.addAll(getExtraDependencies())

[MSG]getExtraDependencies() can probably be rewritten as extraDependencies

UnnecessaryGetter292

[SRC]for (jar in getExtraDependencies()) {

[MSG]getExtraDependencies() can probably be rewritten as extraDependencies

UnnecessaryGetter2197

[SRC]def jarFiles = getJarFiles()

[MSG]getJarFiles() can probably be rewritten as jarFiles

➥ _GrailsClean.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryObjectReferences247

[SRC]ant.delete(dir:classesDirPath)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences248

[SRC]ant.delete(dir:pluginClassesDirPath, failonerror:false)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences249

[SRC]ant.delete(dir:resourcesDirPath)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences250

[SRC]ant.delete(dir:testDirPath)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences256

[SRC]ant.delete(failonerror:false, includeemptydirs: true) {

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter226

[SRC]if (getBinding().variables.containsKey("_grails_clean_called")) return

[MSG]getBinding() can probably be rewritten as binding

➥ _GrailsCompile.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [115.0]

➥ _GrailsCreateProject.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse2116

[SRC]if (!argsMap["params"]) {

[MSG]Testing the negative condition first can make an if statement confusing

➥ _GrailsDocs.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [130.1]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [25]

NestedBlockDepth2192

[SRC]foo.${m.name}(${m.arguments?.collect {GrailsNameUtils.ge...join(',')})

[MSG]The nested block depth is 6

NestedBlockDepth2201

[SRC]${m.arguments?.collect { '* @'+GrailsNameUtils.getProper..it)+'@\n' }}

[MSG]The nested block depth is 6

UnnecessaryObjectReferences2216

[SRC]publisher.license = ""

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2217

[SRC]publisher.copyright = ""

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2218

[SRC]publisher.footer = ""

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2219

[SRC]publisher.engineProperties = config?.grails?.doc

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2225

[SRC]publisher.publish()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter2173

[SRC]def context = DocumentationContext.getInstance()

[MSG]getInstance() can probably be rewritten as instance

➥ _GrailsEvents.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter228

[SRC]if (getBinding().variables.containsKey("_grails_events_c..ed")) return

[MSG]getBinding() can probably be rewritten as binding

➥ _GrailsInit.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter231

[SRC]if (getBinding().variables.containsKey("_init_called")) return

[MSG]getBinding() can probably be rewritten as binding

UnusedImport326

[SRC]import grails.util.GrailsNameUtils

UnusedImport325

[SRC]import org.springframework.core.io.FileSystemResource

➥ _GrailsPackage.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse2218

[SRC]if (!webXml.exists()) {

[MSG]Testing the negative condition first can make an if statement confusing

AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [167.6]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [30]

NestedBlockDepth2125

[SRC]i18nPluginDirs.eachParallel { Resource srcDir ->

[MSG]The nested block depth is 6

NestedBlockDepth2126

[SRC]if (srcDir.exists()) {

[MSG]The nested block depth is 7

NestedBlockDepth2131

[SRC]if (info) {

[MSG]The nested block depth is 8

NestedBlockDepth2134

[SRC]try {

[MSG]The nested block depth is 9

NestedBlockDepth2143

[SRC]catch (e) {

[MSG]The nested block depth is 9

UnnecessaryGetter235

[SRC]if (getBinding().variables.containsKey("_grails_package_..ed")) return

[MSG]getBinding() can probably be rewritten as binding

➥ _GrailsPluginDev.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport321

[SRC]import org.apache.commons.io.FilenameUtils

UnusedImport318

[SRC]import grails.util.GrailsNameUtils

UnusedImport324

[SRC]import org.codehaus.groovy.grails.compiler.support.Grail..LoaderHolder

UnusedImport317

[SRC]import groovy.xml.MarkupBuilder

➥ _GrailsPlugins.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [118.7]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [26]

UnnecessaryGetter2167

[SRC]def pluginInfos = pluginSettings.getPluginInfos()

[MSG]getPluginInfos() can probably be rewritten as pluginInfos

➥ _GrailsRun.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [125.2]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [29]

NestedBlockDepth2210

[SRC]if (scriptName) {

[MSG]The nested block depth is 6

NestedBlockDepth2251

[SRC]pluginClassesDir].collect { it.toURI().toURL() }

[MSG]The nested block depth is 6

NestedBlockDepth2259

[SRC]if (usingSecureServer) {

[MSG]The nested block depth is 6

NestedBlockDepth2262

[SRC]else {

[MSG]The nested block depth is 6

UnnecessaryGetter2124

[SRC]grails.util.Metadata.getCurrent().put(grails.util.Metada..YED, "true")

[MSG]getCurrent() can probably be rewritten as current

➥ _GrailsSettings.groovy

Rule NamePriorityLine #Source Line / Message
ReturnsNullInsteadOfEmptyArray240

[SRC]if (getBinding().variables.containsKey("_settings_called")) return

[MSG]Returning null from a method that might return an Array

AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [146.0]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [26]

UnnecessaryGetter240

[SRC]if (getBinding().variables.containsKey("_settings_called")) return

[MSG]getBinding() can probably be rewritten as binding

UnnecessaryGetter2104

[SRC]grailsAppName = metadata.getApplicationName()

[MSG]getApplicationName() can probably be rewritten as applicationName

UnnecessaryGetter2105

[SRC]grailsAppVersion = metadata.getApplicationVersion()

[MSG]getApplicationVersion() can probably be rewritten as applicationVersion

UnnecessaryGetter2106

[SRC]appGrailsVersion = metadata.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2107

[SRC]servletVersion = metadata.getServletVersion() ?: servletVersion

[MSG]getServletVersion() can probably be rewritten as servletVersion

UnnecessaryGetter2107

[SRC]servletVersion = metadata.getServletVersion() ?: servletVersion

[MSG]getServletVersion() can probably be rewritten as servletVersion

UnnecessaryGetter2138

[SRC]if (grailsSettings.defaultEnv && getBinding().variables...riptEnv")) {

[MSG]getBinding() can probably be rewritten as binding

UnnecessaryGetter2148

[SRC]if (getBinding().variables.containsKey("scriptScope")) {

[MSG]getBinding() can probably be rewritten as binding

➥ _GrailsTest.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [195.8]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [41]

NestedBlockDepth2137

[SRC]if (phaseName == 'integration') {

[MSG]The nested block depth is 6

NestedBlockDepth2141

[SRC]else {

[MSG]The nested block depth is 6

NestedBlockDepth2163

[SRC]if (type.name in targetTypesForPhase || TEST_TYPE_WILDCA..sForPhase) {

[MSG]The nested block depth is 6

UnnecessaryGetter2123

[SRC]if (reRunTests) testNames = getFailedTests()

[MSG]getFailedTests() can probably be rewritten as failedTests

UnusedImport326

[SRC]import org.codehaus.groovy.grails.test.report.junit.JUni..portsFactory

➥ _GrailsWar.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitHashSetInstantiation2364

[SRC]def addedResources = new HashSet()

[MSG]HashSet objects are better instantiated using the form "[] as HashSet"

ExplicitHashSetInstantiation2395

[SRC]def addedPlugins = new HashSet()

[MSG]HashSet objects are better instantiated using the form "[] as HashSet"

AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [220.8]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [37]

NestedBlockDepth2213

[SRC]for (GrailsPluginInfo info in pluginInfos) {

[MSG]The nested block depth is 6

NestedBlockDepth2214

[SRC]fileset(dir: info.pluginDir.file.path) {

[MSG]The nested block depth is 7

NestedBlockDepth2222

[SRC]freshManager.parseDependencies {}

[MSG]The nested block depth is 6

NestedBlockDepth2225

[SRC]for(File file in freshManager.resolveDependencies("runti..localFile) {

[MSG]The nested block depth is 6

NestedBlockDepth2226

[SRC]if(file) {

[MSG]The nested block depth is 7

UnnecessaryGetter2247

[SRC]attribute(name:"Bundle-Version",value:"${metadata.getApp..Version()}")

[MSG]getApplicationVersion() can probably be rewritten as applicationVersion

UnnecessaryGetter2253

[SRC]switch (metadata.getServletVersion()) {

[MSG]getServletVersion() can probably be rewritten as servletVersion

UnnecessaryGetter2286

[SRC]attribute(name:"Implementation-Version",value:"${metadat..Version()}")

[MSG]getApplicationVersion() can probably be rewritten as applicationVersion

UnnecessaryGetter2287

[SRC]attribute(name:"Grails-Version",value:"${metadata.getGra..Version()}")

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2313

[SRC]def resourceList = pluginSettings.getArtefactResources()

[MSG]getArtefactResources() can probably be rewritten as artefactResources

UnnecessaryGetter2353

[SRC]def resourceList = ps.getArtefactResources()

[MSG]getArtefactResources() can probably be rewritten as artefactResources

UnnecessaryGetter2520

[SRC]def version = metadata.getApplicationVersion()

[MSG]getApplicationVersion() can probably be rewritten as applicationVersion

UnnecessaryDefInMethodDeclaration3358

[SRC]protected def createDescriptorInternal(pluginInfos, resourceList) {

[MSG]The def keyword is unneeded when a method is marked protected

UnnecessaryDefInMethodDeclaration3418

[SRC]private def warPluginsInternal(pluginInfos) {

[MSG]The def keyword is unneeded when a method is marked private

UnnecessaryDefInMethodDeclaration3428

[SRC]private def warPluginForPluginInfo(GrailsPluginInfo info) {

[MSG]The def keyword is unneeded when a method is marked private

➥ _PackagePlugins.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter271

[SRC]def pluginInfos = pluginSettings.getSupportedPluginInfos()

[MSG]getSupportedPluginInfos() can probably be rewritten as supportedPluginInfos

UnnecessaryGetter288

[SRC]def pluginInfos = pluginSettings.getSupportedPluginInfos()

[MSG]getSupportedPluginInfos() can probably be rewritten as supportedPluginInfos

➥ _PluginDependencies.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2450

[SRC]catch (e) {

[MSG]The catch block is empty

ExplicitCallToCompareToMethod2163

[SRC]def rcComparator = [ compare: {a, b -> a.URI.compareTo(b..s Comparator

[MSG]Explicit call to a.URI.compareTo(b.URI) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

InvertedIfElse2229

[SRC]if (!PluginManagerHolder.pluginManager) { // plugin mana..eady loaded?

[MSG]Testing the negative condition first can make an if statement confusing

AbcComplexity2

[SRC]true

[MSG]The ABC score for method [run] is [240.9]

CyclomaticComplexity2

[SRC]true

[MSG]The cyclomatic complexity for method [run] is [52]

NestedBlockDepth298

[SRC]for (File dir in pluginResources.file) {

[MSG]The nested block depth is 6

NestedBlockDepth299

[SRC]if (dir.exists() && dir.isDirectory()) {

[MSG]The nested block depth is 7

NestedBlockDepth2186

[SRC]for (d in pluginProps.dependsOn) {

[MSG]The nested block depth is 6

NestedBlockDepth2195

[SRC]for (DocumentedMethod m in docContext.methods) {

[MSG]The nested block depth is 6

NestedBlockDepth2196

[SRC]method(name:m.name, artefact:m.artefact, type:m.type?.name) {

[MSG]The nested block depth is 7

NestedBlockDepth2198

[SRC]if (m.arguments) {

[MSG]The nested block depth is 8

NestedBlockDepth2199

[SRC]for (arg in m.arguments) {

[MSG]The nested block depth is 9

NestedBlockDepth2205

[SRC]for (DocumentedMethod m in docContext.staticMethods) {

[MSG]The nested block depth is 6

NestedBlockDepth2206

[SRC]'static-method'(name:m.name, artefact:m.artefact, type:m.type?.name) {

[MSG]The nested block depth is 7

NestedBlockDepth2208

[SRC]if (m.arguments) {

[MSG]The nested block depth is 8

NestedBlockDepth2209

[SRC]for (arg in m.arguments) {

[MSG]The nested block depth is 9

NestedBlockDepth2215

[SRC]for (DocumentedProperty p in docContext.properties) {

[MSG]The nested block depth is 6

NestedBlockDepth2216

[SRC]property(name:p.name, type:p?.type?.name, artefact:p.artefact) {

[MSG]The nested block depth is 7

NestedBlockDepth2258

[SRC]if (grailsApp == null) {

[MSG]The nested block depth is 6

NestedBlockDepth2275

[SRC]if (plugin) {

[MSG]The nested block depth is 6

NestedBlockDepth2281

[SRC]for (p in pluginManager.failedLoadPlugins) {

[MSG]The nested block depth is 6

NestedBlockDepth2284

[SRC]for(depName in p.dependencyNames) {

[MSG]The nested block depth is 7

UnusedVariable2249

[SRC]def application

[MSG]The variable [application] is not used

UnnecessaryObjectReferences2456

[SRC]pluginInstallEngine.pluginDirVariableStore = binding

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2457

[SRC]pluginInstallEngine.pluginScriptRunner = runPluginScript

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter249

[SRC]if (getBinding().variables.containsKey("_plugin_dependen..ed")) return

[MSG]getBinding() can probably be rewritten as binding

UnusedImport320

[SRC]import grails.util.PluginBuildSettings

UnusedImport317

[SRC]import grails.util.BuildSettings

Package: src.java.grails.doc

➥ DocEngine.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2128

[SRC]catch (e) {

[MSG]The catch block is empty

UnnecessaryGetter2137

[SRC]def props = DocEngine.getDefaultProps()

[MSG]getDefaultProps() can probably be rewritten as defaultProps

UnnecessaryGetter2178

[SRC]def repository = filter.getMacroRepository()

[MSG]getMacroRepository() can probably be rewritten as macroRepository

➥ DocPublisher.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToCompareToMethod2154

[SRC]result = nums1[i].compareTo(nums2[i])

[MSG]Explicit call to nums1[i].compareTo(nums2[i]) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

AbcComplexity288

[SRC]void publish() {

[MSG]The ABC score for method [publish] is [204.5]

CyclomaticComplexity288

[SRC]void publish() {

[MSG]The cyclomatic complexity for method [publish] is [26]

UnnecessaryGetter281

[SRC]def props = DocEngine.getDefaultProps()

[MSG]getDefaultProps() can probably be rewritten as defaultProps

UnnecessaryGetter2353

[SRC]URL url = getClass().getClassLoader().getResource(src)

[MSG]getClassLoader() can probably be rewritten as classLoader

MethodSize388

[MSG]Method "publish" is 227 lines

➥ PdfBuilder.groovy

Rule NamePriorityLine #Source Line / Message
UnusedPrivateField225

[SRC]private static final String LIVE_DOC_SITE = 'http://grails.org'

[MSG]The field LIVE_DOC_SITE is not used within PdfBuilder.groovy

UnnecessaryGetter279

[SRC]Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()))

[MSG]getBytes() can probably be rewritten as bytes

Package: src.java.grails.doc.ant

➥ DocPublisherTask.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryObjectReferences270

[SRC]publisher.images = imagesDir

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences277

[SRC]publisher.workDir = workDir

[MSG]The code could be more concise by using a with() or identity() block

Package: src.java.grails.doc.filters

➥ HeaderFilter.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport317

[SRC]import org.radeox.filter.regex.RegexFilter

➥ LinkTestFilter.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable254

[SRC]Writer writer = new StringBufferWriter(buffer)

[MSG]The variable [writer] is not used

UnnecessaryGetter248

[SRC]def engine = context.getRenderContext().getRenderEngine()

[MSG]getRenderEngine() can probably be rewritten as renderEngine

UnnecessaryGetter248

[SRC]def engine = context.getRenderContext().getRenderEngine()

[MSG]getRenderContext() can probably be rewritten as renderContext

UnnecessaryGetter2106

[SRC]context.getRenderContext().setCacheable(false)

[MSG]getRenderContext() can probably be rewritten as renderContext

UnusedImport322

[SRC]import org.radeox.filter.interwiki.InterWiki

Package: src.java.grails.spring

➥ DynamicElementReader.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToEqualsMethod286

[SRC]if (name.equals("doCall")) {

[MSG]Explicit call to name.equals(doCall) method can be rewritten as name == (doCall)

EmptyMethod275

[SRC]protected void afterInvocation() {

[MSG]The method afterInvocation is both empty and not marked with @Override

UnnecessaryGetter253

[SRC]EntityResolver entityResolver = new DelegatingEntityReso..assLoader())

[MSG]getClassLoader() can probably be rewritten as classLoader

UnnecessaryGetter253

[SRC]EntityResolver entityResolver = new DelegatingEntityReso..assLoader())

[MSG]getClassLoader() can probably be rewritten as classLoader

UnnecessaryGetter2121

[SRC]Element element = documentLoader.loadDocument(is, entity..entElement()

[MSG]getDocumentElement() can probably be rewritten as documentElement

UnnecessaryGetter2126

[SRC]BeanDefinitionHolder holder = new BeanDefinitionHolder(b..n.getName())

[MSG]getBeanDefinition() can probably be rewritten as beanDefinition

UnnecessaryGetter2126

[SRC]BeanDefinitionHolder holder = new BeanDefinitionHolder(b..n.getName())

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2128

[SRC]beanConfiguration.setBeanDefinition(holder.getBeanDefinition())

[MSG]getBeanDefinition() can probably be rewritten as beanDefinition

Package: src.java.grails.test

➥ AbstractCliTestCase.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2127

[SRC]catch (InterruptedException ex) {

[MSG]The catch block is empty

JUnitPublicNonTestMethod279

[SRC]String getOutput() {

[MSG]The method getOutput is public but not a test method

JUnitPublicNonTestMethod283

[SRC]void setOutput(String output) {

[MSG]The method setOutput is public but not a test method

JUnitPublicNonTestMethod291

[SRC]File getWorkDir() {

[MSG]The method getWorkDir is public but not a test method

JUnitPublicNonTestMethod295

[SRC]void setWorkDir(File dir) {

[MSG]The method setWorkDir is public but not a test method

JUnitPublicNonTestMethod2105

[SRC]void enterInput(String input) {

[MSG]The method enterInput is public but not a test method

JUnitPublicNonTestMethod2115

[SRC]int waitForProcess() {

[MSG]The method waitForProcess is public but not a test method

UnusedPrivateField220

[SRC]private final Condition waiting = lock.newCondition()

[MSG]The field waiting is not used within AbstractCliTestCase.groovy

UnusedVariable2117

[SRC]final monitor = "monitor"

[MSG]The variable [monitor] is not used

➥ ControllerUnitTestCase.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod258

[SRC]Class getControllerClass() {

[MSG]The method getControllerClass is public but not a test method

➥ GrailsMock.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryDefInMethodDeclaration3170

[SRC]def invokeMethod(String methodName, Object args) {

[MSG]The def keyword is unneeded when a method returns the Object type

➥ GrailsUrlMappingsTestCase.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod255

[SRC]def createMappingsHolder() {

[MSG]The method createMappingsHolder is public but not a test method

JUnitPublicNonTestMethod263

[SRC]def createControllerMap() {

[MSG]The method createControllerMap is public but not a test method

JUnitPublicNonTestMethod271

[SRC]def getUrlMappingEvaluatees() {

[MSG]The method getUrlMappingEvaluatees is public but not a test method

JUnitPublicNonTestMethod295

[SRC]def getActions(controller) {

[MSG]The method getActions is public but not a test method

JUnitPublicNonTestMethod2104

[SRC]def getDefaultAction(controllerName) {

[MSG]The method getDefaultAction is public but not a test method

JUnitPublicNonTestMethod2109

[SRC]def assertController(controller, url) {

[MSG]The method assertController is public but not a test method

JUnitPublicNonTestMethod2115

[SRC]def assertAction(controller, action, url) {

[MSG]The method assertAction is public but not a test method

JUnitPublicNonTestMethod2121

[SRC]def assertView(controller, view, url) {

[MSG]The method assertView is public but not a test method

JUnitPublicNonTestMethod2130

[SRC]void assertUrlMapping(assertions, url) {

[MSG]The method assertUrlMapping is public but not a test method

JUnitPublicNonTestMethod2134

[SRC]void assertUrlMapping(assertions, url, paramAssertions) {

[MSG]The method assertUrlMapping is public but not a test method

JUnitPublicNonTestMethod2141

[SRC]void assertForwardUrlMapping(assertions, url) {

[MSG]The method assertForwardUrlMapping is public but not a test method

JUnitPublicNonTestMethod2145

[SRC]void assertForwardUrlMapping(assertions, url, paramAssertions) {

[MSG]The method assertForwardUrlMapping is public but not a test method

JUnitPublicNonTestMethod2199

[SRC]void assertReverseUrlMapping(assertions, url) {

[MSG]The method assertReverseUrlMapping is public but not a test method

JUnitPublicNonTestMethod2203

[SRC]void assertReverseUrlMapping(assertions, url, paramAssertions) {

[MSG]The method assertReverseUrlMapping is public but not a test method

JUnitSetUpCallsSuper284

[SRC]void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper291

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

DuplicateImport336

[SRC]import org.codehaus.groovy.grails.commons.GrailsClassUtils

UnusedImport323

[SRC]import org.codehaus.groovy.grails.plugins.web.ControllersGrailsPlugin

UnusedImport321

[SRC]import org.codehaus.groovy.grails.commons.GrailsApplication

UnusedImport320

[SRC]import org.codehaus.groovy.grails.commons.DefaultGrailsApplication

UnusedImport332

[SRC]import org.springframework.web.servlet.DispatcherServlet

UnusedImport334

[SRC]import org.springframework.web.context.ServletContextAware

UnusedImport318

[SRC]import grails.util.GrailsWebUtil

UnusedImport330

[SRC]import org.springframework.web.context.WebApplicationContext

UnusedImport328

[SRC]import org.codehaus.groovy.grails.web.multipart.ContentL..partResolver

UnusedImport324

[SRC]import org.codehaus.groovy.grails.plugins.web.mapping.Ur..GrailsPlugin

UnusedImport335

[SRC]import javax.servlet.ServletContext

UnusedImport325

[SRC]import org.codehaus.groovy.grails.support.MockApplicationContext

➥ GroovyPagesTestCase.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod237

[SRC]void setControllerName(String name) {

[MSG]The method setControllerName is public but not a test method

JUnitPublicNonTestMethod249

[SRC]void assertOutputEquals(expected, template, params = [:]..tring() }) {

[MSG]The method assertOutputEquals is public but not a test method

JUnitPublicNonTestMethod261

[SRC]String applyTemplate(template, params = [:]) {

[MSG]The method applyTemplate is public but not a test method

JUnitPublicNonTestMethod267

[SRC]void applyTemplate(StringWriter sw, template, params = [:]) {

[MSG]The method applyTemplate is public but not a test method

➥ MockUtils.groovy

Rule NamePriorityLine #Source Line / Message
ReturnsNullInsteadOfEmptyCollection2628

[SRC]return result ? result[0] : null

[MSG]Returning null from a method that might return a Collection or Map

ExplicitCallToEqualsMethod21278

[SRC]if (value instanceof Number && Long.class.equals(targetType)) {

[MSG]Explicit call to Long.class.equals(targetType) method can be rewritten as Long.class == (targetType)

ExplicitLinkedListInstantiation2916

[SRC]LinkedList classChain = new LinkedList()

[MSG]LinkedList objects are better instantiated using the form "[] as LinkedList"

InvertedIfElse2153

[SRC]if (!delegate.request.invalidToken) {

[MSG]Testing the negative condition first can make an if statement confusing

AbcComplexity2101

[SRC]static void mockController(Class clazz) {

[MSG]The ABC score for method [mockController] is [94.2]

AbcComplexity2736

[SRC]private static void addDynamicInstanceMethods(Class claz..Instances) {

[MSG]The ABC score for method [addDynamicInstanceMethods] is [79.3]

AbcComplexity2897

[SRC]private static void addValidateMethod(

[MSG]The ABC score for method [addValidateMethod] is [87.5]

CyclomaticComplexity2736

[SRC]private static void addDynamicInstanceMethods(Class claz..Instances) {

[MSG]The cyclomatic complexity for method [addDynamicInstanceMethods] is [23]

CyclomaticComplexity2897

[SRC]private static void addValidateMethod(

[MSG]The cyclomatic complexity for method [addValidateMethod] is [24]

CyclomaticComplexity21053

[SRC]private static processInstances(instances, property, com..tor, args) {

[MSG]The cyclomatic complexity for method [processInstances] is [26]

MethodCount255

[SRC]class MockUtils {

[MSG]Class grails.test.MockUtils has 35 methods

NestedBlockDepth2837

[SRC]if (clazz.isAssignableFrom(otherCollectionType) && clazz..ctionType) {

[MSG]The nested block depth is 6

NestedBlockDepth2838

[SRC]if (arg."$otherCollectionName" == null) {

[MSG]The nested block depth is 7

NestedBlockDepth2848

[SRC]if (clazz.isAssignableFrom(pd.propertyType)) {

[MSG]The nested block depth is 6

UnusedPrivateMethodParameter2563

[SRC]private static void addDynamicFinders(Class clazz, List ..Instances) {

[MSG]Method parameter [testInstances] is never referenced

UnusedPrivateMethodParameter2651

[SRC]private static void addCountMethods(Class clazz, GrailsD..Instances) {

[MSG]Method parameter [dc] is never referenced

UnusedPrivateMethodParameter2716

[SRC]private static void addOtherStaticMethods(Class clazz, L..Instances) {

[MSG]Method parameter [testInstances] is never referenced

UnnecessaryGetter2311

[SRC]clazz.metaClass.getSession = {-> mockRequest.getSession() }

[MSG]getSession() can probably be rewritten as session

UnnecessaryGetter2919

[SRC]clazz = clazz.getSuperclass()

[MSG]getSuperclass() can probably be rewritten as superclass

UnusedImport343

[SRC]import org.springframework.validation.ObjectError

ClassSize355

[MSG]Class "MockUtils" is 1230 lines

MethodSize3101

[MSG]Method "mockController" is 138 lines

MethodSize3736

[MSG]Method "addDynamicInstanceMethods" is 132 lines

MethodSize3897

[MSG]Method "addValidateMethod" is 151 lines

➥ MvcUnitTestCase.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod282

[SRC]Class getTestClass() {

[MSG]The method getTestClass is public but not a test method

UnusedImport317

[SRC]import grails.util.GrailsNameUtils

➥ TagLibUnitTestCase.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod263

[SRC]Class getTagLibClass() {

[MSG]The method getTagLibClass is public but not a test method

➥ WebFlowTestCase.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod259

[SRC]abstract getFlow()

[MSG]The method getFlow is public but not a test method

JUnitPublicNonTestMethod264

[SRC]String getFlowId() { "test" }

[MSG]The method getFlowId is public but not a test method

JUnitPublicNonTestMethod2101

[SRC]FlowDefinition registerFlow(String flowId, Closure flowClosure) {

[MSG]The method registerFlow is public but not a test method

JUnitPublicNonTestMethod2110

[SRC]FlowDefinition getFlowDefinition() {

[MSG]The method getFlowDefinition is public but not a test method

UnnecessaryGetter268

[SRC]GrailsWebRequest webRequest = RequestContextHolder.getRe..Attributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGetter272

[SRC]mockServletContext = webRequest.getServletContext()

[MSG]getServletContext() can probably be rewritten as servletContext

UnnecessaryGetter273

[SRC]applicationContext = WebApplicationContextUtils.getWebAp..etContext())

[MSG]getServletContext() can probably be rewritten as servletContext

UnnecessaryGetter291

[SRC]flowBuilderServices.expressionParser = DefaultExpression..sionParser()

[MSG]getExpressionParser() can probably be rewritten as expressionParser

UnnecessaryGetter2105

[SRC]FlowAssembler assembler = new FlowAssembler(builder, bui..erContext())

[MSG]getFlowBuilderContext() can probably be rewritten as flowBuilderContext

UnnecessaryGetter2111

[SRC]return registerFlow(getFlowId(), getFlow())

[MSG]getFlowId() can probably be rewritten as flowId

UnnecessaryGetter2111

[SRC]return registerFlow(getFlowId(), getFlow())

[MSG]getFlow() can probably be rewritten as flow

Package: src.java.grails.util

➥ BuildSettings.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse2753

[SRC]if (!dependenciesExternallyConfigured) {

[MSG]Testing the negative condition first can make an if statement confusing

CyclomaticComplexity2855

[SRC]private void establishProjectStructure() {

[MSG]The cyclomatic complexity for method [establishProjectStructure] is [21]

MethodCount243

[SRC]class BuildSettings extends AbstractBuildSettings {

[MSG]Class grails.util.BuildSettings has 56 methods

NestedBlockDepth2707

[SRC]proxySettings[current]?.each { key, value ->

[MSG]The nested block depth is 6

UnnecessaryGetter2727

[SRC]gcl = rootLoader != null ? new GroovyClassLoader(rootLoa..assLoader())

[MSG]getSystemClassLoader() can probably be rewritten as systemClassLoader

UnnecessaryGetter2736

[SRC]def appName = metadata.getApplicationName() ?: "grails"

[MSG]getApplicationName() can probably be rewritten as applicationName

UnnecessaryGetter2736

[SRC]def appName = metadata.getApplicationName() ?: "grails"

[MSG]getApplicationName() can probably be rewritten as applicationName

UnnecessaryGetter2737

[SRC]def appVersion = metadata.getApplicationVersion() ?: grailsVersion

[MSG]getApplicationVersion() can probably be rewritten as applicationVersion

UnnecessaryGetter2737

[SRC]def appVersion = metadata.getApplicationVersion() ?: grailsVersion

[MSG]getApplicationVersion() can probably be rewritten as applicationVersion

UnnecessaryGetter2783

[SRC]def pluginDirs = getPluginDirectories()

[MSG]getPluginDirectories() can probably be rewritten as pluginDirectories

UnnecessaryGetter2850

[SRC]appName:Metadata.current.getApplicationName(),

[MSG]getApplicationName() can probably be rewritten as applicationName

UnnecessaryGetter2851

[SRC]appVersion:Metadata.current.getApplicationVersion())

[MSG]getApplicationVersion() can probably be rewritten as applicationVersion

UnnecessaryGetter2875

[SRC]def version = metadata.getApplicationVersion()

[MSG]getApplicationVersion() can probably be rewritten as applicationVersion

UnnecessaryGetter2876

[SRC]def appName = metadata.getApplicationName() ?: baseDir.name

[MSG]getApplicationName() can probably be rewritten as applicationName

UnnecessaryGetter2876

[SRC]def appName = metadata.getApplicationName() ?: baseDir.name

[MSG]getApplicationName() can probably be rewritten as applicationName

ImportFromSamePackage318

[SRC]import grails.util.Metadata

UnusedImport330

[SRC]import java.util.concurrent.ConcurrentHashMap

UnnecessaryDefInMethodDeclaration3475

[SRC]private def loadBuildPropertiesFromClasspath(Properties buildProps) {

[MSG]The def keyword is unneeded when a method is marked private

➥ GrailsMain.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter224

[SRC]props.load(getClass().getClassLoader().getResourceAsStre..roperties"))

[MSG]getClassLoader() can probably be rewritten as classLoader

➥ PluginBuildSettings.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2130

[SRC]catch (e) {

[MSG]The catch block is empty

MethodCount242

[SRC]class PluginBuildSettings {

[MSG]Class grails.util.PluginBuildSettings has 35 methods

UnnecessaryGetter2119

[SRC]Resource[] pluginDescriptors = getPluginDescriptors()

[MSG]getPluginDescriptors() can probably be rewritten as pluginDescriptors

UnnecessaryGetter2142

[SRC]buildSettings?.isInlinePluginLocation(pluginLocation?.getFile())

[MSG]getFile() can probably be rewritten as file

UnnecessaryGetter2152

[SRC]locations = buildSettings.getInlinePluginDirectories().c..source(it) }

[MSG]getInlinePluginDirectories() can probably be rewritten as inlinePluginDirectories

UnnecessaryGetter2167

[SRC]if (!pluginInfosMap) getPluginInfos() // initialize the infos

[MSG]getPluginInfos() can probably be rewritten as pluginInfos

UnnecessaryGetter2180

[SRC]if (!pluginInfosMap) getPluginInfos() // initialize the infos

[MSG]getPluginInfos() can probably be rewritten as pluginInfos

UnnecessaryGetter2192

[SRC]def pluginDirs = getPluginDirectories()

[MSG]getPluginDirectories() can probably be rewritten as pluginDirectories

UnnecessaryGetter2311

[SRC]getPluginSourceFiles() // initialize cache

[MSG]getPluginSourceFiles() can probably be rewritten as pluginSourceFiles

UnnecessaryGetter2344

[SRC]pluginDirectoryResources = buildSettings.getPluginDirect..s Resource[]

[MSG]getPluginDirectories() can probably be rewritten as pluginDirectories

UnnecessaryGetter2361

[SRC]if (pluginManager == null) return getPluginInfos()

[MSG]getPluginInfos() can probably be rewritten as pluginInfos

UnnecessaryGetter2363

[SRC]def pluginInfos = getPluginInfos().findAll {GrailsPluginInfo info ->

[MSG]getPluginInfos() can probably be rewritten as pluginInfos

UnnecessaryGetter2364

[SRC]GrailsPlugin plugin = pluginManager.getGrailsPlugin(info.getName())

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2378

[SRC]implicitPluginDirectories = buildSettings.getImplicitPlu..source(it) }

[MSG]getImplicitPluginDirectories() can probably be rewritten as implicitPluginDirectories

UnnecessaryGetter2392

[SRC]return buildSettings?.getPluginBaseDirectories() ?: []

[MSG]getPluginBaseDirectories() can probably be rewritten as pluginBaseDirectories

UnnecessaryGetter2392

[SRC]return buildSettings?.getPluginBaseDirectories() ?: []

[MSG]getPluginBaseDirectories() can probably be rewritten as pluginBaseDirectories

UnnecessaryGetter2445

[SRC]def pluginDirs = getPluginDirectories().toList()

[MSG]getPluginDirectories() can probably be rewritten as pluginDirectories

UnnecessaryGetter2581

[SRC]Resource[] pluginDirs = getPluginDirectories()

[MSG]getPluginDirectories() can probably be rewritten as pluginDirectories

UnnecessaryGroovyImport319

[SRC]import java.io.File;

Package: src.java.grails.web

➥ JSONBuilder.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryDefInMethodDeclaration371

[SRC]def invokeMethod(String methodName, Object args) {

[MSG]The def keyword is unneeded when a method returns the Object type

Package: src.java.org.codehaus.groovy.grails.commons.cfg

➥ ConfigurationHelper.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitHashMapInstantiation245

[SRC]Map binding = new HashMap()

[MSG]HashMap objects are better instantiated using the form "[] as HashMap"

UnnecessaryGetter252

[SRC]binding.put(CONFIG_BINDING_APP_NAME, application.getMeta..ATION_NAME))

[MSG]getMetadata() can probably be rewritten as metadata

UnnecessaryGetter253

[SRC]binding.put(CONFIG_BINDING_APP_VERSION, application.getM..ON_VERSION))

[MSG]getMetadata() can probably be rewritten as metadata

UnnecessaryGetter258

[SRC]ClassLoader classLoader = application != null ? applicat..lassLoader()

[MSG]getClassLoader() can probably be rewritten as classLoader

UnnecessaryGetter258

[SRC]ClassLoader classLoader = application != null ? applicat..lassLoader()

[MSG]getClassLoader() can probably be rewritten as classLoader

UnnecessaryGetter2147

[SRC]stream = resource.getInputStream()

[MSG]getInputStream() can probably be rewritten as inputStream

➥ MapBasedSmartPropertyOverrideConfigurer.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter245

[SRC]def beans = getBeansConfig()

[MSG]getBeansConfig() can probably be rewritten as beansConfig

Package: src.java.org.codehaus.groovy.grails.commons.metaclass

➥ PropertyExpression.groovy

Rule NamePriorityLine #Source Line / Message
CloneableWithoutClone226

[SRC]class PropertyExpression implements Cloneable {

[MSG]The class org.codehaus.groovy.grails.commons.metaclass.PropertyExpression implements Cloneable but does not define a proper clone() method

Package: src.java.org.codehaus.groovy.grails.compiler

➥ GrailsCompiler.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter282

[SRC]getDestdir().setLastModified(now)

[MSG]getDestdir() can probably be rewritten as destdir

Package: src.java.org.codehaus.groovy.grails.orm.hibernate

➥ GrailsHibernateTransactionManager.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport319

[SRC]import org.hibernate.Session

Package: src.java.org.codehaus.groovy.grails.orm.hibernate.cfg

➥ HibernateMappingBuilder.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2364

[SRC]private handleMethodMissing = { String name, args ->

[MSG]The ABC score for method [handleMethodMissing] is [148.8]

CyclomaticComplexity2364

[SRC]private handleMethodMissing = { String name, args ->

[MSG]The cyclomatic complexity for method [handleMethodMissing] is [44]

UnnecessaryObjectReferences2373

[SRC]property.cascade = namedArgs.cascade ?: property.cascade

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2374

[SRC]property.sort = namedArgs.sort ?: property.sort

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2375

[SRC]property.order = namedArgs.order ?: property.order

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2376

[SRC]property.batchSize = namedArgs.batchSize instanceof Inte..ty.batchSize

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2377

[SRC]property.ignoreNotFound = namedArgs.ignoreNotFound != nu..noreNotFound

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2378

[SRC]property.typeParams = namedArgs.params ?: property.typeParams

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2560

[SRC]column.length = args["length"] ?: -1

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2561

[SRC]column.precision = args["precision"] ?: -1

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2562

[SRC]column.scale = args["scale"] ?: -1

[MSG]The code could be more concise by using a with() or identity() block

➥ HibernateNamedQueriesBuilder.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter2211

[SRC]def preparedClosure = getPreparedCriteriaClosure()

[MSG]getPreparedCriteriaClosure() can probably be rewritten as preparedCriteriaClosure

UnnecessaryGetter2242

[SRC]def previousClosure = previousInChain.getPreparedCriteriaClosure()

[MSG]getPreparedCriteriaClosure() can probably be rewritten as preparedCriteriaClosure

Package: src.java.org.codehaus.groovy.grails.plugins

➥ CodecsGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter232

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter267

[SRC]def encodeMethod = codecClass.getEncodeMethod()

[MSG]getEncodeMethod() can probably be rewritten as encodeMethod

UnnecessaryGetter279

[SRC]def decodeMethod = codecClass.getDecodeMethod()

[MSG]getDecodeMethod() can probably be rewritten as decodeMethod

UnnecessaryGetter232

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter267

[SRC]def encodeMethod = codecClass.getEncodeMethod()

[MSG]getEncodeMethod() can probably be rewritten as encodeMethod

UnnecessaryGetter279

[SRC]def decodeMethod = codecClass.getDecodeMethod()

[MSG]getDecodeMethod() can probably be rewritten as decodeMethod

➥ CoreGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter249

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter289

[SRC]if (getParentCtx()?.containsBean('pluginManager')) {

[MSG]getParentCtx() can probably be rewritten as parentCtx

UnnecessaryGetter299

[SRC]if (!Metadata.getCurrent().isWarDeployed() || Environmen..VELOPMENT) {

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter249

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter289

[SRC]if (getParentCtx()?.containsBean('pluginManager')) {

[MSG]getParentCtx() can probably be rewritten as parentCtx

UnnecessaryGetter299

[SRC]if (!Metadata.getCurrent().isWarDeployed() || Environmen..VELOPMENT) {

[MSG]getCurrent() can probably be rewritten as current

➥ DomainClassGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2174

[SRC]private static addRelationshipManagementMethods(GrailsDo..nClass dc) {

[MSG]The ABC score for method [addRelationshipManagementMethods] is [84.1]

CyclomaticComplexity2174

[SRC]private static addRelationshipManagementMethods(GrailsDo..nClass dc) {

[MSG]The cyclomatic complexity for method [addRelationshipManagementMethods] is [27]

NestedBlockDepth2238

[SRC]if (otherSide.oneToMany || otherSide.manyToMany) {

[MSG]The nested block depth is 6

NestedBlockDepth2240

[SRC]if (!obj[name]) {

[MSG]The nested block depth is 7

NestedBlockDepth2245

[SRC]else {

[MSG]The nested block depth is 6

NestedBlockDepth2254

[SRC]if (prop.bidirectional) {

[MSG]The nested block depth is 6

NestedBlockDepth2255

[SRC]if (prop.manyToMany) {

[MSG]The nested block depth is 7

NestedBlockDepth2259

[SRC]else {

[MSG]The nested block depth is 7

UnnecessaryGetter238

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter238

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2120

[SRC]def attributes = rch.getRequestAttributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGetter2127

[SRC]def attributes = rch.getRequestAttributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGetter2146

[SRC]errors = new BeanPropertyBindingResult( delegate, deleg..).getName())

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2156

[SRC]delegate.setErrors (new BeanPropertyBindingResult(delega...getName()))

[MSG]getName() can probably be rewritten as name

➥ DomainClassPluginSupport.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter240

[SRC]prop.validate(object, object.getProperty(prop.getPropert..localErrors)

[MSG]getPropertyName() can probably be rewritten as propertyName

UnnecessaryGetter245

[SRC]def fieldName = localError.getField()

[MSG]getField() can probably be rewritten as field

➥ GrailsPluginUtils.groovy

Rule NamePriorityLine #Source Line / Message
EqualsAndHashCode2347

[SRC]class VersionComparator implements Comparator {

[MSG]The class org.codehaus.groovy.grails.plugins.VersionComparator defines equals(Object) but not hashCode()

ExplicitCallToCompareToMethod2382

[SRC]result = nums1[i].compareTo(nums2[i])

[MSG]Explicit call to nums1[i].compareTo(nums2[i]) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToEqualsMethod281

[SRC]else if (pluginVersion.equals(trimTag(requiredVersion))) {

[MSG]Explicit call to pluginVersion.equals(this.trimTag(requiredVersion)) method can be rewritten as pluginVersion == (this.trimTag(requiredVersion))

SynchronizedMethod2149

[SRC]static synchronized PluginBuildSettings getPluginBuildSettings() {

[MSG]The method getPluginBuildSettings is synchronized at the method level

SynchronizedMethod2156

[SRC]static synchronized setPluginBuildSettings(PluginBuildSe.. settings) {

[MSG]The method setPluginBuildSettings is synchronized at the method level

SynchronizedMethod2341

[SRC]static synchronized clearCaches() {

[MSG]The method clearCaches is synchronized at the method level

MethodCount232

[SRC]class GrailsPluginUtils {

[MSG]Class org.codehaus.groovy.grails.plugins.GrailsPluginUtils has 40 methods

UnnecessaryGetter2142

[SRC]new PluginBuildSettings(BuildSettingsHolder.settings, Pl..inManager())

[MSG]getPluginManager() can probably be rewritten as pluginManager

UnnecessaryGetter2164

[SRC]return getPluginBuildSettings().getPluginInfos()

[MSG]getPluginInfos() can probably be rewritten as pluginInfos

UnnecessaryGetter2164

[SRC]return getPluginBuildSettings().getPluginInfos()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2174

[SRC]final PluginBuildSettings settings = getPluginBuildSettings()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2178

[SRC]return settings.getSupportedPluginInfos()

[MSG]getSupportedPluginInfos() can probably be rewritten as supportedPluginInfos

UnnecessaryGetter2185

[SRC]getPluginBuildSettings().getPluginBaseDirectories()

[MSG]getPluginBaseDirectories() can probably be rewritten as pluginBaseDirectories

UnnecessaryGetter2185

[SRC]getPluginBuildSettings().getPluginBaseDirectories()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2192

[SRC]getPluginBuildSettings().getPluginBaseDirectories()

[MSG]getPluginBaseDirectories() can probably be rewritten as pluginBaseDirectories

UnnecessaryGetter2192

[SRC]getPluginBuildSettings().getPluginBaseDirectories()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2196

[SRC]getPluginBuildSettings().getPluginDirectories()

[MSG]getPluginDirectories() can probably be rewritten as pluginDirectories

UnnecessaryGetter2196

[SRC]getPluginBuildSettings().getPluginDirectories()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2200

[SRC]getPluginBuildSettings().getPluginDirectories()

[MSG]getPluginDirectories() can probably be rewritten as pluginDirectories

UnnecessaryGetter2200

[SRC]getPluginBuildSettings().getPluginDirectories()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2207

[SRC]getPluginBuildSettings().getImplicitPluginDirectories()

[MSG]getImplicitPluginDirectories() can probably be rewritten as implicitPluginDirectories

UnnecessaryGetter2207

[SRC]getPluginBuildSettings().getImplicitPluginDirectories()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2211

[SRC]getPluginBuildSettings().isGlobalPluginLocation(pluginDir)

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2218

[SRC]getPluginBuildSettings().getArtefactResources()

[MSG]getArtefactResources() can probably be rewritten as artefactResources

UnnecessaryGetter2218

[SRC]getPluginBuildSettings().getArtefactResources()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2225

[SRC]getPluginBuildSettings().getArtefactResourcesForOne(projectDir)

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2232

[SRC]getPluginBuildSettings().getPluginXmlMetadata()

[MSG]getPluginXmlMetadata() can probably be rewritten as pluginXmlMetadata

UnnecessaryGetter2232

[SRC]getPluginBuildSettings().getPluginXmlMetadata()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2239

[SRC]getPluginBuildSettings().getAvailableScripts()

[MSG]getAvailableScripts() can probably be rewritten as availableScripts

UnnecessaryGetter2239

[SRC]getPluginBuildSettings().getAvailableScripts()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2246

[SRC]getPluginBuildSettings().getPluginScripts()

[MSG]getPluginScripts() can probably be rewritten as pluginScripts

UnnecessaryGetter2246

[SRC]getPluginBuildSettings().getPluginScripts()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2253

[SRC]getPluginBuildSettings().getPluginResourceBundles()

[MSG]getPluginResourceBundles() can probably be rewritten as pluginResourceBundles

UnnecessaryGetter2253

[SRC]getPluginBuildSettings().getPluginResourceBundles()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2260

[SRC]getPluginBuildSettings().getPluginSourceFiles()

[MSG]getPluginSourceFiles() can probably be rewritten as pluginSourceFiles

UnnecessaryGetter2260

[SRC]getPluginBuildSettings().getPluginSourceFiles()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2267

[SRC]getPluginBuildSettings().getPluginJarFiles()

[MSG]getPluginJarFiles() can probably be rewritten as pluginJarFiles

UnnecessaryGetter2267

[SRC]getPluginBuildSettings().getPluginJarFiles()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2274

[SRC]getPluginBuildSettings().getPluginDescriptors()

[MSG]getPluginDescriptors() can probably be rewritten as pluginDescriptors

UnnecessaryGetter2274

[SRC]getPluginBuildSettings().getPluginDescriptors()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2278

[SRC]getPluginBuildSettings().getBasePluginDescriptor(basedir)

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2286

[SRC]getPluginBuildSettings().getDescriptorForPlugin(pluginDir)

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2293

[SRC]getPluginBuildSettings().getPluginLibDirectories()

[MSG]getPluginLibDirectories() can probably be rewritten as pluginLibDirectories

UnnecessaryGetter2293

[SRC]getPluginBuildSettings().getPluginLibDirectories()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2300

[SRC]getPluginBuildSettings().getPluginI18nDirectories()

[MSG]getPluginI18nDirectories() can probably be rewritten as pluginI18nDirectories

UnnecessaryGetter2300

[SRC]getPluginBuildSettings().getPluginI18nDirectories()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2307

[SRC]getPluginBuildSettings().getGlobalPluginsPath()

[MSG]getGlobalPluginsPath() can probably be rewritten as globalPluginsPath

UnnecessaryGetter2307

[SRC]getPluginBuildSettings().getGlobalPluginsPath()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2314

[SRC]getPluginBuildSettings().getPluginDirForName(pluginName)

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2321

[SRC]getPluginBuildSettings().getMetadataForPlugin(pluginName)

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2328

[SRC]getPluginBuildSettings().getMetadataForPlugin(pluginDir)

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2335

[SRC]getPluginBuildSettings().getPluginDirForName(pluginName)

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

UnnecessaryGetter2342

[SRC]getPluginBuildSettings().clearCache()

[MSG]getPluginBuildSettings() can probably be rewritten as pluginBuildSettings

➥ LoggingGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter235

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter235

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

➥ PluginInfo.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock243

[SRC]catch(e) {

[MSG]The catch block is empty

UnnecessaryGetter255

[SRC]input = pluginXml.getInputStream()

[MSG]getInputStream() can probably be rewritten as inputStream

UnnecessaryGetter296

[SRC]"${getName()}-${getVersion()}"

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter296

[SRC]"${getName()}-${getVersion()}"

[MSG]getVersion() can probably be rewritten as version

UnnecessaryGetter2100

[SRC][name:getName(), version:getVersion()]

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2100

[SRC][name:getName(), version:getVersion()]

[MSG]getVersion() can probably be rewritten as version

➥ ValidationGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter234

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter234

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter274

[SRC]def attributes = rch.getRequestAttributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGetter281

[SRC]def attributes = rch.getRequestAttributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGetter2100

[SRC]errors = new BeanPropertyBindingResult(delegate, delegat..).getName())

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2110

[SRC]delegate.setErrors(new BeanPropertyBindingResult(delegat...getName()))

[MSG]getName() can probably be rewritten as name

ImportFromSamePackage322

[SRC]import org.codehaus.groovy.grails.plugins.DomainClassPluginSupport

Package: src.java.org.codehaus.groovy.grails.plugins.codecs

➥ Base64Codec.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter249

[SRC]return Base64.decodeBase64(theTarget.toString().getBytes())

[MSG]getBytes() can probably be rewritten as bytes

UnnecessaryGetter249

[SRC]return Base64.decodeBase64(theTarget.toString().getBytes())

[MSG]getBytes() can probably be rewritten as bytes

UnusedImport318

[SRC]import org.codehaus.groovy.runtime.DefaultGroovyMethods

➥ HexCodec.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse251

[SRC]if (!(idx % 2)) {

[MSG]Testing the negative condition first can make an if statement confusing

InvertedIfElse251

[SRC]if (!(idx % 2)) {

[MSG]Testing the negative condition first can make an if statement confusing

➥ SHA256Codec.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport318

[SRC]import java.security.MessageDigest

➥ URLCodec.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter230

[SRC]URLEncoder.encode(obj.toString(), URLCodec.getEncoding())

[MSG]getEncoding() can probably be rewritten as encoding

UnnecessaryGetter234

[SRC]URLDecoder.decode(obj.toString(), URLCodec.getEncoding())

[MSG]getEncoding() can probably be rewritten as encoding

UnnecessaryGetter230

[SRC]URLEncoder.encode(obj.toString(), URLCodec.getEncoding())

[MSG]getEncoding() can probably be rewritten as encoding

UnnecessaryGetter234

[SRC]URLDecoder.decode(obj.toString(), URLCodec.getEncoding())

[MSG]getEncoding() can probably be rewritten as encoding

UnnecessaryGetter238

[SRC]def request = RequestContextHolder.getRequestAttributes()?.request

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGroovyImport318

[SRC]import java.net.URLEncoder

UnnecessaryGroovyImport319

[SRC]import java.net.URLDecoder

UnnecessaryDefInMethodDeclaration337

[SRC]private static def getEncoding() {

[MSG]The def keyword is unneeded when a method is marked private

Package: src.java.org.codehaus.groovy.grails.plugins.converters

➥ ConvertersGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable2103

[SRC]def json = (value instanceof JSON || value instanceof JS..JSONArray ||

[MSG]The variable [json] is not used

UnnecessaryGetter252

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter264

[SRC]controllers: GrailsUtil.getGrailsVersion(),

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter265

[SRC]domainClass: GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter252

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter264

[SRC]controllers: GrailsUtil.getGrailsVersion(),

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter265

[SRC]domainClass: GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnusedImport336

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest

Package: src.java.org.codehaus.groovy.grails.plugins.datasource

➥ DataSourceGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity249

[SRC]def doWithSpring = {

[MSG]The ABC score for method [doWithSpring] is [71.1]

CyclomaticComplexity249

[SRC]def doWithSpring = {

[MSG]The cyclomatic complexity for method [doWithSpring] is [33]

NestedBlockDepth297

[SRC]if (!codecClass) {

[MSG]The nested block depth is 6

NestedBlockDepth2100

[SRC]if (codecClass) {

[MSG]The nested block depth is 6

NestedBlockDepth2103

[SRC]else {

[MSG]The nested block depth is 6

UnnecessaryGetter244

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter245

[SRC]def dependsOn = [core: GrailsUtil.getGrailsVersion()]

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2174

[SRC]connection = dataSource.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter244

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter245

[SRC]def dependsOn = [core: GrailsUtil.getGrailsVersion()]

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2174

[SRC]connection = dataSource.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter2190

[SRC]Enumeration<Driver> drivers = DriverManager.getDrivers()

[MSG]getDrivers() can probably be rewritten as drivers

UnnecessaryGetter2196

[SRC]log.error("Error deregistering JDBC driver ["+driver+"]:..essage(), e)

[MSG]getMessage() can probably be rewritten as message

Package: src.java.org.codehaus.groovy.grails.plugins.i18n

➥ I18nGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter245

[SRC]String version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter245

[SRC]String version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

Package: src.java.org.codehaus.groovy.grails.plugins.logging

➥ Log4jConfig.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse264

[SRC]if (!appender.name) {

[MSG]Testing the negative condition first can make an if statement confusing

MethodCount245

[SRC]class Log4jConfig {

[MSG]Class org.codehaus.groovy.grails.plugins.logging.Log4jConfig has 34 methods

UnnecessaryObjectReferences2306

[SRC]eachLogger(packages) { Logger logger -> logger.level = Level.DEBUG }

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2310

[SRC]eachLogger(packages) { logger -> logger.level = Level.TRACE }

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2314

[SRC]eachLogger(packages) { logger -> logger.level = Level.ALL }

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter2125

[SRC]Logger root = Logger.getRootLogger()

[MSG]getRootLogger() can probably be rewritten as rootLogger

UnnecessaryGetter2169

[SRC]BuildSettings settings = BuildSettingsHolder.getSettings()

[MSG]getSettings() can probably be rewritten as settings

UnnecessaryGetter2170

[SRC]def targetDir = settings?.getProjectTargetDir()

[MSG]getProjectTargetDir() can probably be rewritten as projectTargetDir

UnnecessaryGetter2183

[SRC]def root = Logger.getRootLogger()

[MSG]getRootLogger() can probably be rewritten as rootLogger

UnnecessaryGetter2263

[SRC]LogLog.error "Appender $appender not found configuring l...getName()}"

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2318

[SRC]Logger.getRootLogger().removeAppender name

[MSG]getRootLogger() can probably be rewritten as rootLogger

UnusedImport335

[SRC]import org.apache.log4j.net.SMTPAppender

UnusedImport321

[SRC]import grails.util.GrailsUtil

Package: src.java.org.codehaus.groovy.grails.plugins.orm.hibernate

➥ HibernatePluginSupport.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock21004

[SRC]} catch (TypeMismatchException e) {

[MSG]The catch block is empty

EmptyCatchBlock21035

[SRC]} catch (FileNotFoundException fnfe) {

[MSG]The catch block is empty

ThrowExceptionFromFinallyBlock2978

[SRC]throw e

[MSG]Throwing an exception from a finally block can hide an underlieing error

ExplicitCallToEqualsMethod2998

[SRC]if (value instanceof Number && Long.equals(targetType)) {

[MSG]Explicit call to Long.equals(targetType) method can be rewritten as Long == (targetType)

SynchronizedOnThis2461

[SRC]synchronized(this) {

[MSG]The synchronized statement uses the 'this' reference

AbcComplexity2549

[SRC]private static addQueryMethods(GrailsDomainClass dc, Gra..ntext ctx) {

[MSG]The ABC score for method [addQueryMethods] is [215.4]

AbcComplexity2794

[SRC]private static addBasicPersistenceMethods(GrailsDomainCl..ntext ctx) {

[MSG]The ABC score for method [addBasicPersistenceMethods] is [124.5]

AbcComplexity293

[SRC]static doWithSpring = {

[MSG]The ABC score for method [doWithSpring] is [135.3]

CyclomaticComplexity293

[SRC]static doWithSpring = {

[MSG]The cyclomatic complexity for method [doWithSpring] is [40]

UnusedVariable2155

[SRC]def cacheClass = getClass().classLoader.loadClass(cacheProvider)

[MSG]The variable [cacheClass] is not used

UnusedVariable2354

[SRC]MetaClass emc = GroovySystem.metaClassRegistry.getMetaClass(dc.clazz)

[MSG]The variable [emc] is not used

UnusedVariable2497

[SRC]def Class domainClassType = dc.clazz

[MSG]The variable [domainClassType] is not used

UnusedVariable2499

[SRC]ClassLoader classLoader = application.classLoader

[MSG]The variable [classLoader] is not used

UnnecessaryCollectCall2200

[SRC]hibConfigLocations.addAll(explicitLocations.collect { it.toString() })

[MSG]The call to collect could probably be rewritten as a spread expression: explicitLocations*.toString()

UnnecessaryCollectCall2200

[SRC]hibConfigLocations.addAll(explicitLocations.collect { it.toString() })

[MSG]The call to collect could probably be rewritten as a spread expression: explicitLocations*.toString()

UnnecessaryObjectReferences2727

[SRC]findAllMethod.invoke(domainClassType, "findAll", [query,..as Object[])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2731

[SRC]findAllMethod.invoke(domainClassType, "findAll", [query,..as Object[])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2735

[SRC]findAllMethod.invoke(domainClassType, "findAll", [query,..as Object[])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2739

[SRC]findAllMethod.invoke(domainClassType, "findAll", [query,..as Object[])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2743

[SRC]findAllMethod.invoke(domainClassType, "findAll", [query,..as Object[])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2859

[SRC]metaClass.attach = {->template.lock(delegate, LockMode.N..; delegate }

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2860

[SRC]metaClass.isAttached = {-> template.contains(delegate) }

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter294

[SRC]def factory = new PersistentConstraintFactory(getSpringC..eConstraint)

[MSG]getUnrefreshedApplicationContext() can probably be rewritten as unrefreshedApplicationContext

UnnecessaryGetter294

[SRC]def factory = new PersistentConstraintFactory(getSpringC..eConstraint)

[MSG]getSpringConfig() can probably be rewritten as springConfig

UnnecessaryGetter2255

[SRC]if (getSpringConfig().containsBean("controllerHandlerMappings")) {

[MSG]getSpringConfig() can probably be rewritten as springConfig

UnnecessaryGetter2258

[SRC]if (getSpringConfig().containsBean("annotationHandlerMapping")) {

[MSG]getSpringConfig() can probably be rewritten as springConfig

UnnecessaryGetter294

[SRC]def factory = new PersistentConstraintFactory(getSpringC..eConstraint)

[MSG]getUnrefreshedApplicationContext() can probably be rewritten as unrefreshedApplicationContext

UnnecessaryGetter294

[SRC]def factory = new PersistentConstraintFactory(getSpringC..eConstraint)

[MSG]getSpringConfig() can probably be rewritten as springConfig

UnnecessaryGetter2255

[SRC]if (getSpringConfig().containsBean("controllerHandlerMappings")) {

[MSG]getSpringConfig() can probably be rewritten as springConfig

UnnecessaryGetter2258

[SRC]if (getSpringConfig().containsBean("annotationHandlerMapping")) {

[MSG]getSpringConfig() can probably be rewritten as springConfig

UnnecessarySelfAssignment2183

[SRC]dataSource = dataSource

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2192

[SRC]dataSource = dataSource

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2210

[SRC]hibernateProperties = hibernateProperties

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2213

[SRC]entityInterceptor = entityInterceptor

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2224

[SRC]hibernateEventListeners = hibernateEventListeners

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2228

[SRC]sessionFactory = sessionFactory

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2231

[SRC]sessionFactory = sessionFactory

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2253

[SRC]sessionFactory = sessionFactory

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2183

[SRC]dataSource = dataSource

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2192

[SRC]dataSource = dataSource

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2210

[SRC]hibernateProperties = hibernateProperties

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2213

[SRC]entityInterceptor = entityInterceptor

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2224

[SRC]hibernateEventListeners = hibernateEventListeners

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2228

[SRC]sessionFactory = sessionFactory

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2231

[SRC]sessionFactory = sessionFactory

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2253

[SRC]sessionFactory = sessionFactory

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

MethodSize3549

[MSG]Method "addQueryMethods" is 216 lines

MethodSize3794

[MSG]Method "addBasicPersistenceMethods" is 160 lines

Package: src.java.org.codehaus.groovy.grails.plugins.publishing

➥ DefaultPluginPublisher.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter2137

[SRC]InputStream stream = pluginsListFile.getInputStream()

[MSG]getInputStream() can probably be rewritten as inputStream

UnnecessaryCallForLastElement2116

[SRC]def lastPlugin = allPlugins[allPlugins.size()-1]

[MSG]Unnecessarily complex access of last element. This can be simplified to allPlugins.last() or allPlugins[-1]

Package: src.java.org.codehaus.groovy.grails.plugins.scaffolding

➥ ScaffoldingGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2158

[SRC]catch (Exception e) {

[MSG]The catch block is empty

UnnecessaryGetter240

[SRC]def version = grails.util.GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter259

[SRC]for (PropertyValue pv in beanDef.getPropertyValues().get..lueList()) {

[MSG]getPropertyValueList() can probably be rewritten as propertyValueList

UnnecessaryGetter259

[SRC]for (PropertyValue pv in beanDef.getPropertyValues().get..lueList()) {

[MSG]getPropertyValues() can probably be rewritten as propertyValues

UnnecessaryGetter240

[SRC]def version = grails.util.GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter259

[SRC]for (PropertyValue pv in beanDef.getPropertyValues().get..lueList()) {

[MSG]getPropertyValueList() can probably be rewritten as propertyValueList

UnnecessaryGetter259

[SRC]for (PropertyValue pv in beanDef.getPropertyValues().get..lueList()) {

[MSG]getPropertyValues() can probably be rewritten as propertyValues

Package: src.java.org.codehaus.groovy.grails.plugins.services

➥ ServicesGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter239

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter281

[SRC]"${serviceClass.propertyName}"(serviceClass.getClazz()) { bean ->

[MSG]getClazz() can probably be rewritten as clazz

UnnecessaryGetter2140

[SRC]"$serviceName"(serviceClass.getClazz()) { bean ->

[MSG]getClazz() can probably be rewritten as clazz

UnnecessaryGetter239

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter281

[SRC]"${serviceClass.propertyName}"(serviceClass.getClazz()) { bean ->

[MSG]getClazz() can probably be rewritten as clazz

UnnecessaryGetter2140

[SRC]"$serviceName"(serviceClass.getClazz()) { bean ->

[MSG]getClazz() can probably be rewritten as clazz

Package: src.java.org.codehaus.groovy.grails.plugins.support

➥ GrailsPluginUtils.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter213

[SRC]return GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

Package: src.java.org.codehaus.groovy.grails.plugins.testing

➥ GrailsMockErrors.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport318

[SRC]import org.codehaus.groovy.grails.commons.GrailsClassUtils

Package: src.java.org.codehaus.groovy.grails.plugins.web

➥ ControllersGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2241

[SRC]def registerControllerMethods(MetaClass mc, ApplicationContext ctx) {

[MSG]The ABC score for method [registerControllerMethods] is [81.5]

UnusedVariable2111

[SRC]def basedir = System.getProperty("base.dir")

[MSG]The variable [basedir] is not used

UnusedVariable2192

[SRC]def registry = GroovySystem.getMetaClassRegistry()

[MSG]The variable [registry] is not used

UnnecessaryObjectReferences2255

[SRC]mc.getErrors = { ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2258

[SRC]mc.setModelAndView = { ModelAndView mav ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2261

[SRC]mc.getModelAndView = { ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2264

[SRC]mc.getChainModel = { ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2267

[SRC]mc.hasErrors = { ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2292

[SRC]mc.render = {Closure c ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2295

[SRC]mc.render = {Map args, Closure c ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2299

[SRC]mc.bindData = {Object target, Object args ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2302

[SRC]mc.bindData = {Object target, Object args, List disallowed ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2305

[SRC]mc.bindData = {Object target, Object args, List disallow..ng filter ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2308

[SRC]mc.bindData = {Object target, Object args, Map includeExclude ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2311

[SRC]mc.bindData = {Object target, Object args, Map includeEx..ng filter ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2314

[SRC]mc.bindData = {Object target, Object args, String filter ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2315

[SRC]bind.invoke(delegate, "bindData", [target, args, filter] as Object[])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter265

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2112

[SRC]def grailsEnv = GrailsUtil.getEnvironment()

[MSG]getEnvironment() can probably be rewritten as environment

UnnecessaryGetter2189

[SRC]ctx.getAutowireCapableBeanFactory().addBeanPostProcessor..cessor(ctx))

[MSG]getAutowireCapableBeanFactory() can probably be rewritten as autowireCapableBeanFactory

UnnecessaryGetter2192

[SRC]def registry = GroovySystem.getMetaClassRegistry()

[MSG]getMetaClassRegistry() can probably be rewritten as metaClassRegistry

UnnecessaryGetter2193

[SRC]GrailsPluginManager pluginManager = getManager()

[MSG]getManager() can probably be rewritten as manager

UnnecessaryGetter2228

[SRC]if (Modifier.isAbstract(superClass.getModifiers())) {

[MSG]getModifiers() can probably be rewritten as modifiers

UnnecessaryGetter265

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2112

[SRC]def grailsEnv = GrailsUtil.getEnvironment()

[MSG]getEnvironment() can probably be rewritten as environment

UnnecessaryGetter2189

[SRC]ctx.getAutowireCapableBeanFactory().addBeanPostProcessor..cessor(ctx))

[MSG]getAutowireCapableBeanFactory() can probably be rewritten as autowireCapableBeanFactory

UnnecessaryGetter2192

[SRC]def registry = GroovySystem.getMetaClassRegistry()

[MSG]getMetaClassRegistry() can probably be rewritten as metaClassRegistry

UnnecessaryGetter2193

[SRC]GrailsPluginManager pluginManager = getManager()

[MSG]getManager() can probably be rewritten as manager

UnnecessaryGetter2228

[SRC]if (Modifier.isAbstract(superClass.getModifiers())) {

[MSG]getModifiers() can probably be rewritten as modifiers

UnnecessaryCallForLastElement2115

[SRC]mappingElement = mappingElement[mappingElement.size() - 1]

[MSG]Unnecessarily complex access of last element. This can be simplified to mappingElement.last() or mappingElement[-1]

UnnecessaryCallForLastElement2127

[SRC]def lastFilter = filters[filters.size() - 1]

[MSG]Unnecessarily complex access of last element. This can be simplified to filters.last() or filters[-1]

UnnecessaryCallForLastElement2128

[SRC]def lastFilterMapping = filterMappings[filterMappings.size() - 1]

[MSG]Unnecessarily complex access of last element. This can be simplified to filterMappings.last() or filterMappings[-1]

UnnecessaryCallForLastElement2115

[SRC]mappingElement = mappingElement[mappingElement.size() - 1]

[MSG]Unnecessarily complex access of last element. This can be simplified to mappingElement.last() or mappingElement[-1]

UnnecessaryCallForLastElement2127

[SRC]def lastFilter = filters[filters.size() - 1]

[MSG]Unnecessarily complex access of last element. This can be simplified to filters.last() or filters[-1]

UnnecessaryCallForLastElement2128

[SRC]def lastFilterMapping = filterMappings[filterMappings.size() - 1]

[MSG]Unnecessarily complex access of last element. This can be simplified to filterMappings.last() or filterMappings[-1]

UnusedImport322

[SRC]import org.codehaus.groovy.grails.commons.GrailsClassUtils as GCU

➥ GroovyPagesGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity286

[SRC]def doWithSpring = {

[MSG]The ABC score for method [doWithSpring] is [64.7]

AbcComplexity2215

[SRC]def doWithDynamicMethods = { ApplicationContext ctx ->

[MSG]The ABC score for method [doWithDynamicMethods] is [76.4]

CyclomaticComplexity2215

[SRC]def doWithDynamicMethods = { ApplicationContext ctx ->

[MSG]The cyclomatic complexity for method [doWithDynamicMethods] is [21]

UnnecessaryObjectReferences2277

[SRC]mc.setOut = {Writer newOut ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2281

[SRC]mc.propertyMissing = { String name ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2301

[SRC]mc.methodMissing = { String name, args ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2277

[SRC]mc.setOut = {Writer newOut ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2281

[SRC]mc.propertyMissing = { String name ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2301

[SRC]mc.methodMissing = { String name, args ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter258

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2220

[SRC]GrailsPluginManager pluginManager = getManager()

[MSG]getManager() can probably be rewritten as manager

UnnecessaryGetter2236

[SRC]if (Modifier.isAbstract(superClass.getModifiers())) {

[MSG]getModifiers() can probably be rewritten as modifiers

UnnecessaryGetter2256

[SRC]mc.getTagNamesThatReturnObject = {-> taglib.getTagNamesT..rnObject() }

[MSG]getTagNamesThatReturnObject() can probably be rewritten as tagNamesThatReturnObject

UnnecessaryGetter258

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2220

[SRC]GrailsPluginManager pluginManager = getManager()

[MSG]getManager() can probably be rewritten as manager

UnnecessaryGetter2236

[SRC]if (Modifier.isAbstract(superClass.getModifiers())) {

[MSG]getModifiers() can probably be rewritten as modifiers

UnnecessaryGetter2256

[SRC]mc.getTagNamesThatReturnObject = {-> taglib.getTagNamesT..rnObject() }

[MSG]getTagNamesThatReturnObject() can probably be rewritten as tagNamesThatReturnObject

UnnecessarySelfAssignment2146

[SRC]jspTagLibraryResolver = jspTagLibraryResolver

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2146

[SRC]jspTagLibraryResolver = jspTagLibraryResolver

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

➥ ServletsGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity240

[SRC]def doWithDynamicMethods = { ctx ->

[MSG]The ABC score for method [doWithDynamicMethods] is [101.4]

AbcComplexity235

[SRC]class ServletsGrailsPlugin {

[MSG]The ABC score for class [org.codehaus.groovy.grails.plugins.web.ServletsGrailsPlugin] is [101.4]

UnnecessaryGetter237

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter237

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

Package: src.java.org.codehaus.groovy.grails.plugins.web.filters

➥ FilterConfig.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse269

[SRC]if (!args) {

[MSG]Testing the negative condition first can make an if statement confusing

ConsecutiveStringConcatenation387

[SRC]"Invalid filter definition in ${filtersDefinition.getCla..} - trying "

[MSG]String concatenation can be joined into a single literal

➥ FilterToHandlerAdapter.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter296

[SRC]if (!uri) uri = request.getRequestURI()

[MSG]getRequestURI() can probably be rewritten as requestURI

UnnecessaryGetter297

[SRC]return uri.substring(request.getContextPath().length())

[MSG]getContextPath() can probably be rewritten as contextPath

UnnecessaryGetter2198

[SRC]actionName = controllerClass?.getDefaultAction()

[MSG]getDefaultAction() can probably be rewritten as defaultAction

➥ FiltersGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse2160

[SRC]if (!addedDeps.containsKey(dep)) {

[MSG]Testing the negative condition first can make an if statement confusing

AbcComplexity2125

[SRC]private reloadFilters(GrailsApplication application, app..onContext) {

[MSG]The ABC score for method [reloadFilters] is [82.7]

UnusedVariable2142

[SRC]def filterClass = applicationContext.getBean("${c.fullName}Class")

[MSG]The variable [filterClass] is not used

UnusedVariable2191

[SRC]def filterClass = applicationContext.getBean("${c.fullName}Class")

[MSG]The variable [filterClass] is not used

UnnecessaryObjectReferences2106

[SRC]mc.render = {Map args, Closure c ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2106

[SRC]mc.render = {Map args, Closure c ->

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter243

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter243

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

ImportFromSamePackage324

[SRC]import org.codehaus.groovy.grails.plugins.web.filters.Co..eInterceptor

ImportFromSamePackage325

[SRC]import org.codehaus.groovy.grails.plugins.web.filters.Fi..efactHandler

ImportFromSamePackage326

[SRC]import org.codehaus.groovy.grails.plugins.web.filters.Fi..ndlerAdapter

MethodSize3125

[MSG]Method "reloadFilters" is 108 lines

Package: src.java.org.codehaus.groovy.grails.plugins.web.mapping

➥ UrlMappingsGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
NestedBlockDepth299

[SRC]'error-page' {

[MSG]The nested block depth is 6

UnnecessaryGetter241

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter241

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryCallForLastElement261

[SRC]def lastFilter = filters[filters.size()-1]

[MSG]Unnecessarily complex access of last element. This can be simplified to filters.last() or filters[-1]

UnnecessaryCallForLastElement271

[SRC]def lastServlet = servlets[servlets.size()-1]

[MSG]Unnecessarily complex access of last element. This can be simplified to servlets.last() or servlets[-1]

UnnecessaryCallForLastElement281

[SRC]def lastMapping = servletMappings[servletMappings.size()-1]

[MSG]Unnecessarily complex access of last element. This can be simplified to servletMappings.last() or servletMappings[-1]

UnnecessaryCallForLastElement2110

[SRC]welcomeFileList = welcomeFileList[welcomeFileList.size()-1]

[MSG]Unnecessarily complex access of last element. This can be simplified to welcomeFileList.last() or welcomeFileList[-1]

UnnecessaryCallForLastElement2118

[SRC]def lastFilterMapping = filterMappings[filterMappings.size() - 1]

[MSG]Unnecessarily complex access of last element. This can be simplified to filterMappings.last() or filterMappings[-1]

UnnecessaryCallForLastElement261

[SRC]def lastFilter = filters[filters.size()-1]

[MSG]Unnecessarily complex access of last element. This can be simplified to filters.last() or filters[-1]

UnnecessaryCallForLastElement271

[SRC]def lastServlet = servlets[servlets.size()-1]

[MSG]Unnecessarily complex access of last element. This can be simplified to servlets.last() or servlets[-1]

UnnecessaryCallForLastElement281

[SRC]def lastMapping = servletMappings[servletMappings.size()-1]

[MSG]Unnecessarily complex access of last element. This can be simplified to servletMappings.last() or servletMappings[-1]

UnnecessaryCallForLastElement2110

[SRC]welcomeFileList = welcomeFileList[welcomeFileList.size()-1]

[MSG]Unnecessarily complex access of last element. This can be simplified to welcomeFileList.last() or welcomeFileList[-1]

UnnecessaryCallForLastElement2118

[SRC]def lastFilterMapping = filterMappings[filterMappings.size() - 1]

[MSG]Unnecessarily complex access of last element. This can be simplified to filterMappings.last() or filterMappings[-1]

Package: src.java.org.codehaus.groovy.grails.plugins.web.mimes

➥ MimeTypesGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
NestedBlockDepth2136

[SRC]if (formats.containsKey(mime.extension)) {

[MSG]The nested block depth is 6

UnusedVariable2121

[SRC]def mimeTypes = req.mimeTypes

[MSG]The variable [mimeTypes] is not used

UnnecessaryGetter239

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter255

[SRC]def allMimes = MimeType.getConfiguredMimeTypes()

[MSG]getConfiguredMimeTypes() can probably be rewritten as configuredMimeTypes

UnnecessaryGetter239

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter255

[SRC]def allMimes = MimeType.getConfiguredMimeTypes()

[MSG]getConfiguredMimeTypes() can probably be rewritten as configuredMimeTypes

Package: src.java.org.codehaus.groovy.grails.plugins.web.taglib

➥ ApplicationTagLib.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter2218

[SRC]def writer = getOut()

[MSG]getOut() can probably be rewritten as out

UnnecessaryGetter2269

[SRC]def writer = getOut()

[MSG]getOut() can probably be rewritten as out

UnnecessaryGetter2298

[SRC]String defaultAction = controllerClass?.getDefaultAction()

[MSG]getDefaultAction() can probably be rewritten as defaultAction

UnnecessaryGetter2218

[SRC]def writer = getOut()

[MSG]getOut() can probably be rewritten as out

UnnecessaryGetter2269

[SRC]def writer = getOut()

[MSG]getOut() can probably be rewritten as out

UnnecessaryGetter2298

[SRC]String defaultAction = controllerClass?.getDefaultAction()

[MSG]getDefaultAction() can probably be rewritten as defaultAction

➥ CountryTagLib.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToCompareToMethod2271

[SRC]ISO3166_3.entrySet().sort { a, b -> a.value.compareTo(b...) { it.key }

[MSG]Explicit call to a.value.compareTo(b.value) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2271

[SRC]ISO3166_3.entrySet().sort { a, b -> a.value.compareTo(b...) { it.key }

[MSG]Explicit call to a.value.compareTo(b.value) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

UnnecessaryCollectCall2271

[SRC]ISO3166_3.entrySet().sort { a, b -> a.value.compareTo(b...) { it.key }

[MSG]The call to collect could probably be rewritten as a spread expression: ISO3166_3.entrySet().sort(<not implemented yet for class: org.codehaus.groovy.ast.expr.ClosureExpression>)*.key

UnnecessaryCollectCall2271

[SRC]ISO3166_3.entrySet().sort { a, b -> a.value.compareTo(b...) { it.key }

[MSG]The call to collect could probably be rewritten as a spread expression: ISO3166_3.entrySet().sort(<not implemented yet for class: org.codehaus.groovy.ast.expr.ClosureExpression>)*.key

➥ FormTagLib.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2796

[SRC]catch (e) {

[MSG]The catch block is empty

AddEmptyString2535

[SRC]def h = '' + i

[MSG]Concatenating an empty string is an inefficient way to convert an object to a String. Consider using toString() or String.valueOf(Object)

AddEmptyString2557

[SRC]def m = '' + i

[MSG]Concatenating an empty string is an inefficient way to convert an object to a String. Consider using toString() or String.valueOf(Object)

AddEmptyString2535

[SRC]def h = '' + i

[MSG]Concatenating an empty string is an inefficient way to convert an object to a String. Consider using toString() or String.valueOf(Object)

AddEmptyString2557

[SRC]def m = '' + i

[MSG]Concatenating an empty string is an inefficient way to convert an object to a String. Consider using toString() or String.valueOf(Object)

AbcComplexity2396

[SRC]def datePicker = { attrs ->

[MSG]The ABC score for method [datePicker] is [103.8]

AbcComplexity2665

[SRC]def select = { attrs ->

[MSG]The ABC score for method [select] is [70.6]

CyclomaticComplexity2396

[SRC]def datePicker = { attrs ->

[MSG]The cyclomatic complexity for method [datePicker] is [39]

CyclomaticComplexity2665

[SRC]def select = { attrs ->

[MSG]The cyclomatic complexity for method [select] is [27]

UnnecessaryObjectReferences294

[SRC]attrs.tagName = "submitButton"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences294

[SRC]attrs.tagName = "submitButton"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter2269

[SRC]def writer = getOut()

[MSG]getOut() can probably be rewritten as out

UnnecessaryGetter2404

[SRC]xdefault = DateFormat.getInstance().parse(xdefault)

[MSG]getInstance() can probably be rewritten as instance

UnnecessaryGetter2582

[SRC]attrs.from = TimeZone.getAvailableIDs()

[MSG]getAvailableIDs() can probably be rewritten as availableIDs

UnnecessaryGetter2583

[SRC]attrs.value = (attrs.value ? attrs.value.ID : TimeZone.g..efault().ID)

[MSG]getDefault() can probably be rewritten as default

UnnecessaryGetter2612

[SRC]attrs.from = Locale.getAvailableLocales()

[MSG]getAvailableLocales() can probably be rewritten as availableLocales

UnnecessaryGetter2666

[SRC]def messageSource = grailsAttributes.getApplicationConte..sageSource")

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnnecessaryGetter2269

[SRC]def writer = getOut()

[MSG]getOut() can probably be rewritten as out

UnnecessaryGetter2404

[SRC]xdefault = DateFormat.getInstance().parse(xdefault)

[MSG]getInstance() can probably be rewritten as instance

UnnecessaryGetter2582

[SRC]attrs.from = TimeZone.getAvailableIDs()

[MSG]getAvailableIDs() can probably be rewritten as availableIDs

UnnecessaryGetter2583

[SRC]attrs.value = (attrs.value ? attrs.value.ID : TimeZone.g..efault().ID)

[MSG]getDefault() can probably be rewritten as default

UnnecessaryGetter2612

[SRC]attrs.from = Locale.getAvailableLocales()

[MSG]getAvailableLocales() can probably be rewritten as availableLocales

UnnecessaryGetter2666

[SRC]def messageSource = grailsAttributes.getApplicationConte..sageSource")

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnnecessaryGetter2230

[SRC]def writer = getOut()

[MSG]getOut() can probably be rewritten as out

UnnecessarySelfAssignment2397

[SRC]def out = out // let x = x ?

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2397

[SRC]def out = out // let x = x ?

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

➥ FormatTagLib.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse2161

[SRC]if (!type) {

[MSG]Testing the negative condition first can make an if statement confusing

InvertedIfElse2248

[SRC]if (!type) {

[MSG]Testing the negative condition first can make an if statement confusing

InvertedIfElse2161

[SRC]if (!type) {

[MSG]Testing the negative condition first can make an if statement confusing

InvertedIfElse2248

[SRC]if (!type) {

[MSG]Testing the negative condition first can make an if statement confusing

AbcComplexity2220

[SRC]def formatNumber = { attrs ->

[MSG]The ABC score for method [formatNumber] is [69.0]

CyclomaticComplexity2220

[SRC]def formatNumber = { attrs ->

[MSG]The cyclomatic complexity for method [formatNumber] is [26]

UnnecessaryObjectReferences2298

[SRC]decimalFormat.setMinimumFractionDigits(attrs.minFraction.. as Integer)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2298

[SRC]decimalFormat.setMinimumFractionDigits(attrs.minFraction.. as Integer)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter2157

[SRC]timeZone = TimeZone.getDefault()

[MSG]getDefault() can probably be rewritten as default

UnnecessaryGetter2274

[SRC]dcfs = decimalFormat.getDecimalFormatSymbols()

[MSG]getDecimalFormatSymbols() can probably be rewritten as decimalFormatSymbols

UnnecessaryGetter2157

[SRC]timeZone = TimeZone.getDefault()

[MSG]getDefault() can probably be rewritten as default

UnnecessaryGetter2274

[SRC]dcfs = decimalFormat.getDecimalFormatSymbols()

[MSG]getDecimalFormatSymbols() can probably be rewritten as decimalFormatSymbols

UnnecessaryGetter2331

[SRC]locale = Locale.getDefault()

[MSG]getDefault() can probably be rewritten as default

UnnecessaryGroovyImport321

[SRC]import java.util.Currency

UnnecessaryGroovyImport322

[SRC]import java.util.Locale

UnnecessaryGroovyImport323

[SRC]import java.util.TimeZone

➥ JavascriptTagLib.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse2122

[SRC]if (!attrs.base) {

[MSG]Testing the negative condition first can make an if statement confusing

UnnecessaryGetter2167

[SRC]getProvider().doRemoteFunction(owner, attrs, out)

[MSG]getProvider() can probably be rewritten as provider

UnnecessaryGetter2318

[SRC]def p = getProvider()

[MSG]getProvider() can probably be rewritten as provider

UnnecessaryGetter2349

[SRC]def p = getProvider()

[MSG]getProvider() can probably be rewritten as provider

UnnecessaryGetter2167

[SRC]getProvider().doRemoteFunction(owner, attrs, out)

[MSG]getProvider() can probably be rewritten as provider

UnnecessaryGetter2318

[SRC]def p = getProvider()

[MSG]getProvider() can probably be rewritten as provider

UnnecessaryGetter2349

[SRC]def p = getProvider()

[MSG]getProvider() can probably be rewritten as provider

➥ RenderTagLib.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2316

[SRC]def paginate = { attrs ->

[MSG]The ABC score for method [paginate] is [87.6]

AbcComplexity2522

[SRC]def render = { attrs, body ->

[MSG]The ABC score for method [render] is [87.5]

CyclomaticComplexity2316

[SRC]def paginate = { attrs ->

[MSG]The cyclomatic complexity for method [paginate] is [29]

CyclomaticComplexity2522

[SRC]def render = { attrs, body ->

[MSG]The cyclomatic complexity for method [render] is [34]

NestedBlockDepth2582

[SRC]if (templateName.toLowerCase().endsWith('.gsp')) {

[MSG]The nested block depth is 6

UnnecessaryGetter2114

[SRC]def oldPage = getPage()

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2153

[SRC]def parser = getFactory().getPageParser(contentType)

[MSG]getFactory() can probably be rewritten as factory

UnnecessaryGetter2160

[SRC]def decoratorMapper = getFactory().getDecoratorMapper()

[MSG]getDecoratorMapper() can probably be rewritten as decoratorMapper

UnnecessaryGetter2160

[SRC]def decoratorMapper = getFactory().getDecoratorMapper()

[MSG]getFactory() can probably be rewritten as factory

UnnecessaryGetter2167

[SRC]def t = groovyPagesTemplateEngine.createTemplate(d.getPage())

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2197

[SRC]def htmlPage = getPage()

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2244

[SRC]def htmlPage = getPage()

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2287

[SRC]getPage().writeBody(out)

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2296

[SRC]getPage().writeHead(out)

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2114

[SRC]def oldPage = getPage()

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2153

[SRC]def parser = getFactory().getPageParser(contentType)

[MSG]getFactory() can probably be rewritten as factory

UnnecessaryGetter2160

[SRC]def decoratorMapper = getFactory().getDecoratorMapper()

[MSG]getDecoratorMapper() can probably be rewritten as decoratorMapper

UnnecessaryGetter2160

[SRC]def decoratorMapper = getFactory().getDecoratorMapper()

[MSG]getFactory() can probably be rewritten as factory

UnnecessaryGetter2167

[SRC]def t = groovyPagesTemplateEngine.createTemplate(d.getPage())

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2197

[SRC]def htmlPage = getPage()

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2244

[SRC]def htmlPage = getPage()

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2287

[SRC]getPage().writeBody(out)

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2296

[SRC]getPage().writeHead(out)

[MSG]getPage() can probably be rewritten as page

UnnecessaryGetter2179

[SRC]return FactoryHolder.getFactory()

[MSG]getFactory() can probably be rewritten as factory

UnnecessaryNullCheck2149

[SRC]if (gspSiteMeshPage != null && gspSiteMeshPage.isUsed()) {

[MSG]The expression ((gspSiteMeshPage != null) && gspSiteMeshPage.isUsed()) can be simplified to (gspSiteMeshPage?.isUsed())

UnnecessaryNullCheck2149

[SRC]if (gspSiteMeshPage != null && gspSiteMeshPage.isUsed()) {

[MSG]The expression ((gspSiteMeshPage != null) && gspSiteMeshPage.isUsed()) can be simplified to (gspSiteMeshPage?.isUsed())

➥ SitemeshTagLib.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable2156

[SRC]def content = captureTagContent(out, 'meta', attrs, body)

[MSG]The variable [content] is not used

➥ ValidationTagLib.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryCollectCall2343

[SRC]appliedConstraints += it.collect{ it.appliedConstraints }

[MSG]The call to collect could probably be rewritten as a spread expression: it*.appliedConstraints

UnnecessaryCollectCall2343

[SRC]appliedConstraints += it.collect{ it.appliedConstraints }

[MSG]The call to collect could probably be rewritten as a spread expression: it*.appliedConstraints

UnnecessaryCollectCall2114

[SRC]checkList = model.findAll {it.value?.errors instanceof E..t {it.value}

[MSG]The call to collect could probably be rewritten as a spread expression: model.findAll(<not implemented yet for class: org.codehaus.groovy.ast.expr.ClosureExpression>)*.value

UnnecessaryGetter2413

[SRC]PropertyEditorRegistry registry = RequestContextHolder.c..orRegistry()

[MSG]getPropertyEditorRegistry() can probably be rewritten as propertyEditorRegistry

Package: src.java.org.codehaus.groovy.grails.resolve

➥ EnhancedDefaultDependencyDescriptor.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter270

[SRC]confList = getModuleConfigurations().toList()

[MSG]getModuleConfigurations() can probably be rewritten as moduleConfigurations

UnnecessaryGetter2113

[SRC]Field field = getClass().getSuperclass().getDeclaredFiel..Transitive")

[MSG]getSuperclass() can probably be rewritten as superclass

UnnecessaryGetter2120

[SRC]Field field = getClass().getSuperclass().getDeclaredFiel..isChanging")

[MSG]getSuperclass() can probably be rewritten as superclass

UnusedImport321

[SRC]import org.apache.ivy.core.module.descriptor.ModuleDescriptor

➥ IvyDependencyManager.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse21130

[SRC]if (!pluginMode) {

[MSG]Testing the negative condition first can make an if statement confusing

InvertedIfElse21171

[SRC]if (!pluginMode) {

[MSG]Testing the negative condition first can make an if statement confusing

AbcComplexity21101

[SRC]private parseDependenciesInternal(dependencies, String s..onfigurer) {

[MSG]The ABC score for method [parseDependenciesInternal] is [64.8]

CyclomaticComplexity21101

[SRC]private parseDependenciesInternal(dependencies, String s..onfigurer) {

[MSG]The cyclomatic complexity for method [parseDependenciesInternal] is [29]

MethodCount267

[SRC]class IvyDependencyManager extends AbstractIvyDependency..itionParser{

[MSG]Class org.codehaus.groovy.grails.resolve.IvyDependencyManager has 32 methods

MethodCount2712

[SRC]class IvyDomainSpecificLanguageEvaluator {

[MSG]Class org.codehaus.groovy.grails.resolve.IvyDomainSpecificLanguageEvaluator has 31 methods

NestedBlockDepth2626

[SRC]for (ExcludeRule excludeRule in dependencyDescriptor.get..deRules()) {

[MSG]The nested block depth is 6

NestedBlockDepth21176

[SRC]if (dependency.classifier == 'plugin') {

[MSG]The nested block depth is 6

NestedBlockDepth21179

[SRC]else {

[MSG]The nested block depth is 6

UnusedVariable2619

[SRC]String groupId = moduleRevisionId.getOrganisation()

[MSG]The variable [groupId] is not used

UnusedVariable2620

[SRC]String artifactId = moduleRevisionId.getName()

[MSG]The variable [artifactId] is not used

UnusedVariable2621

[SRC]String version = moduleRevisionId.getRevision()

[MSG]The variable [version] is not used

UnnecessaryGetter2410

[SRC]if (dependencyDescriptor.getModuleConfigurations().length == 0){

[MSG]getModuleConfigurations() can probably be rewritten as moduleConfigurations

UnnecessaryGetter2616

[SRC]ModuleRevisionId moduleRevisionId = dependencyDescriptor..RevisionId()

[MSG]getDependencyRevisionId() can probably be rewritten as dependencyRevisionId

UnnecessaryGetter2617

[SRC]ModuleId moduleId = moduleRevisionId.getModuleId()

[MSG]getModuleId() can probably be rewritten as moduleId

UnnecessaryGetter2619

[SRC]String groupId = moduleRevisionId.getOrganisation()

[MSG]getOrganisation() can probably be rewritten as organisation

UnnecessaryGetter2620

[SRC]String artifactId = moduleRevisionId.getName()

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2621

[SRC]String version = moduleRevisionId.getRevision()

[MSG]getRevision() can probably be rewritten as revision

UnnecessaryGetter2622

[SRC]String scope = Arrays.asList(dependencyDescriptor.getMod..ns()).get(0)

[MSG]getModuleConfigurations() can probably be rewritten as moduleConfigurations

UnnecessaryGetter2626

[SRC]for (ExcludeRule excludeRule in dependencyDescriptor.get..deRules()) {

[MSG]getAllExcludeRules() can probably be rewritten as allExcludeRules

UnnecessaryGetter2627

[SRC]ModuleId excludedModule = excludeRule.getId().getModuleId()

[MSG]getModuleId() can probably be rewritten as moduleId

UnnecessaryGetter2627

[SRC]ModuleId excludedModule = excludeRule.getId().getModuleId()

[MSG]getId() can probably be rewritten as id

UnnecessaryGetter2637

[SRC]def installedPlugins = metadata?.getInstalledPlugins()

[MSG]getInstalledPlugins() can probably be rewritten as installedPlugins

UnnecessaryGetter2660

[SRC]PomModuleDescriptorParser parser = PomModuleDescriptorPa..etInstance()

[MSG]getInstance() can probably be rewritten as instance

UnnecessaryGetter2663

[SRC]fixedDependencies = md.getDependencies()

[MSG]getDependencies() can probably be rewritten as dependencies

UnnecessaryGetter2699

[SRC]def candidates = getPluginDependencyDescriptors().findAl..pplication }

[MSG]getPluginDependencyDescriptors() can probably be rewritten as pluginDependencyDescriptors

MethodSize3202

[MSG]Method "getDefaultDependencies" is 134 lines

MethodSize31101

[MSG]Method "parseDependenciesInternal" is 102 lines

➥ PluginInstallEngine.groovy

Rule NamePriorityLine #Source Line / Message
InvertedIfElse2402

[SRC]if (!depPluginDir?.exists()) {

[MSG]Testing the negative condition first can make an if statement confusing

InvertedIfElse2419

[SRC]if (!GrailsPluginUtils.isValidVersion(dependencyVersion,..pVersion)) {

[MSG]Testing the negative condition first can make an if statement confusing

UnnecessaryCollectCall2107

[SRC]checkPluginsToUninstall(pluginDescriptors.collect { it.d..evisionId })

[MSG]The call to collect could probably be rewritten as a spread expression: pluginDescriptors*.dependencyRevisionId

UnnecessaryGetter285

[SRC]applicationPluginsLocation = settings.getProjectPluginsDir()

[MSG]getProjectPluginsDir() can probably be rewritten as projectPluginsDir

UnnecessaryGetter2387

[SRC]def grailsVersion = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2408

[SRC]installVersion = settings.defaultPluginSet.contains(depD..ion() : null

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2489

[SRC]IvyDependencyManager dependencyManager = settings.getDep..ncyManager()

[MSG]getDependencyManager() can probably be rewritten as dependencyManager

UnnecessarySelfAssignment2303

[SRC]PluginBuildSettings pluginSettings = pluginSettings

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

➥ PluginResolveEngine.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2155

[SRC]catch(e) {

[MSG]The catch block is empty

Package: src.java.org.codehaus.groovy.grails.scaffolding

➥ DefaultGrailsTemplateGenerator.groovy

Rule NamePriorityLine #Source Line / Message
UnusedPrivateMethod2133

[SRC]private generateListView(domainClass, destDir) {

[MSG]The method generateListView is not used within DefaultGrailsTemplateGenerator.groovy

UnusedPrivateMethod2143

[SRC]private generateShowView(domainClass, destDir) {

[MSG]The method generateShowView is not used within DefaultGrailsTemplateGenerator.groovy

UnusedPrivateMethod2153

[SRC]private generateEditView(domainClass, destDir) {

[MSG]The method generateEditView is not used within DefaultGrailsTemplateGenerator.groovy

UnusedPrivateMethod2163

[SRC]private generateCreateView(domainClass, destDir) {

[MSG]The method generateCreateView is not used within DefaultGrailsTemplateGenerator.groovy

UnnecessaryGetter2102

[SRC]for (t in getTemplateNames()) {

[MSG]getTemplateNames() can probably be rewritten as templateNames

UnnecessaryGetter2234

[SRC]def application = ApplicationHolder.getApplication()

[MSG]getApplication() can probably be rewritten as application

UnnecessaryGetter2252

[SRC]return templateFile.inputStream.getText()

[MSG]getText() can probably be rewritten as text

Package: src.java.org.codehaus.groovy.grails.support

➥ DevelopmentShutdownHook.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport319

[SRC]import org.apache.commons.logging.Log

UnusedImport320

[SRC]import org.apache.commons.logging.LogFactory

Package: src.java.org.codehaus.groovy.grails.test

➥ GrailsTestTargetPattern.groovy

Rule NamePriorityLine #Source Line / Message
ConfusingTernary2110

[SRC](pattern.indexOf('.') != -1) ? pattern.replace('.', '/')../" + pattern

[MSG](pattern.indexOf(.) != -1) is a confusing negation in a ternary expression. Rewrite as (pattern.indexOf(.) == -1) and invert the conditions.

Package: src.java.org.codehaus.groovy.grails.test.junit4

➥ JUnit4GrailsTestType.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter257

[SRC]def testClasses = getTestClasses()

[MSG]getTestClasses() can probably be rewritten as testClasses

UnnecessaryGetter280

[SRC]new GrailsTestCaseRunnerBuilder(mode, getApplicationCont..getPatterns)

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnusedImport323

[SRC]import org.codehaus.groovy.grails.test.GrailsTestTargetPattern

Package: src.java.org.codehaus.groovy.grails.test.junit4.listener

➥ SuiteRunListener.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod246

[SRC]void testRunStarted(Description description) {

[MSG]The method testRunStarted is both empty and not marked with @Override

EmptyMethod272

[SRC]void testIgnored(Description description) {

[MSG]The method testIgnored is both empty and not marked with @Override

UnnecessaryGetter269

[SRC]getPerTestRunListener().finish()

[MSG]getPerTestRunListener() can probably be rewritten as perTestRunListener

Package: src.java.org.codehaus.groovy.grails.test.junit4.runner

➥ GrailsTestCaseRunner.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport324

[SRC]import org.junit.runner.notification.RunNotifier

UnusedImport334

[SRC]import org.codehaus.groovy.grails.test.support.GrailsTestInterceptor

Package: src.java.org.codehaus.groovy.grails.test.support

➥ GrailsTestInterceptor.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter284

[SRC]def controllerName = getControllerName()

[MSG]getControllerName() can probably be rewritten as controllerName

➥ GrailsTestTransactionInterceptor.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport319

[SRC]import org.springframework.web.context.request.RequestContextHolder

➥ GrailsTestTypeSupport.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter2117

[SRC]Thread.currentThread().contextClassLoader = getTestClassLoader()

[MSG]getTestClassLoader() can probably be rewritten as testClassLoader

UnnecessaryGetter2157

[SRC]def classPathAdditions = [getSourceDir()]

[MSG]getSourceDir() can probably be rewritten as sourceDir

UnnecessaryGetter2210

[SRC]def basePath = getSourceDir().canonicalPath

[MSG]getSourceDir() can probably be rewritten as sourceDir

UnnecessaryGetter2250

[SRC]getTestClassLoader().loadClass(className)

[MSG]getTestClassLoader() can probably be rewritten as testClassLoader

Package: src.java.org.codehaus.groovy.grails.web.converters

➥ JSONParsingParameterCreationListener.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter236

[SRC]def request = params.getRequest()

[MSG]getRequest() can probably be rewritten as request

➥ XMLParsingParameterCreationListener.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter235

[SRC]def request = params.getRequest()

[MSG]getRequest() can probably be rewritten as request

Package: src.java.org.codehaus.groovy.grails.web.converters.configuration

➥ configtest.groovy

Rule NamePriorityLine #Source Line / Message
ImportFromSamePackage33

[SRC]import org.codehaus.groovy.grails.web.converters.configu..nInitializer

ImportFromSamePackage34

[SRC]import org.codehaus.groovy.grails.web.converters.configu..rationHolder

ImportFromSamePackage36

[SRC]import org.codehaus.groovy.grails.web.converters.configu..onfiguration

ImportFromSamePackage37

[SRC]import org.codehaus.groovy.grails.web.converters.configu..onfiguration

Package: src.java.org.codehaus.groovy.grails.web.mapping

➥ ForwardUrlMappingInfo.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitHashMapInstantiation232

[SRC]Map parameters = new HashMap()

[MSG]HashMap objects are better instantiated using the form "[] as HashMap"

UnusedImport317

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest

Package: src.java.org.codehaus.groovy.grails.web.metaclass

➥ ChainMethod.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter246

[SRC]def flash = webRequest.getFlashScope()

[MSG]getFlashScope() can probably be rewritten as flashScope

UnnecessaryGetter269

[SRC]def appCtx = webRequest.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnnecessaryGetter278

[SRC]def response = webRequest.getCurrentResponse()

[MSG]getCurrentResponse() can probably be rewritten as currentResponse

➥ WithFormMethod.groovy

Rule NamePriorityLine #Source Line / Message
SynchronizedMethod266

[SRC]protected synchronized boolean isTokenValid(HttpServletR..t request) {

[MSG]The method isTokenValid is synchronized at the method level

SynchronizedMethod284

[SRC]protected synchronized resetToken(HttpServletRequest request) {

[MSG]The method resetToken is synchronized at the method level

Package: src.java.org.codehaus.groovy.grails.web.mime

➥ DefaultAcceptHeaderParser.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable235

[SRC]def qualifiedMimes = []

[MSG]The variable [qualifiedMimes] is not used

UnnecessaryGetter233

[SRC]def config = ConfigurationHolder.getConfig()

[MSG]getConfig() can probably be rewritten as config

UnnecessaryGetter243

[SRC]return MimeType.getConfiguredMimeTypes()

[MSG]getConfiguredMimeTypes() can probably be rewritten as configuredMimeTypes

➥ MimeType.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToEqualsMethod239

[SRC]boolean equals(Object o) { o instanceof MimeType && name..ls(o.name) }

[MSG]Explicit call to name.equals(o.name) method can be rewritten as name == (o.name)

UnnecessaryGetter249

[SRC]def config = ConfigurationHolder.getConfig()

[MSG]getConfig() can probably be rewritten as config

Package: src.java.org.codehaus.groovy.grails.web.pages

➥ GroovyPageCompiler.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity273

[SRC]protected void compileGSP(File viewsDir, File gspfile, S..agePrefix) {

[MSG]The ABC score for method [compileGSP] is [64.8]

UnnecessaryGetter284

[SRC]def relPackagePath = relativePath(viewsDir, gspfile.getParentFile())

[MSG]getParentFile() can probably be rewritten as parentFile

UnnecessaryGetter2116

[SRC]gspgroovyfile.getParentFile().mkdirs()

[MSG]getParentFile() can probably be rewritten as parentFile

➥ GroovyPageCompilerTask.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter258

[SRC]classpath = new Path(getProject())

[MSG]getProject() can probably be rewritten as project

UnnecessaryGetter281

[SRC]throw new BuildException("destination [${destdir}] direc..tLocation())

[MSG]getLocation() can probably be rewritten as location

UnnecessaryGetter287

[SRC]throw new BuildException("source [${srcdir}] directory d..tLocation())

[MSG]getLocation() can probably be rewritten as location

ImportFromSamePackage323

[SRC]import org.codehaus.groovy.grails.web.pages.GroovyPageCompiler

Package: src.java.org.codehaus.groovy.grails.web.pages.ext.jsp

➥ GroovyPagesJspFactory.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter226

[SRC]return { getSpecificationVersion() } as JspEngineInfo

[MSG]getSpecificationVersion() can probably be rewritten as specificationVersion

➥ JspTagImpl.groovy

Rule NamePriorityLine #Source Line / Message
CyclomaticComplexity260

[SRC]void doTag(Writer targetWriter, Map attributes, Closure body) {

[MSG]The cyclomatic complexity for method [doTag] is [23]

NestedBlockDepth2111

[SRC]while (state != IterationTag.SKIP_BODY) {

[MSG]The nested block depth is 6

UnnecessaryGetter262

[SRC]GroovyPagesPageContext pageContext = PageContextFactory.getCurrent();

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter299

[SRC]def out = pageContext.getOut()

[MSG]getOut() can probably be rewritten as out

UnnecessaryGetter2121

[SRC]LOG.warn "Tag ${tag.getClass().getName()} returned SKIP_..rted in GSP"

[MSG]getName() can probably be rewritten as name

➥ PageContextFactory.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter238

[SRC]def classLoader = Thread.currentThread().getContextClassLoader()

[MSG]getContextClassLoader() can probably be rewritten as contextClassLoader

UnnecessaryGetter251

[SRC]def request = webRequest.getCurrentRequest()

[MSG]getCurrentRequest() can probably be rewritten as currentRequest

UnnecessaryGetter256

[SRC]ServletContext servletContext = webRequest.getServletContext()

[MSG]getServletContext() can probably be rewritten as servletContext

➥ TagLibraryResolver.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToEqualsMethod2169

[SRC]if ("taglib".equals(pullParser.getName())) {

[MSG]Explicit call to taglib.equals(pullParser.getName()) method can be rewritten as taglib == (pullParser.getName())

ExplicitCallToEqualsMethod2175

[SRC]if (token == XmlPullParser.START_TAG && "uri".equals(pul..etName())) {

[MSG]Explicit call to uri.equals(pullParser.getName()) method can be rewritten as uri == (pullParser.getName())

NestedBlockDepth2175

[SRC]if (token == XmlPullParser.START_TAG && "uri".equals(pul..etName())) {

[MSG]The nested block depth is 6

NestedBlockDepth2184

[SRC]if (tagLibURI == uri) {

[MSG]The nested block depth is 6

UnnecessaryGetter264

[SRC]def jarURLs = grailsApplication.isWarDeployed() ? getJar..().getURLs()

[MSG]getJarsFromServletContext() can probably be rewritten as jarsFromServletContext

UnnecessaryGetter264

[SRC]def jarURLs = grailsApplication.isWarDeployed() ? getJar..().getURLs()

[MSG]getURLs() can probably be rewritten as URLs

UnnecessaryGetter270

[SRC]ZipEntry entry = zipInput.getNextEntry()

[MSG]getNextEntry() can probably be rewritten as nextEntry

UnnecessaryGetter276

[SRC]entry = zipInput.getNextEntry()

[MSG]getNextEntry() can probably be rewritten as nextEntry

UnnecessaryGetter286

[SRC]Resource webXml = getWebXmlFromServletContext()

[MSG]getWebXmlFromServletContext() can probably be rewritten as webXmlFromServletContext

UnnecessaryGetter298

[SRC]def jarURLs = grailsApplication.isWarDeployed() ? getJar..().getURLs()

[MSG]getJarsFromServletContext() can probably be rewritten as jarsFromServletContext

UnnecessaryGetter298

[SRC]def jarURLs = grailsApplication.isWarDeployed() ? getJar..().getURLs()

[MSG]getURLs() can probably be rewritten as URLs

UnnecessaryGetter2115

[SRC]def source = new InputSource(webXml.getInputStream())

[MSG]getInputStream() can probably be rewritten as inputStream

UnnecessaryGetter2120

[SRC]def reader = factory.newSAXParser().getXMLReader()

[MSG]getXMLReader() can probably be rewritten as XMLReader

UnnecessaryGetter2126

[SRC]for (entry in webXmlReader.getTagLocations()) {

[MSG]getTagLocations() can probably be rewritten as tagLocations

UnnecessaryGetter2157

[SRC]ZipEntry entry = zipInput.getNextEntry()

[MSG]getNextEntry() can probably be rewritten as nextEntry

UnnecessaryGetter2159

[SRC]def name = entry.getName()

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2169

[SRC]if ("taglib".equals(pullParser.getName())) {

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2175

[SRC]if (token == XmlPullParser.START_TAG && "uri".equals(pul..etName())) {

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2177

[SRC]tagLibURI = pullParser.getText()?.trim()

[MSG]getText() can probably be rewritten as text

UnnecessaryGetter2191

[SRC]entry = zipInput.getNextEntry()

[MSG]getNextEntry() can probably be rewritten as nextEntry

UnnecessaryGetter2216

[SRC]def reader = factory.newSAXParser().getXMLReader()

[MSG]getXMLReader() can probably be rewritten as XMLReader

Package: src.java.org.codehaus.groovy.grails.web.plugins.support

➥ WebMetaUtils.groovy

Rule NamePriorityLine #Source Line / Message
NestedBlockDepth297

[SRC]if (paramType.isInstance(commandObjects[counter])) {

[MSG]The nested block depth is 6

UnnecessaryObjectReferences2228

[SRC]mc.getResponse = responseObject

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2230

[SRC]mc.getGrailsAttributes = grailsAttrsObject

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2232

[SRC]mc.getGrailsApplication = { -> RCH.currentRequestAttribu..pplication }

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2234

[SRC]mc.getActionName = { -> RCH.currentRequestAttributes..actionName }

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2235

[SRC]mc.getControllerName = { -> RCH.currentRequestAttributes..rollerName }

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2236

[SRC]mc.getWebRequest = { -> RCH.currentRequestAttributes() }

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter285

[SRC]def paramTypes = originalAction.getParameterTypes()

[MSG]getParameterTypes() can probably be rewritten as parameterTypes

UnnecessaryGetter2121

[SRC]constrainedProperty.getPropertyName()), errors)

[MSG]getPropertyName() can probably be rewritten as propertyName

UnnecessaryGetter2175

[SRC]errors = new BeanPropertyBindingResult(delegate, delega..).getName())

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2198

[SRC]delegate.setErrors (new BeanPropertyBindingResult(delega...getName()))

[MSG]getName() can probably be rewritten as name

Package: src.java.org.codehaus.groovy.grails.web.servlet.mvc

➥ GrailsParameterMap.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToEqualsMethod2180

[SRC]if ("date.struct".equals(returnValue)) {

[MSG]Explicit call to date.struct.equals(returnValue) method can be rewritten as date.struct == (returnValue)

ExplicitHashMapInstantiation2118

[SRC]prefixValue = new GrailsParameterMap(new HashMap(), request)

[MSG]HashMap objects are better instantiated using the form "[] as HashMap"

UnusedPrivateMethod2266

[SRC]private Byte 'byte'(String name) { getByte(name) }

[MSG]The method byte is not used within GrailsParameterMap.groovy

UnusedPrivateMethod2273

[SRC]private Integer 'int'(String name) { getInt(name) }

[MSG]The method int is not used within GrailsParameterMap.groovy

UnusedPrivateMethod2280

[SRC]private Long 'long'(String name) { getLong(name) }

[MSG]The method long is not used within GrailsParameterMap.groovy

UnusedPrivateMethod2287

[SRC]private Short 'short'(String name) { getShort(name) }

[MSG]The method short is not used within GrailsParameterMap.groovy

UnusedPrivateMethod2294

[SRC]private Double 'double'(String name) { getDouble(name) }

[MSG]The method double is not used within GrailsParameterMap.groovy

UnusedPrivateMethod2301

[SRC]private Float 'float'(String name) { getFloat(name) }

[MSG]The method float is not used within GrailsParameterMap.groovy

UnusedPrivateMethod2308

[SRC]private Boolean 'boolean'(String name) {

[MSG]The method boolean is not used within GrailsParameterMap.groovy

UnnecessaryGetter263

[SRC]final Map requestMap = new LinkedHashMap(request.getParameterMap())

[MSG]getParameterMap() can probably be rewritten as parameterMap

UnnecessaryGetter2196

[SRC]dateParams.put(paramName.substring(prefix.length(), para...getValue())

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2202

[SRC]LocaleContextHolder.getLocale())

[MSG]getLocale() can probably be rewritten as locale

UnnecessaryGetter2253

[SRC]"] to a query string: " + e.getMessage(), e)

[MSG]getMessage() can probably be rewritten as message

UnnecessaryGroovyImport328

[SRC]import java.io.UnsupportedEncodingException

UnusedImport322

[SRC]import org.codehaus.groovy.grails.web.binding.StructuredPropertyEditor

➥ SynchronizerToken.groovy

Rule NamePriorityLine #Source Line / Message
SerializableClassMustDefineSerialVersionUID225

[SRC]class SynchronizerToken implements Serializable {

[MSG]The class org.codehaus.groovy.grails.web.servlet.mvc.SynchronizerToken implements Serializable but does not define a serialVersionUID

Package: src.java.org.codehaus.groovy.grails.web.taglib

➥ GroovyPageAttributes.groovy

Rule NamePriorityLine #Source Line / Message
CloneableWithoutClone228

[SRC]class GroovyPageAttributes extends TypeConvertingMap imp.. Cloneable {

[MSG]The class org.codehaus.groovy.grails.web.taglib.GroovyPageAttributes implements Cloneable but does not define a proper clone() method

EqualsAndHashCode228

[SRC]class GroovyPageAttributes extends TypeConvertingMap imp.. Cloneable {

[MSG]The class org.codehaus.groovy.grails.web.taglib.GroovyPageAttributes defines hashCode() but not equals(Object)

UnusedPrivateMethod255

[SRC]private Byte 'byte'(String name) { getByte(name) }

[MSG]The method byte is not used within GroovyPageAttributes.groovy

UnusedPrivateMethod262

[SRC]private Integer 'int'(String name) { getInt(name) }

[MSG]The method int is not used within GroovyPageAttributes.groovy

UnusedPrivateMethod269

[SRC]private Long 'long'(String name) { getLong(name) }

[MSG]The method long is not used within GroovyPageAttributes.groovy

UnusedPrivateMethod276

[SRC]private Short 'short'(String name) { getShort(name) }

[MSG]The method short is not used within GroovyPageAttributes.groovy

UnusedPrivateMethod283

[SRC]private Double 'double'(String name) { getDouble(name) }

[MSG]The method double is not used within GroovyPageAttributes.groovy

UnusedPrivateMethod290

[SRC]private Float 'float'(String name) { getFloat(name) }

[MSG]The method float is not used within GroovyPageAttributes.groovy

UnusedPrivateMethod297

[SRC]private Boolean 'boolean'(String name) {

[MSG]The method boolean is not used within GroovyPageAttributes.groovy

➥ NamespacedTagDispatcher.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport319

[SRC]import org.codehaus.groovy.grails.commons.TagLibArtefactHandler

Package: src.java.org.codehaus.groovy.grails.web.util

➥ TypeConvertingMap.groovy

Rule NamePriorityLine #Source Line / Message
CloneableWithoutClone229

[SRC]class TypeConvertingMap implements Map, Cloneable {

[MSG]The class org.codehaus.groovy.grails.web.util.TypeConvertingMap implements Cloneable but does not define a proper clone() method

EmptyCatchBlock292

[SRC]catch (NumberFormatException e) {}

[MSG]The catch block is empty

EmptyCatchBlock2114

[SRC]catch (NumberFormatException e) {}

[MSG]The catch block is empty

EmptyCatchBlock2133

[SRC]catch (NumberFormatException e) {}

[MSG]The catch block is empty

EmptyCatchBlock2155

[SRC]catch (NumberFormatException e) {}

[MSG]The catch block is empty

EmptyCatchBlock2177

[SRC]catch (NumberFormatException e) {}

[MSG]The catch block is empty

EmptyCatchBlock2199

[SRC]catch (NumberFormatException e) {}

[MSG]The catch block is empty

EmptyCatchBlock2221

[SRC]catch (e) {}

[MSG]The catch block is empty

UnnecessaryObjectReferences2268

[SRC]wrappedMap.containsValue(v)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2272

[SRC]wrappedMap.get(k)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2276

[SRC]wrappedMap.putAll(m)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2280

[SRC]wrappedMap.clear()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2284

[SRC]wrappedMap.keySet()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2288

[SRC]wrappedMap.values()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2292

[SRC]wrappedMap.entrySet()

[MSG]The code could be more concise by using a with() or identity() block

Package: src.java.org.codehaus.groovy.grails.webflow

➥ WebFlowPluginSupport.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter2160

[SRC]controller.getReference().getWrappedInstance().metaClass..rollerClass)

[MSG]getWrappedInstance() can probably be rewritten as wrappedInstance

UnnecessaryGetter2160

[SRC]controller.getReference().getWrappedInstance().metaClass..rollerClass)

[MSG]getReference() can probably be rewritten as reference

UnnecessaryGetter2166

[SRC]FlowAssembler flowAssembler = new FlowAssembler(builder,..erContext())

[MSG]getFlowBuilderContext() can probably be rewritten as flowBuilderContext

UnnecessaryGetter2172

[SRC]controller.getReference().getWrappedInstance().metaClass..entMetaClass

[MSG]getWrappedInstance() can probably be rewritten as wrappedInstance

UnnecessaryGetter2172

[SRC]controller.getReference().getWrappedInstance().metaClass..entMetaClass

[MSG]getReference() can probably be rewritten as reference

UnnecessaryGetter2160

[SRC]controller.getReference().getWrappedInstance().metaClass..rollerClass)

[MSG]getWrappedInstance() can probably be rewritten as wrappedInstance

UnnecessaryGetter2160

[SRC]controller.getReference().getWrappedInstance().metaClass..rollerClass)

[MSG]getReference() can probably be rewritten as reference

UnnecessaryGetter2166

[SRC]FlowAssembler flowAssembler = new FlowAssembler(builder,..erContext())

[MSG]getFlowBuilderContext() can probably be rewritten as flowBuilderContext

UnnecessaryGetter2172

[SRC]controller.getReference().getWrappedInstance().metaClass..entMetaClass

[MSG]getWrappedInstance() can probably be rewritten as wrappedInstance

UnnecessaryGetter2172

[SRC]controller.getReference().getWrappedInstance().metaClass..entMetaClass

[MSG]getReference() can probably be rewritten as reference

UnnecessarySelfAssignment271

[SRC]viewFactoryCreator = viewFactoryCreator

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment276

[SRC]flowBuilderServices = flowBuilderServices

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2106

[SRC]flowExecutor = flowExecutor

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment271

[SRC]viewFactoryCreator = viewFactoryCreator

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment276

[SRC]flowBuilderServices = flowBuilderServices

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2106

[SRC]flowExecutor = flowExecutor

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnusedImport325

[SRC]import org.codehaus.groovy.grails.webflow.persistence.Fl..ssionContext

UnusedImport340

[SRC]import org.springframework.webflow.execution.factory.Sta..stenerLoader

UnusedImport326

[SRC]import org.codehaus.groovy.grails.webflow.persistence.Se..tionListener

Package: src.java.org.codehaus.groovy.grails.webflow.context.servlet

➥ GrailsFlowUrlHandler.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport326

[SRC]import org.springframework.webflow.execution.repository...onRepository

Package: src.java.org.codehaus.groovy.grails.webflow.engine.builder

➥ AbstractDelegate.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter261

[SRC]def ctx = getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

➥ ClosureExpression.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod241

[SRC]void setValue(Object context, Object value) {

[MSG]The method setValue is both empty and not marked with @Override

UnusedVariable235

[SRC]def attrs = context?.attributes ? context.attributes : [:]

[MSG]The variable [attrs] is not used

➥ ClosureInvokingAction.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2157

[SRC]catch (MissingPropertyException e) {

[MSG]The catch block is empty

UnusedPrivateField243

[SRC]private static final String RESULT = "result"

[MSG]The field RESULT is not used within ClosureInvokingAction.groovy

UnnecessaryGetter275

[SRC]prop.validate(delegate, delegate.getProperty( prop.getPr..localErrors)

[MSG]getPropertyName() can probably be rewritten as propertyName

UnusedImport319

[SRC]import org.codehaus.groovy.runtime.InvokerHelper

➥ ControllerFlowRegistry.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter260

[SRC]FlowAssembler assembler = new FlowAssembler(builder, bui..erContext())

[MSG]getFlowBuilderContext() can probably be rewritten as flowBuilderContext

➥ FlowBuilder.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2255

[SRC]catch (MissingPropertyException mpe) {

[MSG]The catch block is empty

EmptyCatchBlock2265

[SRC]catch (MissingPropertyException mpe) {

[MSG]The catch block is empty

ExplicitCallToEqualsMethod2400

[SRC]return (name.equals(FLOW_METHOD) && argArray.length == 1..eof Closure)

[MSG]Explicit call to name.equals(FLOW_METHOD) method can be rewritten as name == (FLOW_METHOD)

AbcComplexity2115

[SRC]def invokeMethod(String name, args) {

[MSG]The ABC score for method [invokeMethod] is [83.9]

NestedBlockDepth2262

[SRC]try {

[MSG]The nested block depth is 6

NestedBlockDepth2265

[SRC]catch (MissingPropertyException mpe) {

[MSG]The nested block depth is 6

UnnecessaryGetter299

[SRC]this.metaClass = GroovySystem.getMetaClassRegistry().get..ilder.class)

[MSG]getMetaClassRegistry() can probably be rewritten as metaClassRegistry

UnnecessaryGetter2112

[SRC]super.getContext()

[MSG]getContext() can probably be rewritten as context

UnnecessaryGetter2124

[SRC]Flow flow = super.getFlow()

[MSG]getFlow() can probably be rewritten as flow

UnnecessaryGetter2130

[SRC]FlowArtifactFactory flowFactory = getContext().getFlowAr..actFactory()

[MSG]getFlowArtifactFactory() can probably be rewritten as flowArtifactFactory

UnnecessaryGetter2130

[SRC]FlowArtifactFactory flowFactory = getContext().getFlowAr..actFactory()

[MSG]getContext() can probably be rewritten as context

UnnecessaryGetter2169

[SRC]state = flowFactory.createEndState(name, getFlow(), null..redirectUrl,

[MSG]getFlow() can probably be rewritten as flow

UnnecessaryGetter2198

[SRC]state.getExceptionHandlerSet().add(eh)

[MSG]getExceptionHandlerSet() can probably be rewritten as exceptionHandlerSet

UnnecessaryGetter2204

[SRC]getFlow().setStartState(startFlow)

[MSG]getFlow() can probably be rewritten as flow

UnnecessaryGetter2279

[SRC]getFlow(),

[MSG]getFlow() can probably be rewritten as flow

UnnecessaryGetter2297

[SRC]def controllerClass = flowInfo.subflow.getThisObject().getClass()

[MSG]getThisObject() can probably be rewritten as thisObject

UnnecessaryGetter2309

[SRC]Class controllerClass = flowClosure.getThisObject().getClass()

[MSG]getThisObject() can probably be rewritten as thisObject

UnnecessaryGetter2316

[SRC]return flowFactory.createSubflowState(stateId, getFlow()..on(subflow),

[MSG]getFlow() can probably be rewritten as flow

UnnecessaryGetter2324

[SRC]getFlow(),

[MSG]getFlow() can probably be rewritten as flow

UnnecessaryGetter2334

[SRC]return flowFactory.createEndState(stateId, getFlow(), ge..ntryAction),

[MSG]getFlow() can probably be rewritten as flow

UnnecessaryGetter2341

[SRC]return flowFactory.createEndState(stateId, getFlow(),

[MSG]getFlow() can probably be rewritten as flow

UnnecessaryGetter2354

[SRC]ViewFactory viewFactory = flowBuilderServices.getViewFac..ViewFactory(

[MSG]getViewFactoryCreator() can probably be rewritten as viewFactoryCreator

UnnecessaryGetter2356

[SRC]flowBuilderServices.getExpressionParser(),

[MSG]getExpressionParser() can probably be rewritten as expressionParser

UnnecessaryGetter2357

[SRC]flowBuilderServices.getConversionService(),

[MSG]getConversionService() can probably be rewritten as conversionService

UnnecessaryGetter2455

[SRC]throw new FlowDefinitionException("Event handler in flow..etFlowId() +

[MSG]getFlowId() can probably be rewritten as flowId

UnusedImport333

[SRC]import org.springframework.webflow.definition.registry.F..tionRegistry

MethodSize3115

[MSG]Method "invokeMethod" is 112 lines

➥ RuntimeRedirectAction.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter252

[SRC]return new GroovyShell(new BeanBinding(delegate)).evalua...getValue())

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter269

[SRC]context.getExternalContext().requestExternalRedirect("co..ative:$url")

[MSG]getExternalContext() can probably be rewritten as externalContext

Package: src.jsp21.org.codehaus.groovy.grails.web.pages.ext.jsp

➥ GroovyPagesJspFactory21.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter219

[SRC]def jspCtx = servletContext.getAttribute(GroovyPagesJspA..t.getName())

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter223

[SRC]if(!servletContext.getAttribute(GroovyPagesJspApplicatio..etName())) {

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter225

[SRC]servletContext.setAttribute(GroovyPagesJspApplicationCon..e(), jspCtx)

[MSG]getName() can probably be rewritten as name

➥ GroovyPagesPageContext21.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter232

[SRC]if(JspFactory.getDefaultFactory() == null) {

[MSG]getDefaultFactory() can probably be rewritten as defaultFactory

UnnecessaryGetter241

[SRC]def jspContext = JspFactory.getDefaultFactory().getJspAp..etContext())

[MSG]getDefaultFactory() can probably be rewritten as defaultFactory

UnnecessaryGetter241

[SRC]def jspContext = JspFactory.getDefaultFactory().getJspAp..etContext())

[MSG]getServletContext() can probably be rewritten as servletContext

Package: src.test.grails.ant

➥ GrailsTaskTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod210

[SRC]void testWithClasspath() {

[MSG]The method testWithClasspath is both empty and not marked with @Override

JUnitTestMethodWithoutAssert210

[SRC]void testWithClasspath() {

[MSG]Test method 'testWithClasspath' makes no assertions

Package: src.test.grails.build.eclipse

➥ EclipseClasspathTests.groovy

Rule NamePriorityLine #Source Line / Message
BooleanGetBoolean221

[SRC]if (Boolean.getBoolean("groovy.grails.joint")) return

[MSG]Boolean.getBoolean(String) is a confusing API for reading System properties. Prefer the System.getProperty(String) API.

Package: src.test.grails.persistence

➥ EntityTransformTests.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitHashSetInstantiation258

[SRC]entity.many = new HashSet()

[MSG]HashSet objects are better instantiated using the form "[] as HashSet"

Package: src.test.grails.spring

➥ BeanBuilderTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod2799

[SRC]Object remove(String name) {

[MSG]The method remove is both empty and not marked with @Override

EmptyMethod2803

[SRC]void registerDestructionCallback(String name, Runnable callback) {}

[MSG]The method registerDestructionCallback is both empty and not marked with @Override

JUnitTestMethodWithoutAssert2638

[SRC]void testHolyGrailWiring() {

[MSG]Test method 'testHolyGrailWiring' makes no assertions

JUnitTestMethodWithoutAssert2692

[SRC]void testBeanBuilderWithScript() {

[MSG]Test method 'testBeanBuilderWithScript' makes no assertions

UnusedVariable2635

[SRC]def dataSource = ctx.getBean("dataSource")

[MSG]The variable [dataSource] is not used

UnnecessaryGetter2145

[SRC]GenericApplicationContext appCtx = bb.getSpringConfig()...ionContext()

[MSG]getUnrefreshedApplicationContext() can probably be rewritten as unrefreshedApplicationContext

UnnecessaryGetter2145

[SRC]GenericApplicationContext appCtx = bb.getSpringConfig()...ionContext()

[MSG]getSpringConfig() can probably be rewritten as springConfig

UnnecessaryGetter2146

[SRC]appCtx.getBeanFactory().registerScope("test", scope)

[MSG]getBeanFactory() can probably be rewritten as beanFactory

UnnecessaryGetter2172

[SRC]appCtx = bb.getSpringConfig().getUnrefreshedApplicationContext()

[MSG]getUnrefreshedApplicationContext() can probably be rewritten as unrefreshedApplicationContext

UnnecessaryGetter2172

[SRC]appCtx = bb.getSpringConfig().getUnrefreshedApplicationContext()

[MSG]getSpringConfig() can probably be rewritten as springConfig

UnnecessaryGetter2173

[SRC]appCtx.getBeanFactory().registerScope("test", scope)

[MSG]getBeanFactory() can probably be rewritten as beanFactory

UnnecessaryGetter2236

[SRC]GenericApplicationContext appCtx = bb.getSpringConfig()...ionContext()

[MSG]getUnrefreshedApplicationContext() can probably be rewritten as unrefreshedApplicationContext

UnnecessaryGetter2236

[SRC]GenericApplicationContext appCtx = bb.getSpringConfig()...ionContext()

[MSG]getSpringConfig() can probably be rewritten as springConfig

UnnecessaryGetter2238

[SRC]appCtx.getBeanFactory().registerScope("test", scope)

[MSG]getBeanFactory() can probably be rewritten as beanFactory

UnnecessaryGetter2809

[SRC]objectFactory.getObject()

[MSG]getObject() can probably be rewritten as object

UnnecessarySelfAssignment2308

[SRC]quest = quest

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UnnecessarySelfAssignment2331

[SRC]quest = quest

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

UseAssertTrueInsteadOfAssertEquals3382

[SRC]assertEquals true, bean1.props?.overweight

[MSG]assertEquals can be simplified using assertTrue or assertFalse

Package: src.test.grails.test

➥ ControllerUnitTestCaseTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert210

[SRC]void testControllerClass() {

[MSG]Test method 'testControllerClass' makes no assertions

JUnitTestMethodWithoutAssert217

[SRC]void testExplicitControllerClass() {

[MSG]Test method 'testExplicitControllerClass' makes no assertions

JUnitTestMethodWithoutAssert225

[SRC]void testMockCommandObject() {

[MSG]Test method 'testMockCommandObject' makes no assertions

JUnitTestMethodWithoutAssert232

[SRC]void testGetSetModelAndView() {

[MSG]Test method 'testGetSetModelAndView' makes no assertions

JUnitTestMethodWithoutAssert242

[SRC]void testModelAndView() {

[MSG]Test method 'testModelAndView' makes no assertions

➥ GrailsUnitTestCaseTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper235

[SRC]protected void tearDown() throws Exception {

[MSG]The method tearDown() does not call super.tearDown()

JUnitTestMethodWithoutAssert238

[SRC]void testMockConfig() {

[MSG]Test method 'testMockConfig' makes no assertions

JUnitTestMethodWithoutAssert250

[SRC]void testMockLogging() {

[MSG]Test method 'testMockLogging' makes no assertions

JUnitTestMethodWithoutAssert260

[SRC]void testMockLoggingWithDebugEnabled() {

[MSG]Test method 'testMockLoggingWithDebugEnabled' makes no assertions

JUnitTestMethodWithoutAssert270

[SRC]void testMockDomainErrors() {

[MSG]Test method 'testMockDomainErrors' makes no assertions

JUnitTestMethodWithoutAssert284

[SRC]void testMockForConstraintsTests() {

[MSG]Test method 'testMockForConstraintsTests' makes no assertions

JUnitTestMethodWithoutAssert296

[SRC]void testMockFor() {

[MSG]Test method 'testMockFor' makes no assertions

JUnitTestMethodWithoutAssert2119

[SRC]void testCascadingValidation() {

[MSG]Test method 'testCascadingValidation' makes no assertions

JUnitTestMethodWithoutAssert2126

[SRC]void testMockDynamicMethodsWithInstanceList() {

[MSG]Test method 'testMockDynamicMethodsWithInstanceList' makes no assertions

JUnitTestMethodWithoutAssert2140

[SRC]void testLoadCodec() {

[MSG]Test method 'testLoadCodec' makes no assertions

JUnitTestMethodWithoutAssert2147

[SRC]void testConverters() {

[MSG]Test method 'testConverters' makes no assertions

UnnecessaryObjectReferences2104

[SRC]testCase.tearDown()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2106

[SRC]testCase.setUp()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2107

[SRC]testCase.testMockInterface1()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2108

[SRC]testCase.tearDown()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2110

[SRC]testCase.setUp()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2111

[SRC]testCase.testMockInterface2()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2112

[SRC]testCase.tearDown()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2155

[SRC]testCase.tearDown()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2334

[SRC]log.warn "Test warning with exception", new Exception("s..ent wrong!")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2335

[SRC]log.info "Test info message"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2336

[SRC]log.info "Test info message with exception", new Excepti..ent wrong!")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2337

[SRC]log.debug "Test debug"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2338

[SRC]log.debug "Test debug with exception", new Exception("so..ent wrong!")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2339

[SRC]log.trace "Test trace"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2340

[SRC]log.trace "Test trace with exception", new Exception("so..ent wrong!")

[MSG]The code could be more concise by using a with() or identity() block

UnusedImport320

[SRC]import junit.framework.AssertionFailedError

➥ GrailsUrlMappingsTestCaseTests.groovy

Rule NamePriorityLine #Source Line / Message
EqualsAndHashCode2370

[SRC]class MockUrlMapping implements UrlMapping {

[MSG]The class grails.test.MockUrlMapping defines equals(Object) but not hashCode()

EmptyCatchBlock2205

[SRC]catch (e) {}

[MSG]The catch block is empty

CompareToWithoutComparable2370

[SRC]class MockUrlMapping implements UrlMapping {

[MSG]compareTo method at line 388 would implement Comparable.compareTo(Object) but the enclosing class does not implement Comparable.

EmptyMethod2410

[SRC]void setParameterValues(Map parameterValues) {}

[MSG]The method setParameterValues is both empty and not marked with @Override

EmptyMethod2412

[SRC]void setParseRequest(boolean shouldParse) {

[MSG]The method setParseRequest is both empty and not marked with @Override

EmptyMethod2418

[SRC]void setMappingName(String name) {}

[MSG]The method setMappingName is both empty and not marked with @Override

JUnitPublicNonTestMethod2342

[SRC]def assertView(controller, view, url) {

[MSG]The method assertView is public but not a test method

JUnitTestMethodWithoutAssert259

[SRC]void testSetup() {

[MSG]Test method 'testSetup' makes no assertions

JUnitTestMethodWithoutAssert269

[SRC]void testSetupExplicitMappingClass() {

[MSG]Test method 'testSetupExplicitMappingClass' makes no assertions

JUnitTestMethodWithoutAssert2172

[SRC]void test_GRAILS_3571_Bug() {

[MSG]Test method 'test_GRAILS_3571_Bug' makes no assertions

JUnitTestMethodWithoutAssert2261

[SRC]void testGrails5786() {

[MSG]Test method 'testGrails5786' makes no assertions

UnnecessaryObjectReferences2220

[SRC]test.assertUrlMapping(500, controller: "grailsUrlMapping..: "action1")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2222

[SRC]test.assertForwardUrlMapping("/controllerView", controll..iew: "view")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2231

[SRC]test.assertUrlMapping("/absoluteView", view: "view")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2232

[SRC]test.assertUrlMapping("/absoluteView", view: "/view")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2233

[SRC]test.assertUrlMapping("/absoluteViewWithSlash", view: "view")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2234

[SRC]test.assertUrlMapping("/absoluteViewWithSlash", view: "/view")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2236

[SRC]test.assertUrlMapping("/params/value1/value2", controlle.."action3") {

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2256

[SRC]test.assertUrlMapping("/params/value1", controller: "gra.."action3") {

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2186

[SRC]test.assertUrlMapping("/nonexistent", controller: "grail..stCaseFake")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2190

[SRC]test.assertUrlMapping("/action1", controller: "blah")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2194

[SRC]test.assertUrlMapping("/action1", controller: "grailsUrl..tion: "xxx")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2198

[SRC]test.assertUrlMapping("/action1", action: "action1")

[MSG]The code could be more concise by using a with() or identity() block

UnusedImport316

[SRC]import org.codehaus.groovy.grails.web.mapping.RegexUrlMapping

UnusedImport319

[SRC]import org.codehaus.groovy.grails.web.mapping.AbstractUrlMapping

UnusedImport313

[SRC]import org.codehaus.groovy.grails.web.mapping.DefaultUrlMappingsHolder

➥ MockDomainWithInheritanceTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper214

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

JUnitTearDownCallsSuper234

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

JUnitTestMethodWithoutAssert218

[SRC]void testMockDomainWithInheritance() {

[MSG]Test method 'testMockDomainWithInheritance' makes no assertions

➥ MockForTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert211

[SRC]void testUnregisteredMockedStaticMethods() {

[MSG]Test method 'testUnregisteredMockedStaticMethods' makes no assertions

UnnecessaryObjectReferences219

[SRC]testcase.tearDown()

[MSG]The code could be more concise by using a with() or identity() block

➥ MockUtilsAndHasManyTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper214

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper219

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

JUnitTearDownCallsSuper233

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

JUnitTestMethodWithoutAssert223

[SRC]void testMockDomainWithHasMany() {

[MSG]Test method 'testMockDomainWithHasMany' makes no assertions

➥ MockUtilsDeleteDomainTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper230

[SRC]void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper235

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

➥ MockUtilsSaveDomainTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper234

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper241

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnusedVariable278

[SRC]def domain1 = new TestDomainWithUUID(name: "Alice Doe", ..: 35).save()

[MSG]The variable [domain1] is not used

➥ MockUtilsTests.groovy

Rule NamePriorityLine #Source Line / Message
BooleanMethodReturnsNull21569

[SRC]if (!(obj instanceof TestDomain)) return null

[MSG]Returning null from a method that might return a Boolean

BooleanMethodReturnsNull21625

[SRC]if (!(obj instanceof TestDomainWithUUID)) return null

[MSG]Returning null from a method that might return a Boolean

BooleanMethodReturnsNull21655

[SRC]if (!(obj instanceof TestDomainWithAssignedId)) return null

[MSG]Returning null from a method that might return a Boolean

EqualsAndHashCode21516

[SRC]class TestDomain {

[MSG]The class grails.test.TestDomain defines equals(Object) but not hashCode()

EqualsAndHashCode21612

[SRC]class TestDomainWithUUID {

[MSG]The class grails.test.TestDomainWithUUID defines equals(Object) but not hashCode()

UseAssertFalseInsteadOfNegation21078

[SRC]assertTrue !model

[MSG]assertTrue(!model) can be simplified to assertFalse(model)

AbcComplexity2119

[SRC]void testDynamicFinders() {

[MSG]The ABC score for method [testDynamicFinders] is [82.3]

AbcComplexity2578

[SRC]void testConstraintValidation() {

[MSG]The ABC score for method [testConstraintValidation] is [96.4]

MethodCount233

[SRC]class MockUtilsTests extends GroovyTestCase {

[MSG]Class grails.test.MockUtilsTests has 56 methods

UnnecessaryObjectReferences2843

[SRC]controller.render(template: "fragment", collection: [], model: [:])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences21145

[SRC]cmd.validate()

[MSG]The code could be more concise by using a with() or identity() block

ClassSize333

[MSG]Class "MockUtilsTests" is 1389 lines

MethodSize3119

[MSG]Method "testDynamicFinders" is 111 lines

MethodSize3578

[MSG]Method "testConstraintValidation" is 108 lines

➥ TagLibUnitTestCaseTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert28

[SRC]void testTagThatPopulatesPageScope() {

[MSG]Test method 'testTagThatPopulatesPageScope' makes no assertions

JUnitTestMethodWithoutAssert216

[SRC]void testTagThatAccessesPageScope() {

[MSG]Test method 'testTagThatAccessesPageScope' makes no assertions

Package: src.test.grails.util

➥ BuildScopeTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper29

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter214

[SRC]assertEquals BuildScope.ALL, BuildScope.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter218

[SRC]assertEquals BuildScope.WAR, BuildScope.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

➥ BuildSettingsTests.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitHashMapInstantiation224

[SRC]savedSystemProps = new HashMap()

[MSG]HashMap objects are better instantiated using the form "[] as HashMap"

EmptyMethod2284

[SRC]void receiveGrailsBuildEvent(String name, Object[] args) {}

[MSG]The method receiveGrailsBuildEvent is both empty and not marked with @Override

JUnitSetUpCallsSuper214

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper227

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

AbcComplexity2145

[SRC]void testExplicitValues() {

[MSG]The ABC score for method [testExplicitValues] is [65.3]

➥ EnvironmentTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper29

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryObjectReferences2201

[SRC]System.setProperty(Environment.RELOAD_LOCATION, ".")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter214

[SRC]Metadata.getCurrent().clear()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter220

[SRC]assertEquals Environment.PRODUCTION, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter251

[SRC]assertEquals Environment.DEVELOPMENT, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter268

[SRC]assertEquals Environment.CUSTOM, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter288

[SRC]assertEquals Environment.PRODUCTION, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2107

[SRC]assertEquals Environment.DEVELOPMENT, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2126

[SRC]assertEquals Environment.CUSTOM, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2148

[SRC]assertEquals Environment.PRODUCTION, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2151

[SRC]assertEquals Environment.DEVELOPMENT, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2154

[SRC]assertEquals Environment.CUSTOM, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2169

[SRC]assertEquals Environment.PRODUCTION, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2172

[SRC]assertEquals Environment.DEVELOPMENT, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2175

[SRC]assertEquals Environment.PRODUCTION, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2178

[SRC]assertEquals Environment.DEVELOPMENT, Environment.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2186

[SRC]assertFalse "reload should be disabled by default in pro..oadEnabled()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2189

[SRC]assertFalse "reload should be disabled by default in dev..oadEnabled()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2192

[SRC]assertTrue "reload should be enabled by default in devel..oadEnabled()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2196

[SRC]assertFalse "reload should be disabled by default in pro..oadEnabled()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2199

[SRC]assertFalse "reload should be disabled by default in pro..oadEnabled()

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter2202

[SRC]assertTrue "reload should be enabled by default in produ..oadEnabled()

[MSG]getCurrent() can probably be rewritten as current

➥ GrailsWebUtilTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod28

[SRC]void testMakeMockRequest() {

[MSG]The method testMakeMockRequest is both empty and not marked with @Override

JUnitTestMethodWithoutAssert28

[SRC]void testMakeMockRequest() {

[MSG]Test method 'testMakeMockRequest' makes no assertions

➥ MetadataTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter215

[SRC]assertEquals "1.1", m.getInstalledPlugins().tomcat

[MSG]getInstalledPlugins() can probably be rewritten as installedPlugins

UnnecessaryGetter216

[SRC]assertEquals "1.2", m.getInstalledPlugins().hibernate

[MSG]getInstalledPlugins() can probably be rewritten as installedPlugins

➥ PluginBuildSettingsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod219

[SRC]PluginBuildSettings createPluginBuildSettings(File proje.._PROJ_DIR) {

[MSG]The method createPluginBuildSettings is public but not a test method

UseAssertFalseInsteadOfNegation2259

[SRC]assertTrue("should not be a plugin-two dir in same dir a..pp.exists())

[MSG]assertTrue(!pluginTwoInSameDirAsRootApp.exists()) can be simplified to assertFalse(pluginTwoInSameDirAsRootApp.exists())

UnnecessaryGetter261

[SRC]def sourceFiles = pluginSettings.getPluginSourceFiles()

[MSG]getPluginSourceFiles() can probably be rewritten as pluginSourceFiles

UnnecessaryGetter293

[SRC]assertEquals 2, pluginSettings.getPluginLibDirectories().size()

[MSG]getPluginLibDirectories() can probably be rewritten as pluginLibDirectories

UnnecessaryGetter294

[SRC]assertEquals 2, pluginSettings.getPluginLibDirectories().size()

[MSG]getPluginLibDirectories() can probably be rewritten as pluginLibDirectories

UnnecessaryGetter299

[SRC]assertEquals 2, pluginSettings.getPluginDescriptors().size()

[MSG]getPluginDescriptors() can probably be rewritten as pluginDescriptors

UnnecessaryGetter2100

[SRC]assertEquals 2, pluginSettings.getPluginDescriptors().size()

[MSG]getPluginDescriptors() can probably be rewritten as pluginDescriptors

UnnecessaryGetter2107

[SRC]assertEquals 6, pluginSettings.getArtefactResources().size()

[MSG]getArtefactResources() can probably be rewritten as artefactResources

UnnecessaryGetter2108

[SRC]assertEquals 6, pluginSettings.getArtefactResources().size()

[MSG]getArtefactResources() can probably be rewritten as artefactResources

UnnecessaryGetter2113

[SRC]def scripts = pluginSettings.getAvailableScripts()

[MSG]getAvailableScripts() can probably be rewritten as availableScripts

UnnecessaryGetter2125

[SRC]def scripts = pluginSettings.getPluginScripts()

[MSG]getPluginScripts() can probably be rewritten as pluginScripts

UnnecessaryGetter2133

[SRC]assertEquals 2, pluginSettings.getPluginXmlMetadata().size()

[MSG]getPluginXmlMetadata() can probably be rewritten as pluginXmlMetadata

UnnecessaryGetter2134

[SRC]assertEquals 2, pluginSettings.getPluginXmlMetadata().size()

[MSG]getPluginXmlMetadata() can probably be rewritten as pluginXmlMetadata

UnnecessaryGetter2140

[SRC]def pluginInfos = pluginSettings.getPluginInfos()

[MSG]getPluginInfos() can probably be rewritten as pluginInfos

UnnecessaryGetter2159

[SRC]def pluginDirs = createPluginBuildSettings().getImplicit..irectories()

[MSG]getImplicitPluginDirectories() can probably be rewritten as implicitPluginDirectories

UnnecessaryGetter2181

[SRC]def pluginDirs = pluginSettings.getPluginDirectories()

[MSG]getPluginDirectories() can probably be rewritten as pluginDirectories

UnnecessaryGetter2264

[SRC]def pluginInfos = pluginSettings.getPluginInfos()

[MSG]getPluginInfos() can probably be rewritten as pluginInfos

UseAssertEqualsInsteadOfAssertTrue364

[SRC]assertFalse("There should be no .svn directory", it.file..e == '.svn')

[MSG]Replace assertFalse with a call to assertEquals()

UseAssertEqualsInsteadOfAssertTrue365

[SRC]assertFalse("There should be no CVS directory", it.file.name == 'CVS')

[MSG]Replace assertFalse with a call to assertEquals()

Package: src.test.org.codehaus.groovy.grails.cli

➥ AbstractCliTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper242

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper251

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

AbcComplexity286

[SRC]protected void gantRun(String scriptName) {

[MSG]The ABC score for method [gantRun] is [72.9]

UnnecessaryObjectReferences2100

[SRC]settings.resourcesDir = new File("$projectDir/resources")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2101

[SRC]settings.testClassesDir = new File("$projectDir/test-classes")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2102

[SRC]settings.projectPluginsDir = new File("$projectDir/plugins")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2103

[SRC]settings.globalPluginsDir = new File("$workDir/global-plugins")

[MSG]The code could be more concise by using a with() or identity() block

Package: src.test.org.codehaus.groovy.grails.cli.support

➥ GrailsBuildHelperTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert213

[SRC]void testSetDepedenciesExternallyConfigured() {

[MSG]Test method 'testSetDepedenciesExternallyConfigured' makes no assertions

AbcComplexity231

[SRC]void testExecutionWithCustomSettings() {

[MSG]The ABC score for method [testExecutionWithCustomSettings] is [60.9]

UnnecessaryObjectReferences242

[SRC]testHelper.projectPluginsDir = new File("plugins")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences243

[SRC]testHelper.globalPluginsDir = new File("global-work/plugins")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences244

[SRC]testHelper.testReportsDir = new File("target/test-reports")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences245

[SRC]testHelper.compileDependencies = testCompileDeps

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences246

[SRC]testHelper.testDependencies = testTestDeps

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences247

[SRC]testHelper.runtimeDependencies = testRuntimeDeps

[MSG]The code could be more concise by using a with() or identity() block

➥ JndiBindingSupportTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import javax.naming.Context

UnusedImport35

[SRC]import javax.naming.spi.ObjectFactory

Package: src.test.org.codehaus.groovy.grails.commons

➥ DefaultArtefactInfoTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity29

[SRC]void testAddGrailsClass() {

[MSG]The ABC score for method [testAddGrailsClass] is [76.4]

AbcComplexity27

[SRC]class DefaultArtefactInfoTests extends GroovyTestCase {

[MSG]The ABC score for class [org.codehaus.groovy.grails.commons.DefaultArtefactInfoTests] is [76.4]

➥ DefaultGrailsCodecClassTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper29

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper213

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter219

[SRC]assertEquals "encoded", codecClass.getEncodeMethod().call("stuff")

[MSG]getEncodeMethod() can probably be rewritten as encodeMethod

UnnecessaryGetter220

[SRC]assertEquals "decoded", codecClass.getDecodeMethod().call("stuff")

[MSG]getDecodeMethod() can probably be rewritten as decodeMethod

➥ DefaultGrailsDomainClassPropertyTests.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToEqualsMethod224

[SRC]assertTrue(prop1Child.equals(prop1Child))

[MSG]Explicit call to prop1Child.equals(prop1Child) method can be rewritten as prop1Child == (prop1Child)

ExplicitCallToEqualsMethod228

[SRC]assertTrue(prop1Parent.equals(prop1Child))

[MSG]Explicit call to prop1Parent.equals(prop1Child) method can be rewritten as prop1Parent == (prop1Child)

ExplicitCallToEqualsMethod229

[SRC]assertTrue(prop1Child.equals(prop1Parent))

[MSG]Explicit call to prop1Child.equals(prop1Parent) method can be rewritten as prop1Child == (prop1Parent)

ExplicitCallToEqualsMethod233

[SRC]assertFalse(prop1Child.equals(prop2Child))

[MSG]Explicit call to prop1Child.equals(prop2Child) method can be rewritten as prop1Child == (prop2Child)

ExplicitCallToEqualsMethod234

[SRC]assertFalse(prop2Child.equals(prop1Child))

[MSG]Explicit call to prop2Child.equals(prop1Child) method can be rewritten as prop2Child == (prop1Child)

ExplicitCallToEqualsMethod238

[SRC]assertFalse(prop2Child.equals(prop1Parent))

[MSG]Explicit call to prop2Child.equals(prop1Parent) method can be rewritten as prop2Child == (prop1Parent)

ExplicitCallToEqualsMethod239

[SRC]assertFalse(prop1Parent.equals(prop2Child))

[MSG]Explicit call to prop1Parent.equals(prop2Child) method can be rewritten as prop1Parent == (prop2Child)

ExplicitCallToEqualsMethod243

[SRC]assertFalse(prop1Child.equals(null))

[MSG]Explicit call to prop1Child.equals(null) method can be rewritten as prop1Child == (null)

ExplicitCallToEqualsMethod244

[SRC]assertFalse(prop1Child.equals("Not a property"))

[MSG]Explicit call to prop1Child.equals(Not a property) method can be rewritten as prop1Child == (Not a property)

JUnitSetUpCallsSuper213

[SRC]void setUp() {

[MSG]The method setUp() does not call super.setUp()

UnnecessaryGroovyImport33

[SRC]import groovy.util.GroovyTestCase

➥ DefaultGrailsDomainClassTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2336

[SRC]catch(InvalidPropertyException ipe) {

[MSG]The catch block is empty

ExplicitCallToEqualsMethod2193

[SRC]assertTrue(dc.getPropertyByName("children").getOtherSide..("parent")))

[MSG]Explicit call to dc.getPropertyByName(children).getOtherSide().equals(dc.getPropertyByName(parent)) method can be rewritten as dc.getPropertyByName(children).getOtherSide() == (dc.getPropertyByName(parent))

ExplicitCallToEqualsMethod2194

[SRC]assertTrue(dc.getPropertyByName("parent").getOtherSide()..children")))

[MSG]Explicit call to dc.getPropertyByName(parent).getOtherSide().equals(dc.getPropertyByName(children)) method can be rewritten as dc.getPropertyByName(parent).getOtherSide() == (dc.getPropertyByName(children))

ExplicitHashMapInstantiation2185

[SRC]Map domainMap = new HashMap()

[MSG]HashMap objects are better instantiated using the form "[] as HashMap"

UnnecessaryGetter251

[SRC]assertEquals(GrailsDomainClassProperty.FETCH_EAGER, test..FetchMode())

[MSG]getFetchMode() can probably be rewritten as fetchMode

UnnecessaryGetter254

[SRC]assertEquals(GrailsDomainClassProperty.FETCH_LAZY, other..FetchMode())

[MSG]getFetchMode() can probably be rewritten as fetchMode

UnnecessaryGetter2186

[SRC]domainMap.put(dc.getFullName(),dc)

[MSG]getFullName() can probably be rewritten as fullName

UnnecessaryGetter2193

[SRC]assertTrue(dc.getPropertyByName("children").getOtherSide..("parent")))

[MSG]getOtherSide() can probably be rewritten as otherSide

UnnecessaryGetter2194

[SRC]assertTrue(dc.getPropertyByName("parent").getOtherSide()..children")))

[MSG]getOtherSide() can probably be rewritten as otherSide

UnnecessaryGetter2242

[SRC]assertEquals(c1dc.getPropertyByName("ones").getOtherSide..me("other"))

[MSG]getOtherSide() can probably be rewritten as otherSide

UnnecessaryGetter2249

[SRC]assertEquals(c2dc.getPropertyByName("other").getOtherSid..ame("ones"))

[MSG]getOtherSide() can probably be rewritten as otherSide

UnnecessaryGetter2284

[SRC]assertEquals("bottom class had wrong number of persisten..es().length)

[MSG]getPersistentProperties() can probably be rewritten as persistentProperties

UnnecessaryGetter2285

[SRC]assertEquals("middle class had wrong number of persisten..es().length)

[MSG]getPersistentProperties() can probably be rewritten as persistentProperties

UnnecessaryGetter2286

[SRC]assertEquals("top class had wrong number of persistent p..es().length)

[MSG]getPersistentProperties() can probably be rewritten as persistentProperties

UnnecessaryGetter2326

[SRC]assertEquals("UserTest",domainClass.getName())

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2328

[SRC]assertNotNull(domainClass.getIdentifier())

[MSG]getIdentifier() can probably be rewritten as identifier

UnnecessaryGetter2329

[SRC]assertNotNull(domainClass.getVersion())

[MSG]getVersion() can probably be rewritten as version

UnnecessaryGetter2330

[SRC]assertTrue(domainClass.getIdentifier().isIdentity())

[MSG]getIdentifier() can probably be rewritten as identifier

UnnecessaryGetter2354

[SRC]GrailsDomainClassProperty[] persistantProperties = domai..Properties()

[MSG]getPersistentProperties() can probably be rewritten as persistentProperties

➥ GrailsMetaClassUtilsTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter215

[SRC]assertNotNull(GrailsMetaClassUtils.getRegistry())

[MSG]getRegistry() can probably be rewritten as registry

UnnecessaryGetter239

[SRC]assertEquals "bar", d.getFoo()

[MSG]getFoo() can probably be rewritten as foo

UnnecessaryGetter248

[SRC]assertEquals "bar", d.getFoo()

[MSG]getFoo() can probably be rewritten as foo

➥ GrailsPluginManagerDescriptorTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert28

[SRC]void testDoWithWebDescriptor() {

[MSG]Test method 'testDoWithWebDescriptor' makes no assertions

UnusedVariable220

[SRC]def xml = new XmlSlurper().parseText(text)

[MSG]The variable [xml] is not used

➥ GrailsPluginManagerTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2135

[SRC]catch (PluginException pe) {

[MSG]The catch block is empty

JUnitTestMethodWithoutAssert2123

[SRC]void testWithLoadLastPlugin() throws Exception {

[MSG]Test method 'testWithLoadLastPlugin' makes no assertions

JUnitTestMethodWithoutAssert2140

[SRC]void testDependencyResolutionSucces() throws Exception {

[MSG]Test method 'testDependencyResolutionSucces' makes no assertions

UnnecessaryGetter2104

[SRC]assertEquals(1, manager.getPluginResources().length)

[MSG]getPluginResources() can probably be rewritten as pluginResources

UnnecessaryGetter2113

[SRC]assertEquals("classEditor",plugin.getName())

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2114

[SRC]assertEquals("1.1", plugin.getVersion())

[MSG]getVersion() can probably be rewritten as version

UnnecessaryGetter2159

[SRC]def ctx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnnecessaryGetter2177

[SRC]def ctx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnusedImport39

[SRC]import org.springframework.context.support.GenericApplicationContext

Package: src.test.org.codehaus.groovy.grails.commons.metaclass

➥ DynamicMethodsExpandoMetaClassTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter276

[SRC]assertEquals "bar", b.getFoo()

[MSG]getFoo() can probably be rewritten as foo

UnusedImport318

[SRC]import org.springframework.beans.BeanUtils

➥ LazyMetaPropertyMapTests.groovy

Rule NamePriorityLine #Source Line / Message
CoupledTestCase211

[SRC]def obj = new PropertyMapTest(name:"Homer", age:45)

[MSG]new PropertyMapTest([name:Homer, age:45]) creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

CoupledTestCase219

[SRC]def map = new LazyMetaPropertyMap(new PropertyMapTest(na..er:"stuff"))

[MSG]new PropertyMapTest([name:Bart, age:11, other:stuff]) creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

CoupledTestCase228

[SRC]def map = new LazyMetaPropertyMap(new PropertyMapTest())

[MSG]new PropertyMapTest() creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

CoupledTestCase233

[SRC]def map = new LazyMetaPropertyMap(new PropertyMapTest())

[MSG]new PropertyMapTest() creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

CoupledTestCase238

[SRC]def map = new LazyMetaPropertyMap(new PropertyMapTest())

[MSG]new PropertyMapTest() creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

CoupledTestCase246

[SRC]def map = new LazyMetaPropertyMap(new PropertyMapTest(na..r", age:45))

[MSG]new PropertyMapTest([name:Homer, age:45]) creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

CoupledTestCase254

[SRC]def map = new LazyMetaPropertyMap(new PropertyMapTest(na..r", age:45))

[MSG]new PropertyMapTest([name:Homer, age:45]) creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

CoupledTestCase270

[SRC]def map = new LazyMetaPropertyMap(new PropertyMapTest(na..t", age:11))

[MSG]new PropertyMapTest([name:Bart, age:11]) creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

CoupledTestCase285

[SRC]def map = new LazyMetaPropertyMap(new PropertyMapTest(na..t", age:11))

[MSG]new PropertyMapTest([name:Bart, age:11]) creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

CoupledTestCase295

[SRC]def map = new LazyMetaPropertyMap(new PropertyMapTest(na..t", age:11))

[MSG]new PropertyMapTest([name:Bart, age:11]) creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

Package: src.test.org.codehaus.groovy.grails.compiler

➥ GrailsClassLoaderTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter232

[SRC]assert e == gcl.getCompilationError() : "should have sto..ation error"

[MSG]getCompilationError() can probably be rewritten as compilationError

UnnecessaryGetter238

[SRC]assert !gcl.getCompilationError() : "shouldn't have any ..tion errors"

[MSG]getCompilationError() can probably be rewritten as compilationError

UnusedImport34

[SRC]import org.codehaus.groovy.grails.compiler.support.Grail..sourceLoader

UnusedImport33

[SRC]import org.codehaus.groovy.control.CompilerConfiguration

Package: src.test.org.codehaus.groovy.grails.context.support

➥ PluginAwareResourceBundleMessageSourceTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper216

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper220

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter217

[SRC]Metadata.getCurrent().put(Metadata.WAR_DEPLOYED, "true")

[MSG]getCurrent() can probably be rewritten as current

UnnecessaryGetter221

[SRC]Metadata.getCurrent().put(Metadata.WAR_DEPLOYED, "")

[MSG]getCurrent() can probably be rewritten as current

Package: src.test.org.codehaus.groovy.grails.documentation

➥ MetadataGeneratingExpandoMetaClassTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity213

[SRC]void testGeneratedMetadata() {

[MSG]The ABC score for method [testGeneratedMetadata] is [69.0]

AbcComplexity211

[SRC]class MetadataGeneratingExpandoMetaClassTests extends GroovyTestCase {

[MSG]The ABC score for class [org.codehaus.groovy.grails.documentation.MetadataGeneratingExpandoMetaClassTests] is [69.0]

UnusedImport33

[SRC]import groovy.xml.StreamingMarkupBuilder

UnusedImport35

[SRC]import org.codehaus.groovy.grails.commons.ControllerArtefactHandler

Package: src.test.org.codehaus.groovy.grails.orm.hibernate

➥ AbstractGrailsHibernateTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock2158

[SRC]catch(e) {

[MSG]The catch block is empty

EmptyCatchBlock2164

[SRC]catch(e) {

[MSG]The catch block is empty

UnnecessaryGetter278

[SRC]ga = new DefaultGrailsApplication(gcl.getLoadedClasses(), gcl)

[MSG]getLoadedClasses() can probably be rewritten as loadedClasses

UnnecessaryGetter2118

[SRC]appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnnecessaryGetter2150

[SRC]GroovySystem.getMetaClassRegistry().removeMetaClass(meta..yMode.POJO))

[MSG]getMetaClassRegistry() can probably be rewritten as metaClassRegistry

UnnecessaryGetter2162

[SRC]CacheManager.getInstance()?.shutdown()

[MSG]getInstance() can probably be rewritten as instance

➥ AssertionFailureInEventTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert242

[SRC]void testNoAssertionErrorInEvent() {

[MSG]Test method 'testNoAssertionErrorInEvent' makes no assertions

➥ AutoImportPackedDomainTests.groovy

Rule NamePriorityLine #Source Line / Message
UseAssertEqualsInsteadOfAssertTrue343

[SRC]assertTrue models.size() == 1

[MSG]Replace assertTrue with a call to assertEquals()

UseAssertEqualsInsteadOfAssertTrue346

[SRC]assertTrue models.size() == 1

[MSG]Replace assertTrue with a call to assertEquals()

UseAssertEqualsInsteadOfAssertTrue349

[SRC]assertTrue models.size() == 1

[MSG]Replace assertTrue with a call to assertEquals()

➥ BidirectionalHasOneMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert227

[SRC]void testRefreshHasOneAssociation() {

[MSG]Test method 'testRefreshHasOneAssociation' makes no assertions

➥ BidirectionalListMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper238

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

AbcComplexity277

[SRC]void testIndexBackrefMapping() {

[MSG]The ABC score for method [testIndexBackrefMapping] is [62.1]

AbcComplexity2115

[SRC]void testCollectionBackrefMapping() {

[MSG]The ABC score for method [testCollectionBackrefMapping] is [89.1]

AbcComplexity2238

[SRC]void testListMapping() {

[MSG]The ABC score for method [testListMapping] is [148.2]

UnusedVariable278

[SRC]PersistentClass faqSection = config.getClassMapping("TestFaqSection")

[MSG]The variable [faqSection] is not used

UnusedVariable2116

[SRC]PersistentClass faqSection = config.getClassMapping("TestFaqSection")

[MSG]The variable [faqSection] is not used

UnusedVariable2166

[SRC]PersistentClass faqSection = config.getClassMapping("TestFaqSection")

[MSG]The variable [faqSection] is not used

UnusedVariable2188

[SRC]PersistentClass faqSection = config.getClassMapping("TestFaqSection")

[MSG]The variable [faqSection] is not used

UnusedVariable2207

[SRC]PersistentClass faqSection = config.getClassMapping("TestFaqSection")

[MSG]The variable [faqSection] is not used

UnusedVariable2295

[SRC]SimpleValue indexColumnValue = indexColumn.getValue()

[MSG]The variable [indexColumnValue] is not used

UnnecessaryGetter293

[SRC]assertNull elementsIndexBackref.getCascade()

[MSG]getCascade() can probably be rewritten as cascade

UnnecessaryGetter294

[SRC]assertEquals CascadeStyle.NONE, elementsIndexBackref.getCascadeStyle()

[MSG]getCascadeStyle() can probably be rewritten as cascadeStyle

UnnecessaryGetter295

[SRC]assertEquals "TestFaqSection.elements", elementsIndexBa..ectionRole()

[MSG]getCollectionRole() can probably be rewritten as collectionRole

UnnecessaryGetter296

[SRC]assertEquals 1, elementsIndexBackref.getColumnSpan()

[MSG]getColumnSpan() can probably be rewritten as columnSpan

UnnecessaryGetter297

[SRC]assertEquals "TestFaqSection", elementsIndexBackref.getEntityName()

[MSG]getEntityName() can probably be rewritten as entityName

UnnecessaryGetter298

[SRC]assertEquals PropertyGeneration.NEVER, elementsIndexBack..Generation()

[MSG]getGeneration() can probably be rewritten as generation

UnnecessaryGetter299

[SRC]assertEquals "_elementsIndexBackref", elementsIndexBackref.getName()

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2100

[SRC]assertNull elementsIndexBackref.getNodeName()

[MSG]getNodeName() can probably be rewritten as nodeName

UnnecessaryGetter2101

[SRC]assertNull elementsIndexBackref.getPropertyAccessorName()

[MSG]getPropertyAccessorName() can probably be rewritten as propertyAccessorName

UnnecessaryGetter2102

[SRC]assertEquals IntegerType, elementsIndexBackref.getType().getClass()

[MSG]getType() can probably be rewritten as type

UnnecessaryGetter2103

[SRC]assertEquals SimpleValue, elementsIndexBackref.getValue().getClass()

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2105

[SRC]SimpleValue value = elementsIndexBackref.getValue()

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2131

[SRC]assertNull elementsBackref.getCascade()

[MSG]getCascade() can probably be rewritten as cascade

UnnecessaryGetter2132

[SRC]assertEquals CascadeStyle.NONE, elementsBackref.getCascadeStyle()

[MSG]getCascadeStyle() can probably be rewritten as cascadeStyle

UnnecessaryGetter2133

[SRC]assertEquals "TestFaqSection.elements", elementsBackref...ectionRole()

[MSG]getCollectionRole() can probably be rewritten as collectionRole

UnnecessaryGetter2134

[SRC]assertEquals 1, elementsBackref.getColumnSpan()

[MSG]getColumnSpan() can probably be rewritten as columnSpan

UnnecessaryGetter2135

[SRC]assertEquals "TestFaqSection", elementsBackref.getEntityName()

[MSG]getEntityName() can probably be rewritten as entityName

UnnecessaryGetter2136

[SRC]assertEquals PropertyGeneration.NEVER, elementsBackref.getGeneration()

[MSG]getGeneration() can probably be rewritten as generation

UnnecessaryGetter2137

[SRC]assertEquals "_TestFaqSection_elementsBackref", elements..ef.getName()

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2138

[SRC]assertNull elementsBackref.getNodeName()

[MSG]getNodeName() can probably be rewritten as nodeName

UnnecessaryGetter2139

[SRC]assertEquals "TestFaqElement", elementsBackref.getPersis..tClassName()

[MSG]getClassName() can probably be rewritten as className

UnnecessaryGetter2139

[SRC]assertEquals "TestFaqElement", elementsBackref.getPersis..tClassName()

[MSG]getPersistentClass() can probably be rewritten as persistentClass

UnnecessaryGetter2140

[SRC]assertNull elementsBackref.getPropertyAccessorName()

[MSG]getPropertyAccessorName() can probably be rewritten as propertyAccessorName

UnnecessaryGetter2141

[SRC]assertEquals LongType, elementsBackref.getType().getClass()

[MSG]getType() can probably be rewritten as type

UnnecessaryGetter2142

[SRC]assertEquals DependantValue, elementsBackref.getValue().getClass()

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2144

[SRC]DependantValue value = elementsBackref.getValue()

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2152

[SRC]assertEquals 1,value.getColumnInsertability().size()

[MSG]getColumnInsertability() can probably be rewritten as columnInsertability

UnnecessaryGetter2153

[SRC]assertTrue value.getColumnInsertability()[0]

[MSG]getColumnInsertability() can probably be rewritten as columnInsertability

UnnecessaryGetter2154

[SRC]assertEquals 1,value.getColumnUpdateability().size()

[MSG]getColumnUpdateability() can probably be rewritten as columnUpdateability

UnnecessaryGetter2155

[SRC]assertTrue value.getColumnUpdateability()[0]

[MSG]getColumnUpdateability() can probably be rewritten as columnUpdateability

UnnecessaryGetter2157

[SRC]assertEquals 1, value.getColumnSpan()

[MSG]getColumnSpan() can probably be rewritten as columnSpan

UnnecessaryGetter2158

[SRC]assertEquals FetchMode.SELECT, value.getFetchMode()

[MSG]getFetchMode() can probably be rewritten as fetchMode

UnnecessaryGetter2159

[SRC]assertNull value.getForeignKeyName()

[MSG]getForeignKeyName() can probably be rewritten as foreignKeyName

UnnecessaryGetter2160

[SRC]assertEquals "assigned", value.getIdentifierGeneratorStrategy()

[MSG]getIdentifierGeneratorStrategy() can probably be rewritten as identifierGeneratorStrategy

UnnecessaryGetter2161

[SRC]assertNull value.getNullValue()

[MSG]getNullValue() can probably be rewritten as nullValue

UnnecessaryGetter2162

[SRC]assertEquals LongType, value.getType().getClass()

[MSG]getType() can probably be rewritten as type

UnnecessaryGetter2180

[SRC]assertEquals "none", section.getCascade()

[MSG]getCascade() can probably be rewritten as cascade

UnnecessaryGetter2181

[SRC]assertEquals CascadeStyle.NONE, section.getCascadeStyle()

[MSG]getCascadeStyle() can probably be rewritten as cascadeStyle

UnnecessaryGetter2182

[SRC]assertEquals 1, section.getColumnSpan()

[MSG]getColumnSpan() can probably be rewritten as columnSpan

UnnecessaryGetter2183

[SRC]assertEquals PropertyGeneration.NEVER, section.getGeneration()

[MSG]getGeneration() can probably be rewritten as generation

UnnecessaryGetter2184

[SRC]assertEquals "section", section.getName()

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2191

[SRC]Column sectionColumn = section.getColumnIterator().next()

[MSG]getColumnIterator() can probably be rewritten as columnIterator

UnnecessaryGetter2193

[SRC]assertEquals "section_id", sectionColumn.getCanonicalName()

[MSG]getCanonicalName() can probably be rewritten as canonicalName

UnnecessaryGetter2194

[SRC]assertNull sectionColumn.getCheckConstraint()

[MSG]getCheckConstraint() can probably be rewritten as checkConstraint

UnnecessaryGetter2195

[SRC]assertNull sectionColumn.getComment()

[MSG]getComment() can probably be rewritten as comment

UnnecessaryGetter2196

[SRC]assertNull sectionColumn.getDefaultValue()

[MSG]getDefaultValue() can probably be rewritten as defaultValue

UnnecessaryGetter2197

[SRC]assertEquals 255, sectionColumn.getLength()

[MSG]getLength() can probably be rewritten as length

UnnecessaryGetter2198

[SRC]assertEquals "section_id", sectionColumn.getName()

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2199

[SRC]assertEquals 19, sectionColumn.getPrecision()

[MSG]getPrecision() can probably be rewritten as precision

UnnecessaryGetter2200

[SRC]assertEquals "section_id", sectionColumn.getQuotedName()

[MSG]getQuotedName() can probably be rewritten as quotedName

UnnecessaryGetter2201

[SRC]assertEquals 2, sectionColumn.getScale()

[MSG]getScale() can probably be rewritten as scale

UnnecessaryGetter2202

[SRC]assertEquals "section_id", sectionColumn.getText()

[MSG]getText() can probably be rewritten as text

UnnecessaryGetter2203

[SRC]assertEquals 0, sectionColumn.getTypeIndex()

[MSG]getTypeIndex() can probably be rewritten as typeIndex

UnnecessaryGetter2211

[SRC]ManyToOne manyToOne = section.getValue()

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2212

[SRC]assertEquals 1,manyToOne.getColumnInsertability().size()

[MSG]getColumnInsertability() can probably be rewritten as columnInsertability

UnnecessaryGetter2213

[SRC]assertTrue manyToOne.getColumnInsertability()[0]

[MSG]getColumnInsertability() can probably be rewritten as columnInsertability

UnnecessaryGetter2214

[SRC]assertEquals 1,manyToOne.getColumnUpdateability().size()

[MSG]getColumnUpdateability() can probably be rewritten as columnUpdateability

UnnecessaryGetter2215

[SRC]assertTrue manyToOne.getColumnUpdateability()[0]

[MSG]getColumnUpdateability() can probably be rewritten as columnUpdateability

UnnecessaryGetter2227

[SRC]assertEquals 1, manyToOne.getConstraintColumns().size()

[MSG]getConstraintColumns() can probably be rewritten as constraintColumns

UnnecessaryGetter2228

[SRC]assertEquals FetchMode.DEFAULT, manyToOne.getFetchMode()

[MSG]getFetchMode() can probably be rewritten as fetchMode

UnnecessaryGetter2229

[SRC]assertNull manyToOne.getForeignKeyName()

[MSG]getForeignKeyName() can probably be rewritten as foreignKeyName

UnnecessaryGetter2230

[SRC]assertEquals "assigned", manyToOne.getIdentifierGeneratorStrategy()

[MSG]getIdentifierGeneratorStrategy() can probably be rewritten as identifierGeneratorStrategy

UnnecessaryGetter2231

[SRC]assertNull manyToOne.getNullValue()

[MSG]getNullValue() can probably be rewritten as nullValue

UnnecessaryGetter2232

[SRC]assertEquals "TestFaqSection", manyToOne.getReferencedEntityName()

[MSG]getReferencedEntityName() can probably be rewritten as referencedEntityName

UnnecessaryGetter2233

[SRC]assertNull manyToOne.getReferencedPropertyName()

[MSG]getReferencedPropertyName() can probably be rewritten as referencedPropertyName

UnnecessaryGetter2234

[SRC]assertEquals ManyToOneType, manyToOne.getType().getClass()

[MSG]getType() can probably be rewritten as type

UnnecessaryGetter2235

[SRC]assertEquals "TestFaqSection", manyToOne.getTypeName()

[MSG]getTypeName() can probably be rewritten as typeName

UnnecessaryGetter2265

[SRC]assertEquals 0,list.getBaseIndex()

[MSG]getBaseIndex() can probably be rewritten as baseIndex

UnnecessaryGetter2267

[SRC]Table t = list.getCollectionTable()

[MSG]getCollectionTable() can probably be rewritten as collectionTable

UnnecessaryGetter2269

[SRC]assertEquals 0, list.getColumnInsertability().size()

[MSG]getColumnInsertability() can probably be rewritten as columnInsertability

UnnecessaryGetter2270

[SRC]assertNull list.getCacheConcurrencyStrategy()

[MSG]getCacheConcurrencyStrategy() can probably be rewritten as cacheConcurrencyStrategy

UnnecessaryGetter2271

[SRC]assertEquals "TestFaqSection.elements", list.getCacheRegionName()

[MSG]getCacheRegionName() can probably be rewritten as cacheRegionName

UnnecessaryGetter2272

[SRC]assertEquals 0,list.getColumnSpan()

[MSG]getColumnSpan() can probably be rewritten as columnSpan

UnnecessaryGetter2273

[SRC]assertEquals 0, list.getColumnUpdateability().size()

[MSG]getColumnUpdateability() can probably be rewritten as columnUpdateability

UnnecessaryGetter2274

[SRC]assertNull list.getElementNodeName()

[MSG]getElementNodeName() can probably be rewritten as elementNodeName

UnnecessaryGetter2275

[SRC]SimpleValue index = list.getIndex()

[MSG]getIndex() can probably be rewritten as index

UnnecessaryGetter2277

[SRC]assertEquals 1,index.getColumnInsertability().size()

[MSG]getColumnInsertability() can probably be rewritten as columnInsertability

UnnecessaryGetter2278

[SRC]assertTrue index.getColumnInsertability()[0]

[MSG]getColumnInsertability() can probably be rewritten as columnInsertability

UnnecessaryGetter2279

[SRC]assertEquals 1,index.getColumnUpdateability().size()

[MSG]getColumnUpdateability() can probably be rewritten as columnUpdateability

UnnecessaryGetter2280

[SRC]assertTrue index.getColumnUpdateability()[0]

[MSG]getColumnUpdateability() can probably be rewritten as columnUpdateability

UnnecessaryGetter2282

[SRC]assertEquals 1, index.getColumnSpan()

[MSG]getColumnSpan() can probably be rewritten as columnSpan

UnnecessaryGetter2284

[SRC]Column indexColumn = index.getColumnIterator().next()

[MSG]getColumnIterator() can probably be rewritten as columnIterator

UnnecessaryGetter2285

[SRC]assertEquals "elements_idx", indexColumn.getCanonicalName()

[MSG]getCanonicalName() can probably be rewritten as canonicalName

UnnecessaryGetter2286

[SRC]assertNull indexColumn.getCheckConstraint()

[MSG]getCheckConstraint() can probably be rewritten as checkConstraint

UnnecessaryGetter2287

[SRC]assertNull indexColumn.getComment()

[MSG]getComment() can probably be rewritten as comment

UnnecessaryGetter2288

[SRC]assertNull indexColumn.getDefaultValue()

[MSG]getDefaultValue() can probably be rewritten as defaultValue

UnnecessaryGetter2289

[SRC]assertEquals 255, indexColumn.getLength()

[MSG]getLength() can probably be rewritten as length

UnnecessaryGetter2290

[SRC]assertEquals "elements_idx", indexColumn.getName()

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter2291

[SRC]assertEquals 19, indexColumn.getPrecision()

[MSG]getPrecision() can probably be rewritten as precision

UnnecessaryGetter2292

[SRC]assertEquals "elements_idx", indexColumn.getQuotedName()

[MSG]getQuotedName() can probably be rewritten as quotedName

UnnecessaryGetter2293

[SRC]assertEquals 2, indexColumn.getScale()

[MSG]getScale() can probably be rewritten as scale

UnnecessaryGetter2294

[SRC]assertEquals "elements_idx", indexColumn.getText()

[MSG]getText() can probably be rewritten as text

UnnecessaryGetter2295

[SRC]SimpleValue indexColumnValue = indexColumn.getValue()

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2297

[SRC]assertEquals FetchMode.SELECT, index.getFetchMode()

[MSG]getFetchMode() can probably be rewritten as fetchMode

UnnecessaryGetter2298

[SRC]assertNull index.getForeignKeyName()

[MSG]getForeignKeyName() can probably be rewritten as foreignKeyName

UnnecessaryGetter2299

[SRC]assertEquals "assigned", index.getIdentifierGeneratorStrategy()

[MSG]getIdentifierGeneratorStrategy() can probably be rewritten as identifierGeneratorStrategy

UnnecessaryGetter2300

[SRC]assertNull index.getNullValue()

[MSG]getNullValue() can probably be rewritten as nullValue

UnnecessaryGetter2301

[SRC]assertEquals IntegerType, index.getType()?.getClass()

[MSG]getType() can probably be rewritten as type

UnnecessaryGetter2302

[SRC]assertEquals "integer", index.getTypeName()

[MSG]getTypeName() can probably be rewritten as typeName

UnnecessaryGetter2303

[SRC]assertNull index.getTypeParameters()

[MSG]getTypeParameters() can probably be rewritten as typeParameters

UnnecessaryGetter2305

[SRC]KeyValue key = list.getKey()

[MSG]getKey() can probably be rewritten as key

UnnecessaryGetter2307

[SRC]assertEquals 1,key.getColumnInsertability().size()

[MSG]getColumnInsertability() can probably be rewritten as columnInsertability

UnnecessaryGetter2308

[SRC]assertTrue key.getColumnInsertability()[0]

[MSG]getColumnInsertability() can probably be rewritten as columnInsertability

UnnecessaryGetter2309

[SRC]assertEquals 1,key.getColumnUpdateability().size()

[MSG]getColumnUpdateability() can probably be rewritten as columnUpdateability

UnnecessaryGetter2310

[SRC]assertTrue key.getColumnUpdateability()[0]

[MSG]getColumnUpdateability() can probably be rewritten as columnUpdateability

UnnecessaryGetter2312

[SRC]assertEquals 1, key.getColumnSpan()

[MSG]getColumnSpan() can probably be rewritten as columnSpan

UnnecessaryGetter2313

[SRC]assertEquals FetchMode.SELECT, key.getFetchMode()

[MSG]getFetchMode() can probably be rewritten as fetchMode

UnnecessaryGetter2314

[SRC]assertNull key.getNullValue()

[MSG]getNullValue() can probably be rewritten as nullValue

UnnecessaryGetter2315

[SRC]assertEquals LongType, key.getType().getClass()

[MSG]getType() can probably be rewritten as type

UnnecessaryGetter2317

[SRC]OneToMany element = list.getElement()

[MSG]getElement() can probably be rewritten as element

UnnecessaryGetter2319

[SRC]assertEquals 1, element.getColumnSpan()

[MSG]getColumnSpan() can probably be rewritten as columnSpan

UnnecessaryGetter2320

[SRC]assertEquals FetchMode.JOIN, element.getFetchMode()

[MSG]getFetchMode() can probably be rewritten as fetchMode

UnnecessaryGetter2321

[SRC]PersistentClass associatedClass = element.getAssociatedClass()

[MSG]getAssociatedClass() can probably be rewritten as associatedClass

UnnecessaryGetter2322

[SRC]assertEquals "TestFaqElement", associatedClass.getClassName()

[MSG]getClassName() can probably be rewritten as className

UnnecessaryGetter2323

[SRC]assertEquals ManyToOneType, element.getType().getClass()

[MSG]getType() can probably be rewritten as type

➥ BidirectionalListPersistTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter245

[SRC]section = session.get(sectionClass.getClazz(),1L)

[MSG]getClazz() can probably be rewritten as clazz

➥ BidirectionalOneToManyAndCircularOneToManyTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter267

[SRC]assertEquals uploadsProperty.getOtherSide(), recipientProperty

[MSG]getOtherSide() can probably be rewritten as otherSide

UnnecessaryGetter268

[SRC]assertEquals recipientProperty.getOtherSide(), uploadsProperty

[MSG]getOtherSide() can probably be rewritten as otherSide

UnnecessaryGetter280

[SRC]assertEquals uploadLogsProperty.getOtherSide(), senderProperty

[MSG]getOtherSide() can probably be rewritten as otherSide

UnnecessaryGetter281

[SRC]assertEquals senderProperty.getOtherSide(), uploadLogsProperty

[MSG]getOtherSide() can probably be rewritten as otherSide

➥ BidirectionalOneToManyAndOneToOneTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert235

[SRC]void testSaveAndLoad() {

[MSG]Test method 'testSaveAndLoad' makes no assertions

➥ BidirectionalOneToManyWithInheritanceTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable252

[SRC]def configItemClass = ga.getDomainClass("ConfigurationItem").clazz

[MSG]The variable [configItemClass] is not used

➥ BidirectionalOnetoManyWithInheritanceRelationshipManagementTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter244

[SRC]def otherSide = collection.getOtherSide()

[MSG]getOtherSide() can probably be rewritten as otherSide

➥ CascadingDeleteBehaviour2Tests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod255

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ CascadingDeleteBehaviour3Tests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod237

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnusedImport33

[SRC]import org.codehaus.groovy.grails.commons.GrailsDomainClass

➥ CascadingDeleteBehaviourTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod285

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ CascadingSaveAndUniqueConstraintTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert231

[SRC]void testCascadingSaveAndUniqueConstraint() {

[MSG]Test method 'testCascadingSaveAndUniqueConstraint' makes no assertions

UnusedVariable234

[SRC]def face = faceClass.newInstance(nose:noseClass.newInstance()).save()

[MSG]The variable [face] is not used

➥ CircularOneToManyTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod218

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ CircularRelationshipTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod228

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ CircularUnidirectionalOneToManyTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod233

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ ClassHeirarchyInheritanceTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod232

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ ConstraintPropertyTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod228

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ CreateCriteriaTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod226

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ CreateMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod227

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ CriteriaBuilderTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter2137

[SRC]def criteriaInstance = getInstance()

[MSG]getInstance() can probably be rewritten as instance

UnnecessaryGetter2151

[SRC]def criteriaInstance = getInstance()

[MSG]getInstance() can probably be rewritten as instance

➥ CriteriaListDistinctTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable233

[SRC]def Plant = ga.getDomainClass("Plant").clazz

[MSG]The variable [Plant] is not used

UnusedVariable267

[SRC]def Plant = ga.getDomainClass("Plant").clazz

[MSG]The variable [Plant] is not used

➥ CustomCascadeMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable238

[SRC]def twoClass = ga.getDomainClass("CustomCascadeMappingTwo").clazz

[MSG]The variable [twoClass] is not used

➥ CyclicManyToManyWithInheritanceTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert247

[SRC]void testCyclicManyToManyWithInheritance() {

[MSG]Test method 'testCyclicManyToManyWithInheritance' makes no assertions

➥ DataBindingDynamicConstructorTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod211

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ DataSourceTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter227

[SRC]sessionFactoryConnection = sessionFactoryConnection.getW..Connection()

[MSG]getWrappedConnection() can probably be rewritten as wrappedConnection

UnnecessaryGetter230

[SRC]sessionFactoryConnection = sessionFactoryConnection.getT..Connection()

[MSG]getTargetConnection() can probably be rewritten as targetConnection

UnnecessaryGetter236

[SRC]dataSourceConnection = dataSourceConnection.getTargetConnection()

[MSG]getTargetConnection() can probably be rewritten as targetConnection

UnnecessaryGetter239

[SRC]dataSourceConnection = dataSourceConnection.getWrappedConnection()

[MSG]getWrappedConnection() can probably be rewritten as wrappedConnection

UnnecessaryGetter242

[SRC]dataSourceConnection = dataSourceConnection.getTargetConnection()

[MSG]getTargetConnection() can probably be rewritten as targetConnection

UseAssertSameInsteadOfAssertTrue348

[SRC]assertTrue sessionFactoryConnection.is(dataSourceConnection)

[MSG]assert method can be simplified using the assertSame method

UseAssertSameInsteadOfAssertTrue349

[SRC]assertFalse unproxiedConnection.is(dataSourceConnection)

[MSG]assert method can be simplified using the assertSame method

➥ DeepHeirarchyTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod280

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ DefaultSortOrderForCollectionTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable230

[SRC]def Book = ga.getDomainClass("DefaultSortOrderForCollect..Book").clazz

[MSG]The variable [Book] is not used

➥ DeleteFromCollectionTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable232

[SRC]def bookClass = ga.getDomainClass("DeleteBook").clazz

[MSG]The variable [bookClass] is not used

➥ DeleteMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod225

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ DerivedPropertiesTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport34

[SRC]import org.codehaus.groovy.grails.plugins.MockGrailsPluginManager

UnusedImport33

[SRC]import org.codehaus.groovy.grails.plugins.GrailsPlugin

➥ DiscriminatorColumnMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable245

[SRC]def Child2 = ga.getDomainClass("Child2").clazz

[MSG]The variable [Child2] is not used

➥ DiscriminatorFormulaMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable2116

[SRC]def Root = ga.getDomainClass("Root").clazz

[MSG]The variable [Root] is not used

UnnecessaryObjectReferences2111

[SRC]rs.close()

[MSG]The code could be more concise by using a with() or identity() block

UseAssertNullInsteadOfAssertEquals3101

[SRC]assertEquals null, rs.getString("tree")

[MSG]assertEquals can be simplified using assertNull

➥ DomainEventsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2170

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

JUnitTestMethodWithoutAssert238

[SRC]void testNoModifyVersion() {

[MSG]Test method 'testNoModifyVersion' makes no assertions

UnusedVariable2152

[SRC]def success = false

[MSG]The variable [success] is not used

➥ DomainEventsWithMethodsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2272

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ DontFlushAfterDataAccessExceptionTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter248

[SRC]assertEquals FlushMode.AUTO, session.getFlushMode()

[MSG]getFlushMode() can probably be rewritten as flushMode

UnnecessaryGetter258

[SRC]assertEquals FlushMode.MANUAL, session.getFlushMode()

[MSG]getFlushMode() can probably be rewritten as flushMode

➥ EagerFindByQueryTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable234

[SRC]def tagClass = ga.getDomainClass("EagerFindByQueryTag").clazz

[MSG]The variable [tagClass] is not used

UnusedVariable251

[SRC]def tagClass = ga.getDomainClass("EagerFindByQueryTag").clazz

[MSG]The variable [tagClass] is not used

UnusedVariable268

[SRC]def tagClass = ga.getDomainClass("EagerFindByQueryTag").clazz

[MSG]The variable [tagClass] is not used

UnusedVariable284

[SRC]def tagClass = ga.getDomainClass("EagerFindByQueryTag").clazz

[MSG]The variable [tagClass] is not used

➥ EnumMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter281

[SRC]def con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter2104

[SRC]def con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

➥ EnumToStringTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod210

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ EventsTriggeringTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity257

[SRC]void testEvents() {

[MSG]The ABC score for method [testEvents] is [95.2]

➥ ExecuteUpdateTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod226

[SRC]def init() {

[MSG]The method init is public but not a test method

➥ ExistsTests.groovy

Rule NamePriorityLine #Source Line / Message
ImportFromSamePackage33

[SRC]import org.codehaus.groovy.grails.orm.hibernate.Abstract..bernateTests

➥ FindAllMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity226

[SRC]void testUsingHibernateCache() {

[MSG]The ABC score for method [testUsingHibernateCache] is [68.1]

AbcComplexity279

[SRC]void testUsingHibernateCacheWithNamedParams() {

[MSG]The ABC score for method [testUsingHibernateCacheWithNamedParams] is [68.1]

UnnecessaryObjectReferences263

[SRC]theClass.findAll("from FindAllTest where name = 'Angus'"..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences268

[SRC]theClass.findAll("from FindAllTest where name = 'Malcolm..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences273

[SRC]theClass.findAll("from FindAllTest where name = 'Malcolm..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2116

[SRC]theClass.findAll("from FindAllTest where name = :name", ..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2121

[SRC]theClass.findAll("from FindAllTest where name = :name", ..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2126

[SRC]theClass.findAll("from FindAllTest where name = :name", ..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

➥ FindByMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity286

[SRC]void testBooleanPropertyQuery() {

[MSG]The ABC score for method [testBooleanPropertyQuery] is [123.6]

➥ FindMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod25

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

AbcComplexity227

[SRC]void testUsingHibernateCache() {

[MSG]The ABC score for method [testUsingHibernateCache] is [103.1]

UnnecessaryObjectReferences264

[SRC]theClass.find("from FindMethodTestClass where one = 'Ang..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences269

[SRC]theClass.find("from FindMethodTestClass where one = 'Mal..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences274

[SRC]theClass.find("from FindMethodTestClass where one = 'Mal..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences279

[SRC]theClass.find("from FindMethodTestClass where one = :nam..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences284

[SRC]theClass.find("from FindMethodTestClass where one = :nam..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences289

[SRC]theClass.find("from FindMethodTestClass where one = :nam..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences294

[SRC]theClass.find("from FindMethodTestClass where one = :nam..che: false])

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences299

[SRC]theClass.find("from FindMethodTestClass where one = :nam..ache: true])

[MSG]The code could be more concise by using a with() or identity() block

➥ HibernateCriteriaBuilderTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod240

[SRC]List retrieveListOfNames() { ['bart'] }

[MSG]The method retrieveListOfNames is public but not a test method

MethodCount211

[SRC]class HibernateCriteriaBuilderTests extends AbstractGrai..rnateTests {

[MSG]Class org.codehaus.groovy.grails.orm.hibernate.HibernateCriteriaBuilderTests has 49 methods

UnusedVariable2868

[SRC]List results = parse( "{ " +

[MSG]The variable [results] is not used

UnusedVariable2896

[SRC]List results = parse("{ " +

[MSG]The variable [results] is not used

UnnecessaryGetter2301

[SRC]assertEquals clazzName , result.getClass().getName()

[MSG]getName() can probably be rewritten as name

UnnecessaryGetter21475

[SRC]GroovyClassLoader cl = grailsApplication.getClassLoader()

[MSG]getClassLoader() can probably be rewritten as classLoader

UnnecessaryGetter21492

[SRC]Class tc = grailsApplication.getArtefact(DomainClassArte..).getClazz()

[MSG]getClazz() can probably be rewritten as clazz

UnusedImport34

[SRC]import org.codehaus.groovy.runtime.InvokerInvocationException

ClassSize311

[MSG]Class "HibernateCriteriaBuilderTests" is 1494 lines

➥ HibernateEventListenerTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod249

[SRC]void onPostInsert(PostInsertEvent event) {}

[MSG]The method onPostInsert is both empty and not marked with @Override

EmptyMethod250

[SRC]void onPostDelete(PostDeleteEvent event) {}

[MSG]The method onPostDelete is both empty and not marked with @Override

UnusedImport38

[SRC]import org.codehaus.groovy.grails.commons.test.AbstractGrailsMockTests

➥ HibernateMappingBuilderTests.groovy

Rule NamePriorityLine #Source Line / Message
MethodCount215

[SRC]class HibernateMappingBuilderTests extends GroovyTestCase {

[MSG]Class org.codehaus.groovy.grails.orm.hibernate.HibernateMappingBuilderTests has 47 methods

➥ InheritanceWithLazyProxiesTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable235

[SRC]Class AttributeA = ga.getDomainClass("AttributeA").clazz

[MSG]The variable [AttributeA] is not used

UnusedVariable264

[SRC]Class A = ga.getDomainClass("A").clazz

[MSG]The variable [A] is not used

➥ ListDomainTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod223

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnusedVariable29

[SRC]def authorClass = ga.getDomainClass("Author")

[MSG]The variable [authorClass] is not used

➥ ListEagerFetchingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable243

[SRC]def Category = ga.getDomainClass("Category").clazz

[MSG]The variable [Category] is not used

➥ ListMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod254

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnusedVariable245

[SRC]def ids = [a1.id, a2.id, a2.id]

[MSG]The variable [ids] is not used

➥ LoadMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToEqualsMethod295

[SRC]assertTrue 'should not be a proxy', loadInstance.getClas..s(className)

[MSG]Explicit call to loadInstance.getClass().name.equals(className) method can be rewritten as loadInstance.getClass().name == (className)

ExplicitCallToEqualsMethod2113

[SRC]assertTrue 'should not be a proxy', getInstance.getClass..s(className)

[MSG]Explicit call to getInstance.getClass().name.equals(className) method can be rewritten as getInstance.getClass().name == (className)

ExplicitCallToEqualsMethod2166

[SRC]assertFalse 'should be a proxy', instance.getClass().nam..s(className)

[MSG]Explicit call to instance.getClass().name.equals(className) method can be rewritten as instance.getClass().name == (className)

UnusedVariable2122

[SRC]def o = clazz.newInstance()

[MSG]The variable [o] is not used

UnnecessaryGetter244

[SRC]assertEquals "id is accessible even if object doesn't ex..ance.getId()

[MSG]getId() can probably be rewritten as id

UnnecessaryGetter266

[SRC]assertEquals "id is accessible even if object doesn't ex..ance.getId()

[MSG]getId() can probably be rewritten as id

UnusedImport37

[SRC]import org.springframework.orm.hibernate3.HibernateObjec..ureException

UseAssertSameInsteadOfAssertTrue392

[SRC]assertTrue getInstance.is(loadInstance)

[MSG]assert method can be simplified using the assertSame method

UseAssertSameInsteadOfAssertTrue3111

[SRC]assertFalse getInstance.is(loadInstance)

[MSG]assert method can be simplified using the assertSame method

➥ ManyToManyCompositeIdTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod272

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

AbcComplexity220

[SRC]void testManyToManyMapping() {

[MSG]The ABC score for method [testManyToManyMapping] is [62.1]

UnusedImport33

[SRC]import junit.framework.TestCase

➥ ManyToManyLazinessTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod228

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ ManyToManyMappedByTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import org.codehaus.groovy.grails.commons.test.AbstractGrailsMockTests

➥ ManyToManyTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2114

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ ManyToManyWithInheritanceTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable232

[SRC]def ShapeAttribute = ga.getDomainClass("ShapeAttribute").clazz

[MSG]The variable [ShapeAttribute] is not used

➥ MapDomainTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod228

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ MapMappingJoinTableTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod230

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ MapMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod290

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UseAssertFalseInsteadOfNegation226

[SRC]assertTrue !book.hasErrors()

[MSG]assertTrue(!book.hasErrors()) can be simplified to assertFalse(book.hasErrors())

➥ MappedByColumn2Tests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod226

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ MappedByColumnTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod242

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ MappingDefaultsTests.groovy

Rule NamePriorityLine #Source Line / Message
UseAssertFalseInsteadOfNegation277

[SRC]assertTrue "should have inherited blank from shared cons..", !cp.blank

[MSG]assertTrue(!cp.blank) can be simplified to assertFalse(cp.blank)

UseAssertFalseInsteadOfNegation279

[SRC]assertTrue "should not have inherited matches from [anot..", !cp.email

[MSG]assertTrue(!cp.email) can be simplified to assertFalse(cp.email)

ChainedTest283

[SRC]testMappingDefaults()

[MSG]The test method testMappingDefaults() is being invoked explicitly from within a unit test. Tests should be isolated and not dependent on one another

UseAssertEqualsInsteadOfAssertTrue378

[SRC]assertTrue "size should have been in the specified range..0 == cp.size

[MSG]Replace assertTrue with a call to assertEquals()

➥ MappingDslTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert212

[SRC]void testTableMapping() {

[MSG]Test method 'testTableMapping' makes no assertions

JUnitTestMethodWithoutAssert2291

[SRC]void testCompositeIdAssignedGenerator_GRAILS_6289() {

[MSG]Test method 'testCompositeIdAssignedGenerator_GRAILS_6289' makes no assertions

UnusedVariable2211

[SRC]def personClass = ga.getDomainClass("MappedPerson").clazz

[MSG]The variable [personClass] is not used

UnnecessaryGetter217

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter235

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter282

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter2122

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter2126

[SRC]def metadata = result.getMetaData()

[MSG]getMetaData() can probably be rewritten as metaData

UnnecessaryGetter2161

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter2200

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter2228

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter2256

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter2281

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

UnnecessaryGetter2311

[SRC]connection = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

MethodSize3324

[MSG]Method "onSetUp" is 183 lines

➥ NamedCriteriaTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2158

[SRC]void testSorting() {

[MSG]The ABC score for method [testSorting] is [106.2]

AbcComplexity2539

[SRC]void testChainingNamedQueries() {

[MSG]The ABC score for method [testChainingNamedQueries] is [64.0]

MethodCount29

[SRC]class NamedCriteriaTests extends AbstractGrailsHibernateTests {

[MSG]Class org.codehaus.groovy.grails.orm.hibernate.NamedCriteriaTests has 43 methods

UnusedVariable2692

[SRC]def titles = publications.title

[MSG]The variable [titles] is not used

UnnecessaryIntegerInstantiation2967

[SRC]def pubs = publicationClass.recentPublications.list(max:.. Integer(5))

[MSG]Can be rewritten as 5 or 5i

ClassSize39

[MSG]Class "NamedCriteriaTests" is 1095 lines

MethodSize311

[MSG]Method "onSetUp" is 122 lines

➥ NamingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport39

[SRC]import org.hibernate.type.YesNoType

UnusedImport35

[SRC]import org.codehaus.groovy.grails.commons.GrailsDomainClass

UnusedImport310

[SRC]import org.codehaus.groovy.grails.commons.ConfigurationHolder

UnusedImport33

[SRC]import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder

UnusedImport37

[SRC]import org.codehaus.groovy.grails.plugins.GrailsPlugin

UnusedImport36

[SRC]import org.codehaus.groovy.grails.validation.ConstrainedProperty

UnusedImport34

[SRC]import org.codehaus.groovy.grails.orm.hibernate.cfg.Mapping

➥ OneToManySelfInheritanceTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable233

[SRC]def Root = ga.getDomainClass("OrgRoot").clazz

[MSG]The variable [Root] is not used

➥ OneToManyWithComposideIdentifierTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert247

[SRC]void testPersistAssociationWithCompositeId() {

[MSG]Test method 'testPersistAssociationWithCompositeId' makes no assertions

JUnitTestMethodWithoutAssert257

[SRC]void testUpdateInverseSide() {

[MSG]Test method 'testUpdateInverseSide' makes no assertions

➥ OneToManyWithInheritanceTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import org.springframework.util.Log4jConfigurer

➥ OneToManyWithSelfAndInheritanceTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable237

[SRC]def orgB = Organization.newInstance(name:'Org B', descri..org1).save()

[MSG]The variable [orgB] is not used

UnusedVariable238

[SRC]def orgaa = Organization.newInstance(name:'Org aa', desc..orgA).save()

[MSG]The variable [orgaa] is not used

UnusedVariable242

[SRC]def xorgB = ExtOrganization.newInstance(name:'ExtOrg B',..org1).save()

[MSG]The variable [xorgB] is not used

UnusedVariable243

[SRC]def xorgaa = ExtOrganization.newInstance(name:'ExtOrg aa..orgA).save()

[MSG]The variable [xorgaa] is not used

➥ PersistenceMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToEqualsMethod2290

[SRC]assertFalse "fred".equals(obj.getProperty("firstName"))

[MSG]Explicit call to fred.equals(obj.getProperty(firstName)) method can be rewritten as fred == (obj.getProperty(firstName))

ExplicitCallToEqualsMethod2291

[SRC]assertFalse "fred".equals(obj2.getProperty("firstName"))

[MSG]Explicit call to fred.equals(obj2.getProperty(firstName)) method can be rewritten as fred == (obj2.getProperty(firstName))

AbcComplexity2133

[SRC]void testFindPersistentMethods() {

[MSG]The ABC score for method [testFindPersistentMethods] is [71.9]

AbcComplexity2240

[SRC]void testFindByPersistentMethods() {

[MSG]The ABC score for method [testFindByPersistentMethods] is [111.0]

AbcComplexity2480

[SRC]void testFindAllPersistentMethod() {

[MSG]The ABC score for method [testFindAllPersistentMethod] is [182.6]

AbcComplexity2745

[SRC]void testExecuteQueryMethod() {

[MSG]The ABC score for method [testExecuteQueryMethod] is [88.2]

UnusedVariable2760

[SRC]MetaClass domain = obj.getMetaClass()

[MSG]The variable [domain] is not used

UnnecessaryGetter2448

[SRC]returnValue = domainClass.getAll()

[MSG]getAll() can probably be rewritten as all

UnnecessaryGetter2760

[SRC]MetaClass domain = obj.getMetaClass()

[MSG]getMetaClass() can probably be rewritten as metaClass

UnusedImport37

[SRC]import org.codehaus.groovy.runtime.InvokerInvocationException

MethodSize3133

[MSG]Method "testFindPersistentMethods" is 106 lines

MethodSize3240

[MSG]Method "testFindByPersistentMethods" is 134 lines

MethodSize3480

[MSG]Method "testFindAllPersistentMethod" is 210 lines

MethodSize3745

[MSG]Method "testExecuteQueryMethod" is 103 lines

➥ PessimisticLockingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod243

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

JUnitTestMethodWithoutAssert211

[SRC]void testLockMethod() {

[MSG]Test method 'testLockMethod' makes no assertions

➥ SavePersistentMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2293

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

JUnitPublicNonTestMethod2353

[SRC]void onTearDown() {

[MSG]The method onTearDown is public but not a test method

➥ SimpleBelongsToMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod215

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnusedVariable210

[SRC]def bookClass = ga.getDomainClass("Book")

[MSG]The variable [bookClass] is not used

➥ TablePerHierarchyAssocationTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable235

[SRC]def sub1Class = ga.getDomainClass("TablePerHierarchSub1").clazz

[MSG]The variable [sub1Class] is not used

➥ TablePerSubclassIdentityMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert237

[SRC]void testMappedIdentityForSubclass() {

[MSG]Test method 'testMappedIdentityForSubclass' makes no assertions

UnnecessaryGetter242

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

➥ TablePerSubclassWithCustomTableNameTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert237

[SRC]void testGeneratedTables() {

[MSG]Test method 'testGeneratedTables' makes no assertions

UnnecessaryGetter242

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

➥ TwoCircularUnidirectionalOneToManyTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity241

[SRC]void testAssociation() {

[MSG]The ABC score for method [testAssociation] is [83.9]

UnusedImport33

[SRC]import org.codehaus.groovy.grails.commons.test.AbstractGrailsMockTests

➥ TwoManyToManyTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2100

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

AbcComplexity211

[SRC]void testManyToManyMapping() {

[MSG]The ABC score for method [testManyToManyMapping] is [103.3]

➥ TwoUnidirectionalOneToManyTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod223

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

JUnitTestMethodWithoutAssert27

[SRC]void testTwoUniOneToManys() {

[MSG]Test method 'testTwoUniOneToManys' makes no assertions

➥ URLMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod222

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnnecessaryObjectReferences216

[SRC]b.discard()

[MSG]The code could be more concise by using a with() or identity() block

➥ UnidirectionalOneToManyHibernateMappedTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert226

[SRC]void testAnnotatedOneToManyDomain() {

[MSG]Test method 'testAnnotatedOneToManyDomain' makes no assertions

➥ UnidirectionalOneToManyWithJoinTableTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert226

[SRC]void testUnidirectionalOneToManyWithExplicityJoinTable() {

[MSG]Test method 'testUnidirectionalOneToManyWithExplicityJoinTable' makes no assertions

➥ UnidirectionalOneToManyWithSortOrderTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable233

[SRC]def Child = ga.getDomainClass("Child").clazz

[MSG]The variable [Child] is not used

➥ UserTypeMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter2148

[SRC]con = ds.getConnection()

[MSG]getConnection() can probably be rewritten as connection

MethodSize310

[MSG]Method "onSetUp" is 112 lines

➥ ValidatePersistentMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2133

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ ValidationFailureTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod25

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ VersionColumnTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert240

[SRC]void testVersionColumnMapping() {

[MSG]Test method 'testVersionColumnMapping' makes no assertions

UnusedImport33

[SRC]import java.sql.Connection

➥ WithCriteriaMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod224

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ WithTransactionMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod233

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

Package: src.test.org.codehaus.groovy.grails.orm.hibernate.binding

➥ AssociationDataBindingTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2221

[SRC]void testOneToManyBindingWithSubscriptOperatorAndExistingInstance() {

[MSG]The ABC score for method [testOneToManyBindingWithSubscriptOperatorAndExistingInstance] is [75.0]

AbcComplexity2276

[SRC]void testOneToManyBindingWithSubscriptOperatorAndNewInstance() {

[MSG]The ABC score for method [testOneToManyBindingWithSubscriptOperatorAndNewInstance] is [72.6]

UnusedVariable2157

[SRC]def book = Book.newInstance(title: "Pattern Recognition"..Error: true)

[MSG]The variable [book] is not used

UnnecessaryObjectReferences2287

[SRC]request.addParameter("books[0].reviewers['bob'].name", "Bob Bloggs")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2288

[SRC]request.addParameter("books[0].reviewers['chuck'].name",..uck Bloggs")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2289

[SRC]request.addParameter("books[1].title", "The Stand")

[MSG]The code could be more concise by using a with() or identity() block

➥ NonDomainCollectionBindingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod211

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

Package: src.test.org.codehaus.groovy.grails.orm.hibernate.cfg

➥ MonetaryAmount.groovy

Rule NamePriorityLine #Source Line / Message
SerializableClassMustDefineSerialVersionUID26

[SRC]class MonetaryAmount implements Serializable {

[MSG]The class org.codehaus.groovy.grails.orm.hibernate.cfg.MonetaryAmount implements Serializable but does not define a serialVersionUID

➥ MyType.groovy

Rule NamePriorityLine #Source Line / Message
SerializableClassMustDefineSerialVersionUID26

[SRC]class MyType implements Serializable {

[MSG]The class org.codehaus.groovy.grails.orm.hibernate.cfg.MyType implements Serializable but does not define a serialVersionUID

Package: src.test.org.codehaus.groovy.grails.orm.hibernate.metaclass

➥ BeforeValidateHelperTests.groovy

Rule NamePriorityLine #Source Line / Message
ImportFromSamePackage34

[SRC]import org.codehaus.groovy.grails.orm.hibernate.metaclas..idateHelper;

UnusedImport33

[SRC]import groovy.mock.interceptor.MockFor

Package: src.test.org.codehaus.groovy.grails.orm.hibernate.support

➥ FlushOnRedirectTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport36

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest

➥ HibernatePersistenceContextInterceptorTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryObjectReferences255

[SRC]interceptor.destroy()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter228

[SRC]def interceptor = getInterceptor()

[MSG]getInterceptor() can probably be rewritten as interceptor

UnnecessaryGetter241

[SRC]def interceptor = getInterceptor()

[MSG]getInterceptor() can probably be rewritten as interceptor

UnnecessaryGetter260

[SRC]def interceptor = getInterceptor()

[MSG]getInterceptor() can probably be rewritten as interceptor

UnnecessaryGetter281

[SRC]def interceptor = getInterceptor()

[MSG]getInterceptor() can probably be rewritten as interceptor

UnusedImport36

[SRC]import org.springframework.orm.hibernate3.SessionHolder

UseAssertTrueInsteadOfAssertEquals329

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals331

[SRC]assertEquals("interceptor open", true, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals333

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals335

[SRC]assertEquals("interceptor open", true, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals337

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals342

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals345

[SRC]assertEquals("interceptor open", true, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals347

[SRC]assertEquals("interceptor open", true, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals349

[SRC]assertEquals("interceptor open", true, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals351

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals354

[SRC]assertEquals("interceptor open", true, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals356

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals370

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals372

[SRC]assertEquals("interceptor open", true, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals374

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals393

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals395

[SRC]assertEquals("interceptor open", true, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals397

[SRC]assertEquals("interceptor open", false, interceptor.open)

[MSG]assertEquals can be simplified using assertTrue or assertFalse

Package: src.test.org.codehaus.groovy.grails.orm.hibernate.validation

➥ UniqueConstraintTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2265

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

AbcComplexity240

[SRC]void testValidation() {

[MSG]The ABC score for method [testValidation] is [72.9]

UnusedVariable215

[SRC]def userClass = ga.getDomainClass("User")

[MSG]The variable [userClass] is not used

UnnecessaryObjectReferences250

[SRC]user.validate()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences252

[SRC]user.save(true)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences263

[SRC]user.organization = "organization1"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences264

[SRC]user.validate()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences268

[SRC]user.id = 123L

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences269

[SRC]user.validate()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences279

[SRC]user.validate()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences283

[SRC]user.code = "321"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences284

[SRC]user.login = "login1"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences285

[SRC]user.grp = "group1"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences286

[SRC]user.department = "department1"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences287

[SRC]user.organization = "organization2"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences288

[SRC]user.validate()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences292

[SRC]user.grp = "group2"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences293

[SRC]user.validate()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences297

[SRC]user.grp = "group1"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences298

[SRC]user.department = "department2"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences299

[SRC]user.validate()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2103

[SRC]user.login = "login2"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2104

[SRC]user.grp = "group2"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2105

[SRC]user.department = "department1"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2106

[SRC]user.organization = "organization1"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2107

[SRC]user.validate()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2111

[SRC]user.organization = "organization2"

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2112

[SRC]user.validate()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2228

[SRC]user1.save(true)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2236

[SRC]user2.save(true)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2244

[SRC]user3.save(true)

[MSG]The code could be more concise by using a with() or identity() block

MethodSize3116

[MSG]Method "testWrongUniqueParams" is 101 lines

Package: src.test.org.codehaus.groovy.grails.orm.support

➥ TransactionManagerPostProcessorTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessarySelfAssignment230

[SRC]dataSource = dataSource

[MSG]Assignment a variable to itself should be unnecessary. Remove this dead code

Package: src.test.org.codehaus.groovy.grails.plugins

➥ ClassEditorGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod25

[SRC]def withSpring() {}

[MSG]The method withSpring is both empty and not marked with @Override

EmptyMethod27

[SRC]def withApplicationContext(ctx) {}

[MSG]The method withApplicationContext is both empty and not marked with @Override

➥ CoreGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter221

[SRC]def appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnnecessaryGetter238

[SRC]def appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnnecessaryGetter2102

[SRC]def appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

➥ DomainClassGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod212

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnnecessaryObjectReferences245

[SRC]gcl.parseClass("""class Child3 extends grails.test.Parent2 {

[MSG]The code could be more concise by using a with() or identity() block

➥ GrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter2181

[SRC]System.setProperty(Environment.KEY, Environment.PRODUCTION.getName())

[MSG]getName() can probably be rewritten as name

UnusedImport34

[SRC]import grails.util.BuildSettings

➥ GrailsPluginUtilsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper217

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper237

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter2146

[SRC]def pluginDirs = GrailsPluginUtils.getPluginDirectories()

[MSG]getPluginDirectories() can probably be rewritten as pluginDirectories

UnnecessaryGetter2155

[SRC]def pluginDirs = GrailsPluginUtils.getImplicitPluginDirectories()

[MSG]getImplicitPluginDirectories() can probably be rewritten as implicitPluginDirectories

UnusedImport36

[SRC]import org.apache.commons.io.FileUtils

➥ RelationshipManagementMethodsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2134

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnusedVariable251

[SRC]def addressClass = ga.getDomainClass("Address")

[MSG]The variable [addressClass] is not used

➥ ValidationGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter212

[SRC]def registry = GroovySystem.getMetaClassRegistry()

[MSG]getMetaClassRegistry() can probably be rewritten as metaClassRegistry

ImportFromSamePackage33

[SRC]import org.codehaus.groovy.grails.plugins.ValidationGrailsPlugin

Package: src.test.org.codehaus.groovy.grails.plugins.datasource

➥ DataSourceGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter237

[SRC]def appCtx = configurator.configure(ctx.getServletContext())

[MSG]getServletContext() can probably be rewritten as servletContext

UnnecessaryGetter264

[SRC]def appCtx = configurator.configure(ctx.getServletContext())

[MSG]getServletContext() can probably be rewritten as servletContext

Package: src.test.org.codehaus.groovy.grails.plugins.i18n

➥ I18nGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryObjectReferences220

[SRC]ctx.registerMockResource("WEB-INF/grails-app/i18n/sub/di..properties")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences221

[SRC]ctx.registerMockResource("WEB-INF/grails-app/i18n/nobundle")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences222

[SRC]ctx.registerMockResource("WEB-INF/grails-app/i18n/nobundle.txt")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences223

[SRC]ctx.registerMockResource("WEB-INF/grails-app/i18n/nobundle.xml")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter234

[SRC]def appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

Package: src.test.org.codehaus.groovy.grails.plugins.logging

➥ Log4jDslTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper235

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnusedVariable2185

[SRC]def consoleAppender

[MSG]The variable [consoleAppender] is not used

UnnecessaryGetter297

[SRC]def r = Logger.getRootLogger()

[MSG]getRootLogger() can probably be rewritten as rootLogger

UnnecessaryGetter2116

[SRC]r = Logger.getRootLogger()

[MSG]getRootLogger() can probably be rewritten as rootLogger

UnnecessaryGetter2135

[SRC]r = Logger.getRootLogger()

[MSG]getRootLogger() can probably be rewritten as rootLogger

UnnecessaryGetter2158

[SRC]def root = Logger.getRootLogger()

[MSG]getRootLogger() can probably be rewritten as rootLogger

UnnecessaryGetter2161

[SRC]def appenders = root.getAllAppenders()

[MSG]getAllAppenders() can probably be rewritten as allAppenders

UnusedImport323

[SRC]import org.apache.log4j.net.SMTPAppender

Package: src.test.org.codehaus.groovy.grails.plugins.scaffolding

➥ ScaffoldingGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter275

[SRC]def appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnnecessaryGetter286

[SRC]gcl.getLoadedClasses().find { it.name.endsWith("TagLib") })

[MSG]getLoadedClasses() can probably be rewritten as loadedClasses

Package: src.test.org.codehaus.groovy.grails.plugins.services

➥ ScopedProxyAndServiceClassTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport35

[SRC]import org.springframework.web.context.support.WebApplic..ContextUtils

➥ ServicesGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod212

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnnecessaryGetter2113

[SRC]springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

Package: src.test.org.codehaus.groovy.grails.plugins.web

➥ AbstractGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper279

[SRC]protected final void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter249

[SRC]ga = new DefaultGrailsApplication(gcl.getLoadedClasses(),gcl)

[MSG]getLoadedClasses() can probably be rewritten as loadedClasses

UnnecessaryGetter272

[SRC]appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnusedImport314

[SRC]import org.codehaus.groovy.grails.plugins.PluginMetaManager

➥ ControllersGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2186

[SRC]Class parseTestBean() {

[MSG]The method parseTestBean is public but not a test method

UnnecessaryGetter2135

[SRC]assertNotNull beanDef.getPropertyValues().getPropertyVal..seResource')

[MSG]getPropertyValues() can probably be rewritten as propertyValues

UnnecessaryGetter2137

[SRC]assertEquals "file:.", beanDef.getPropertyValues().getPr..).getValue()

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2137

[SRC]assertEquals "file:.", beanDef.getPropertyValues().getPr..).getValue()

[MSG]getPropertyValues() can probably be rewritten as propertyValues

UnnecessaryGetter2140

[SRC]assertEquals "groovyPageResourceLoader", beanDef.getProp..()?.beanName

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2140

[SRC]assertEquals "groovyPageResourceLoader", beanDef.getProp..()?.beanName

[MSG]getPropertyValues() can probably be rewritten as propertyValues

UnnecessaryGetter2143

[SRC]assertEquals "groovyPageResourceLoader", beanDef.getProp..()?.beanName

[MSG]getValue() can probably be rewritten as value

UnnecessaryGetter2143

[SRC]assertEquals "groovyPageResourceLoader", beanDef.getProp..()?.beanName

[MSG]getPropertyValues() can probably be rewritten as propertyValues

UnusedImport38

[SRC]import org.springframework.core.io.FileSystemResource

UseAssertEqualsInsteadOfAssertTrue3119

[SRC]assertTrue ga.config.grails.disableCommonsMultipart.size() == 0

[MSG]Replace assertTrue with a call to assertEquals()

➥ LoggingGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable236

[SRC]def registry = GroovySystem.metaClassRegistry

[MSG]The variable [registry] is not used

UnusedVariable242

[SRC]def registry = GroovySystem.metaClassRegistry

[MSG]The variable [registry] is not used

UnusedVariable248

[SRC]def registry = GroovySystem.metaClassRegistry

[MSG]The variable [registry] is not used

Package: src.test.org.codehaus.groovy.grails.plugins.web.filters

➥ FilterConfigTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper227

[SRC]void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper2135

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UseAssertTrueInsteadOfAssertEquals380

[SRC]assert mockDefinition.generateNumberCalled == true

[MSG]The expression '(mockDefinition.generateNumberCalled == true)' can be simplified to 'mockDefinition.generateNumberCalled'

UseAssertTrueInsteadOfAssertEquals385

[SRC]assert mockDefinition.generateNumberCalled == true

[MSG]The expression '(mockDefinition.generateNumberCalled == true)' can be simplified to 'mockDefinition.generateNumberCalled'

UseAssertTrueInsteadOfAssertEquals390

[SRC]assert mockDefinition.generateNumberCalled == true

[MSG]The expression '(mockDefinition.generateNumberCalled == true)' can be simplified to 'mockDefinition.generateNumberCalled'

➥ FilterExecutionTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity2227

[SRC]void testFilterMatching() {

[MSG]The ABC score for method [testFilterMatching] is [137.4]

MethodSize315

[MSG]Method "onSetUp" is 200 lines

MethodSize3227

[MSG]Method "testFilterMatching" is 127 lines

Package: src.test.org.codehaus.groovy.grails.plugins.web.mapping

➥ UrlMappingsGrailsPluginTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper287

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

Package: src.test.org.codehaus.groovy.grails.plugins.webflow

➥ MockWebFlowGrailsPlugin.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter229

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter229

[SRC]def version = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

Package: src.test.org.codehaus.groovy.grails.reload

➥ ServiceReloadTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod246

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ TagLibReloadTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod245

[SRC]void onInit() {

[MSG]The method onInit is public but not a test method

UnusedVariable218

[SRC]Class oldClass = ga.getTagLibClass("TestTagLib").getClazz()

[MSG]The variable [oldClass] is not used

UnusedVariable219

[SRC]def result

[MSG]The variable [result] is not used

UnnecessaryGetter218

[SRC]Class oldClass = ga.getTagLibClass("TestTagLib").getClazz()

[MSG]getClazz() can probably be rewritten as clazz

Package: src.test.org.codehaus.groovy.grails.resolve

➥ IvyDependencyManagerTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2558

[SRC]def getCurrentGrailsVersion() {

[MSG]The method getCurrentGrailsVersion is public but not a test method

JUnitSetUpCallsSuper225

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper229

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

JUnitTestMethodWithoutAssert297

[SRC]void testPluginResolve() {

[MSG]Test method 'testPluginResolve' makes no assertions

JUnitTestMethodWithoutAssert2348

[SRC]void testResolveApplicationDependencies() {

[MSG]Test method 'testResolveApplicationDependencies' makes no assertions

JUnitTestMethodWithoutAssert2671

[SRC]void testResolve() {

[MSG]Test method 'testResolve' makes no assertions

AbcComplexity2131

[SRC]void testDeclarePluginDependencies() {

[MSG]The ABC score for method [testDeclarePluginDependencies] is [60.4]

MethodCount223

[SRC]class IvyDependencyManagerTests extends GroovyTestCase {

[MSG]Class org.codehaus.groovy.grails.resolve.IvyDependencyManagerTests has 37 methods

UnusedVariable2110

[SRC]def report = manager.resolvePluginDependencies()

[MSG]The variable [report] is not used

UnusedVariable2711

[SRC]ModuleRevisionId junit = manager.dependencies.find { Mo.. == 'junit'}

[MSG]The variable [junit] is not used

UnnecessaryGetter2152

[SRC]assertEquals "1.5", dd.getDependencyRevisionId().revision

[MSG]getDependencyRevisionId() can probably be rewritten as dependencyRevisionId

UnnecessaryGetter2159

[SRC]assertEquals "0.5.5", dd.getDependencyRevisionId().revision

[MSG]getDependencyRevisionId() can probably be rewritten as dependencyRevisionId

UnnecessaryGetter2166

[SRC]assertEquals "0.5.6", dd.getDependencyRevisionId().revision

[MSG]getDependencyRevisionId() can probably be rewritten as dependencyRevisionId

UnnecessaryGetter2227

[SRC]assertEquals 1, dep.getModuleConfigurations().length

[MSG]getModuleConfigurations() can probably be rewritten as moduleConfigurations

UnnecessaryGetter2377

[SRC]assertEquals 2, manager.getApplicationDependencyDescriptors().size()

[MSG]getApplicationDependencyDescriptors() can probably be rewritten as applicationDependencyDescriptors

UnnecessaryGetter2508

[SRC]def grailsVersion = getCurrentGrailsVersion()

[MSG]getCurrentGrailsVersion() can probably be rewritten as currentGrailsVersion

UnnecessaryGetter2527

[SRC]def grailsVersion = getCurrentGrailsVersion()

[MSG]getCurrentGrailsVersion() can probably be rewritten as currentGrailsVersion

UnnecessaryGetter2615

[SRC]DefaultDependencyDescriptor dd = manager.getDependencyDe..tor().next()

[MSG]getDependencyDescriptors() can probably be rewritten as dependencyDescriptors

UnnecessaryGetter2629

[SRC]dd = manager.getDependencyDescriptors().iterator().next()

[MSG]getDependencyDescriptors() can probably be rewritten as dependencyDescriptors

UnnecessaryGetter2644

[SRC]DefaultDependencyDescriptor dd = manager.getPluginDepend..tor().next()

[MSG]getPluginDependencyDescriptors() can probably be rewritten as pluginDependencyDescriptors

UnnecessaryGetter2658

[SRC]DefaultDependencyDescriptor dd = manager.getPluginDepend..tor().next()

[MSG]getPluginDependencyDescriptors() can probably be rewritten as pluginDependencyDescriptors

Package: src.test.org.codehaus.groovy.grails.scaffolding

➥ DefaultGrailsTemplateGeneratorTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper221

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper228

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

➥ TemplateGeneratingResponseHandlerTests.groovy

Rule NamePriorityLine #Source Line / Message
DuplicateImport37

[SRC]import org.springframework.web.context.request.*

Package: src.test.org.codehaus.groovy.grails.scaffolding.view

➥ ScaffoldedGroovyPageViewTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper232

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

➥ ScaffoldingViewResolverTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter238

[SRC]viewResolver.servletContext = webRequest.getServletContext()

[MSG]getServletContext() can probably be rewritten as servletContext

UnnecessaryGetter247

[SRC]def view = viewResolver.loadView("/foo/list", Locale.getDefault())

[MSG]getDefault() can probably be rewritten as default

Package: src.test.org.codehaus.groovy.grails.validation

➥ ConstraintMessageTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter239

[SRC]'test'] as String[], errors.getFieldError().getCodes())

[MSG]getCodes() can probably be rewritten as codes

UnnecessaryGetter239

[SRC]'test'] as String[], errors.getFieldError().getCodes())

[MSG]getFieldError() can probably be rewritten as fieldError

➥ ConstraintsBuilderTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod278

[SRC]Errors validateInstance(instance, validator) {

[MSG]The method validateInstance is public but not a test method

JUnitPublicNonTestMethod284

[SRC]GrailsDomainClassValidator configureValidator(theClass, instance) {

[MSG]The method configureValidator is public but not a test method

➥ GrailsDomainClassValidatorTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity212

[SRC]void testCascadingValidation() {

[MSG]The ABC score for method [testCascadingValidation] is [85.4]

➥ VetoingNullableBehaviourTests.groovy

Rule NamePriorityLine #Source Line / Message
UseAssertEqualsInsteadOfAssertTrue3100

[SRC]assertTrue("Error not found for field ${field}, errors w..ld) == null)

[MSG]Replace assertTrue with a call to assertEquals()

Package: src.test.org.codehaus.groovy.grails.web.binding

➥ BindingToNullableTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable247

[SRC]def model = controller.update()

[MSG]The variable [model] is not used

➥ DataBindingLazyMetaPropertyMapTests.groovy

Rule NamePriorityLine #Source Line / Message
CoupledTestCase224

[SRC]def map = new DataBindingLazyMetaPropertyMap(new Propert..er:"stuff"))

[MSG]new PropertyMapTest([name:Bart, age:11, other:stuff]) creates an instance of a test case. Test cases should not be coupled. Move this method to a helper object

➥ DataBindingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable2178

[SRC]def error = b.errors.getFieldError('site')

[MSG]The variable [error] is not used

UnnecessaryGetter2239

[SRC]def authorClass = ga.getDomainClass("Author").getClazz()

[MSG]getClazz() can probably be rewritten as clazz

UnusedImport33

[SRC]import java.text.SimpleDateFormat

➥ DataBindingWithAssociationTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable275

[SRC]def Book = ga.getDomainClass("Book").clazz

[MSG]The variable [Book] is not used

UnusedVariable2102

[SRC]def Book = ga.getDomainClass("Book").clazz

[MSG]The variable [Book] is not used

UnusedImport33

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.Abstra..trollerTests

Package: src.test.org.codehaus.groovy.grails.web.codecs

➥ Base64CodecTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper214

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

➥ HexCodecTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod210

[SRC]void testEncode() {

[MSG]The method testEncode is both empty and not marked with @Override

EmptyMethod225

[SRC]void testDecode() {

[MSG]The method testDecode is both empty and not marked with @Override

EmptyMethod234

[SRC]void testRoundtrip() {

[MSG]The method testRoundtrip is both empty and not marked with @Override

JUnitTestMethodWithoutAssert210

[SRC]void testEncode() {

[MSG]Test method 'testEncode' makes no assertions

JUnitTestMethodWithoutAssert225

[SRC]void testDecode() {

[MSG]Test method 'testDecode' makes no assertions

JUnitTestMethodWithoutAssert234

[SRC]void testRoundtrip() {

[MSG]Test method 'testRoundtrip' makes no assertions

➥ URLCodecTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper214

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper219

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

Package: src.test.org.codehaus.groovy.grails.web.context

➥ GrailsConfigUtilsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper279

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnusedVariable264

[SRC]def configurator = GrailsConfigUtils.determineGrailsRunt..ontext, ctx)

[MSG]The variable [configurator] is not used

UnnecessaryObjectReferences295

[SRC]ctx.setAttribute("env", "dev")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter248

[SRC]servletContext.addInitParameter("grailsConfiguratorClass..s.getName())

[MSG]getName() can probably be rewritten as name

Package: src.test.org.codehaus.groovy.grails.web.converters

➥ ConvertsWithHibernateProxiesTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable255

[SRC]def converter = parent as JSON

[MSG]The variable [converter] is not used

UnusedVariable274

[SRC]def converter = parent as XML

[MSG]The variable [converter] is not used

➥ JSONConverterTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod289

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ XMLConverterTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod290

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnusedVariable276

[SRC]def proxy = [getHibernateLazyInitializer:{hibernateIniti..bernateProxy

[MSG]The variable [proxy] is not used

UnusedImport34

[SRC]import java.lang.reflect.Method

UnusedImport38

[SRC]import org.codehaus.groovy.grails.web.converters.marshal..rsMarshaller

UnusedImport311

[SRC]import org.hibernate.repackage.cglib.proxy.MethodProxy

UnusedImport310

[SRC]import org.hibernate.repackage.cglib.proxy.Enhancer

Package: src.test.org.codehaus.groovy.grails.web.errors

➥ GrailsExceptionResolverTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper229

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

AbcComplexity2168

[SRC]void testDisablingRequestParameterLogging() {

[MSG]The ABC score for method [testDisablingRequestParameterLogging] is [73.5]

UnnecessaryGetter2106

[SRC]assertEquals "/grails/foo/bar.dispatch",response.getForwardedUrl()

[MSG]getForwardedUrl() can probably be rewritten as forwardedUrl

Package: src.test.org.codehaus.groovy.grails.web.filters

➥ HiddenHttpMethodFilterTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import org.springframework.mock.web.MockServletContext;

UnusedImport36

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest;

UnusedImport35

[SRC]import org.codehaus.groovy.grails.web.servlet.GrailsAppl..nAttributes;

Package: src.test.org.codehaus.groovy.grails.web.i18n

➥ ParamsAwareLocaleChangeInterceptorTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper216

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter224

[SRC]def request = webRequest.getCurrentRequest()

[MSG]getCurrentRequest() can probably be rewritten as currentRequest

UnnecessaryGetter225

[SRC]def response = webRequest.getCurrentResponse()

[MSG]getCurrentResponse() can probably be rewritten as currentResponse

UnnecessaryGetter247

[SRC]assertEquals "de", locale.getLanguage()

[MSG]getLanguage() can probably be rewritten as language

UnnecessaryGetter248

[SRC]assertEquals "DE", locale.getCountry()

[MSG]getCountry() can probably be rewritten as country

UnnecessaryGetter255

[SRC]def request = webRequest.getCurrentRequest()

[MSG]getCurrentRequest() can probably be rewritten as currentRequest

UnnecessaryGetter256

[SRC]def response = webRequest.getCurrentResponse()

[MSG]getCurrentResponse() can probably be rewritten as currentResponse

UnnecessaryGetter278

[SRC]assertEquals "de", locale.getLanguage()

[MSG]getLanguage() can probably be rewritten as language

UnnecessaryGetter279

[SRC]assertEquals "DE", locale.getCountry()

[MSG]getCountry() can probably be rewritten as country

UnnecessaryGetter286

[SRC]MockHttpServletRequest request = webRequest.getCurrentRequest()

[MSG]getCurrentRequest() can probably be rewritten as currentRequest

UnnecessaryGetter287

[SRC]def response = webRequest.getCurrentResponse()

[MSG]getCurrentResponse() can probably be rewritten as currentResponse

UnnecessaryGetter2109

[SRC]assertEquals "de", locale.getLanguage()

[MSG]getLanguage() can probably be rewritten as language

UnnecessaryGetter2110

[SRC]assertEquals "DE", locale.getCountry()

[MSG]getCountry() can probably be rewritten as country

Package: src.test.org.codehaus.groovy.grails.web.mapping

➥ DefaultUrlCreatorTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper234

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

➥ DoubleWildcardUrlMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter272

[SRC]assertEquals 'wrong controller name', 'someOther', info...rollerName()

[MSG]getControllerName() can probably be rewritten as controllerName

UnusedImport33

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.Abstra..trollerTests

UnusedImport35

[SRC]import org.springframework.mock.web.MockServletContext

➥ DynamicParameterValuesTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.Abstra..trollerTests

UnusedImport35

[SRC]import org.springframework.mock.web.MockServletContext

➥ IdUrlMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod226

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnusedImport33

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.Abstra..trollerTests

UnusedImport35

[SRC]import org.springframework.mock.web.MockServletContext

➥ RegexUrlMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitCallToCompareToMethod2169

[SRC]assertTrue m1.compareTo(m2) > 0

[MSG]Explicit call to m1.compareTo(m2) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2170

[SRC]assertTrue m1.compareTo(m3) > 0

[MSG]Explicit call to m1.compareTo(m3) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2171

[SRC]assertTrue m1.compareTo(m4) > 0

[MSG]Explicit call to m1.compareTo(m4) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2172

[SRC]assertTrue m1.compareTo(m5) > 0

[MSG]Explicit call to m1.compareTo(m5) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2173

[SRC]assertTrue m1.compareTo(m6) > 0

[MSG]Explicit call to m1.compareTo(m6) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2174

[SRC]assertTrue m1.compareTo(m7) > 0

[MSG]Explicit call to m1.compareTo(m7) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2175

[SRC]assertTrue m1.compareTo(m8) > 0

[MSG]Explicit call to m1.compareTo(m8) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2176

[SRC]assertTrue m1.compareTo(m9) > 0

[MSG]Explicit call to m1.compareTo(m9) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2177

[SRC]assertTrue m1.compareTo(m10) > 0

[MSG]Explicit call to m1.compareTo(m10) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2179

[SRC]assertTrue m2.compareTo(m1) < 0

[MSG]Explicit call to m2.compareTo(m1) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2180

[SRC]assertTrue m2.compareTo(m3) > 0

[MSG]Explicit call to m2.compareTo(m3) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2181

[SRC]assertTrue m2.compareTo(m4) > 0

[MSG]Explicit call to m2.compareTo(m4) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2182

[SRC]assertTrue m2.compareTo(m5) > 0

[MSG]Explicit call to m2.compareTo(m5) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2183

[SRC]assertTrue m2.compareTo(m6) > 0

[MSG]Explicit call to m2.compareTo(m6) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2184

[SRC]assertTrue m2.compareTo(m7) > 0

[MSG]Explicit call to m2.compareTo(m7) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2185

[SRC]assertTrue m2.compareTo(m8) > 0

[MSG]Explicit call to m2.compareTo(m8) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2186

[SRC]assertTrue m2.compareTo(m9) > 0

[MSG]Explicit call to m2.compareTo(m9) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2187

[SRC]assertTrue m2.compareTo(m10) > 0

[MSG]Explicit call to m2.compareTo(m10) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2189

[SRC]assertTrue m3.compareTo(m1) < 0

[MSG]Explicit call to m3.compareTo(m1) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2190

[SRC]assertTrue m3.compareTo(m2) < 0

[MSG]Explicit call to m3.compareTo(m2) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2191

[SRC]assertTrue m3.compareTo(m4) > 0

[MSG]Explicit call to m3.compareTo(m4) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2192

[SRC]assertTrue m3.compareTo(m5) > 0

[MSG]Explicit call to m3.compareTo(m5) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2193

[SRC]assertTrue m3.compareTo(m6) > 0

[MSG]Explicit call to m3.compareTo(m6) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2194

[SRC]assertTrue m3.compareTo(m7) > 0

[MSG]Explicit call to m3.compareTo(m7) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2195

[SRC]assertTrue m3.compareTo(m8) > 0

[MSG]Explicit call to m3.compareTo(m8) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2196

[SRC]assertTrue m3.compareTo(m9) > 0

[MSG]Explicit call to m3.compareTo(m9) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2197

[SRC]assertTrue m3.compareTo(m10) > 0

[MSG]Explicit call to m3.compareTo(m10) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2199

[SRC]assertTrue m4.compareTo(m1) < 0

[MSG]Explicit call to m4.compareTo(m1) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2200

[SRC]assertTrue m4.compareTo(m2) < 0

[MSG]Explicit call to m4.compareTo(m2) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2201

[SRC]assertTrue m4.compareTo(m3) < 0

[MSG]Explicit call to m4.compareTo(m3) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2202

[SRC]assertTrue m4.compareTo(m5) > 0

[MSG]Explicit call to m4.compareTo(m5) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2203

[SRC]assertTrue m4.compareTo(m6) > 0

[MSG]Explicit call to m4.compareTo(m6) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2204

[SRC]assertTrue m4.compareTo(m7) > 0

[MSG]Explicit call to m4.compareTo(m7) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2205

[SRC]assertTrue m4.compareTo(m8) > 0

[MSG]Explicit call to m4.compareTo(m8) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2206

[SRC]assertTrue m4.compareTo(m9) > 0

[MSG]Explicit call to m4.compareTo(m9) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2207

[SRC]assertTrue m4.compareTo(m10) > 0

[MSG]Explicit call to m4.compareTo(m10) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2209

[SRC]assertTrue m5.compareTo(m1) < 0

[MSG]Explicit call to m5.compareTo(m1) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2210

[SRC]assertTrue m5.compareTo(m2) < 0

[MSG]Explicit call to m5.compareTo(m2) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2211

[SRC]assertTrue m5.compareTo(m3) < 0

[MSG]Explicit call to m5.compareTo(m3) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2212

[SRC]assertTrue m5.compareTo(m4) < 0

[MSG]Explicit call to m5.compareTo(m4) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2213

[SRC]assertTrue m5.compareTo(m6) > 0

[MSG]Explicit call to m5.compareTo(m6) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2214

[SRC]assertTrue m5.compareTo(m7) > 0

[MSG]Explicit call to m5.compareTo(m7) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2215

[SRC]assertTrue m5.compareTo(m8) > 0

[MSG]Explicit call to m5.compareTo(m8) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2216

[SRC]assertTrue m5.compareTo(m9) > 0

[MSG]Explicit call to m5.compareTo(m9) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2217

[SRC]assertTrue m5.compareTo(m10) > 0

[MSG]Explicit call to m5.compareTo(m10) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2219

[SRC]assertTrue m6.compareTo(m1) < 0

[MSG]Explicit call to m6.compareTo(m1) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2220

[SRC]assertTrue m6.compareTo(m2) < 0

[MSG]Explicit call to m6.compareTo(m2) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2221

[SRC]assertTrue m6.compareTo(m3) < 0

[MSG]Explicit call to m6.compareTo(m3) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2222

[SRC]assertTrue m6.compareTo(m4) < 0

[MSG]Explicit call to m6.compareTo(m4) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2223

[SRC]assertTrue m6.compareTo(m5) < 0

[MSG]Explicit call to m6.compareTo(m5) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2224

[SRC]assertTrue m6.compareTo(m7) > 0

[MSG]Explicit call to m6.compareTo(m7) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2225

[SRC]assertTrue m6.compareTo(m8) > 0

[MSG]Explicit call to m6.compareTo(m8) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2226

[SRC]assertTrue m6.compareTo(m9) > 0

[MSG]Explicit call to m6.compareTo(m9) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2227

[SRC]assertTrue m6.compareTo(m10) > 0

[MSG]Explicit call to m6.compareTo(m10) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2229

[SRC]assertTrue m7.compareTo(m1) < 0

[MSG]Explicit call to m7.compareTo(m1) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2230

[SRC]assertTrue m7.compareTo(m2) < 0

[MSG]Explicit call to m7.compareTo(m2) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2231

[SRC]assertTrue m7.compareTo(m3) < 0

[MSG]Explicit call to m7.compareTo(m3) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2232

[SRC]assertTrue m7.compareTo(m4) < 0

[MSG]Explicit call to m7.compareTo(m4) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2233

[SRC]assertTrue m7.compareTo(m5) < 0

[MSG]Explicit call to m7.compareTo(m5) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2234

[SRC]assertTrue m7.compareTo(m6) < 0

[MSG]Explicit call to m7.compareTo(m6) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2235

[SRC]assertTrue m7.compareTo(m8) > 0

[MSG]Explicit call to m7.compareTo(m8) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2236

[SRC]assertTrue m7.compareTo(m9) > 0

[MSG]Explicit call to m7.compareTo(m9) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2237

[SRC]assertTrue m7.compareTo(m10) > 0

[MSG]Explicit call to m7.compareTo(m10) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2239

[SRC]assertTrue m8.compareTo(m1) < 0

[MSG]Explicit call to m8.compareTo(m1) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2240

[SRC]assertTrue m8.compareTo(m2) < 0

[MSG]Explicit call to m8.compareTo(m2) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2241

[SRC]assertTrue m8.compareTo(m3) < 0

[MSG]Explicit call to m8.compareTo(m3) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2242

[SRC]assertTrue m8.compareTo(m4) < 0

[MSG]Explicit call to m8.compareTo(m4) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2243

[SRC]assertTrue m8.compareTo(m5) < 0

[MSG]Explicit call to m8.compareTo(m5) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2244

[SRC]assertTrue m8.compareTo(m6) < 0

[MSG]Explicit call to m8.compareTo(m6) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2245

[SRC]assertTrue m8.compareTo(m7) < 0

[MSG]Explicit call to m8.compareTo(m7) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2246

[SRC]assertTrue m8.compareTo(m9) > 0

[MSG]Explicit call to m8.compareTo(m9) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2247

[SRC]assertTrue m8.compareTo(m10) > 0

[MSG]Explicit call to m8.compareTo(m10) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2249

[SRC]assertTrue m9.compareTo(m1) < 0

[MSG]Explicit call to m9.compareTo(m1) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2250

[SRC]assertTrue m9.compareTo(m2) < 0

[MSG]Explicit call to m9.compareTo(m2) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2251

[SRC]assertTrue m9.compareTo(m3) < 0

[MSG]Explicit call to m9.compareTo(m3) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2252

[SRC]assertTrue m9.compareTo(m4) < 0

[MSG]Explicit call to m9.compareTo(m4) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2253

[SRC]assertTrue m9.compareTo(m5) < 0

[MSG]Explicit call to m9.compareTo(m5) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2254

[SRC]assertTrue m9.compareTo(m6) < 0

[MSG]Explicit call to m9.compareTo(m6) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2255

[SRC]assertTrue m9.compareTo(m7) < 0

[MSG]Explicit call to m9.compareTo(m7) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2256

[SRC]assertTrue m9.compareTo(m8) < 0

[MSG]Explicit call to m9.compareTo(m8) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2257

[SRC]assertTrue m9.compareTo(m10) > 0

[MSG]Explicit call to m9.compareTo(m10) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2259

[SRC]assertTrue m10.compareTo(m1) < 0

[MSG]Explicit call to m10.compareTo(m1) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2260

[SRC]assertTrue m10.compareTo(m2) < 0

[MSG]Explicit call to m10.compareTo(m2) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2261

[SRC]assertTrue m10.compareTo(m3) < 0

[MSG]Explicit call to m10.compareTo(m3) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2262

[SRC]assertTrue m10.compareTo(m4) < 0

[MSG]Explicit call to m10.compareTo(m4) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2263

[SRC]assertTrue m10.compareTo(m5) < 0

[MSG]Explicit call to m10.compareTo(m5) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2264

[SRC]assertTrue m10.compareTo(m6) < 0

[MSG]Explicit call to m10.compareTo(m6) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2265

[SRC]assertTrue m10.compareTo(m7) < 0

[MSG]Explicit call to m10.compareTo(m7) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2266

[SRC]assertTrue m10.compareTo(m8) < 0

[MSG]Explicit call to m10.compareTo(m8) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

ExplicitCallToCompareToMethod2267

[SRC]assertTrue m10.compareTo(m9) < 0

[MSG]Explicit call to m10.compareTo(m9) method can be rewritten using the compareTo operators such as >, <, <=, >=, and <=>

JUnitTestMethodWithoutAssert2335

[SRC]void testInit() {

[MSG]Test method 'testInit' makes no assertions

AbcComplexity2154

[SRC]void testComparable() {

[MSG]The ABC score for method [testComparable] is [226.2]

UnusedVariable2337

[SRC]def m = new RegexUrlMapping(parser.parse("/(*)/hello"), ..vletContext)

[MSG]The variable [m] is not used

UnnecessaryGetter258

[SRC]assertEquals "/x/y", info.getURI()

[MSG]getURI() can probably be rewritten as URI

UnusedImport36

[SRC]import org.springframework.mock.web.MockServletContext

MethodSize3154

[MSG]Method "testComparable" is 129 lines

➥ ResponseCodeUrlMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter259

[SRC]assertEquals("errors", info.getControllerName());

[MSG]getControllerName() can probably be rewritten as controllerName

UnnecessaryGetter260

[SRC]assertEquals("error404", info.getActionName());

[MSG]getActionName() can probably be rewritten as actionName

UnnecessaryGetter266

[SRC]assertEquals("errors", info.getControllerName());

[MSG]getControllerName() can probably be rewritten as controllerName

UnnecessaryGetter267

[SRC]assertEquals("error500", info.getActionName());

[MSG]getActionName() can probably be rewritten as actionName

UnusedImport36

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.Abstra..trollerTests

UnusedImport38

[SRC]import org.springframework.mock.web.MockServletContext

➥ RestfulMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import org.codehaus.groovy.grails.validation.ConstrainedProperty;

UnusedImport36

[SRC]import org.springframework.mock.web.MockServletContext

➥ RestfulReverseUrlRenderingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.Abstra..trollerTests

➥ ReverseMappingWithDefaultActionTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod211

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ UrlMappingEvaluatorTests.groovy

Rule NamePriorityLine #Source Line / Message
AbcComplexity243

[SRC]void testEvaluateMappings() {

[MSG]The ABC score for method [testEvaluateMappings] is [81.1]

AbcComplexity25

[SRC]class UrlMappingEvaluatorTests extends GroovyTestCase {

[MSG]The ABC score for class [org.codehaus.groovy.grails.web.mapping.UrlMappingEvaluatorTests] is [81.1]

➥ UrlMappingParameterTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport34

[SRC]import org.springframework.core.io.ByteArrayResource

UnusedImport33

[SRC]import org.codehaus.groovy.grails.web.servlet.mvc.Abstra..trollerTests

UnusedImport35

[SRC]import org.springframework.mock.web.MockServletContext

➥ UrlMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import org.codehaus.groovy.grails.validation.ConstrainedProperty;

➥ UrlMappingsHolderTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import org.codehaus.groovy.grails.validation.ConstrainedProperty;

➥ ViewUrlMappingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter240

[SRC]assertEquals "book.gsp", info.getViewName()

[MSG]getViewName() can probably be rewritten as viewName

UnnecessaryGetter247

[SRC]assertEquals "book.gsp", info.getViewName()

[MSG]getViewName() can probably be rewritten as viewName

Package: src.test.org.codehaus.groovy.grails.web.mapping.filter

➥ RestfulMappingsFilterTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter250

[SRC]def mappings = evaluator.evaluateMappings(new ByteArrayR..getBytes()))

[MSG]getBytes() can probably be rewritten as bytes

➥ UrlMappingsFilterTests.groovy

Rule NamePriorityLine #Source Line / Message
UseAssertEqualsInsteadOfAssertTrue3326

[SRC]assertFalse "/book.gsp" == response.forwardedUrl

[MSG]Replace assertFalse with a call to assertEquals()

UseAssertEqualsInsteadOfAssertTrue3327

[SRC]assertFalse "joel" == webRequest.params.name

[MSG]Replace assertFalse with a call to assertEquals()

Package: src.test.org.codehaus.groovy.grails.web.mime

➥ AcceptHeaderParserTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper211

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper229

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

Package: src.test.org.codehaus.groovy.grails.web.pages

➥ GroovyPageBindingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter215

[SRC]assertEquals binding.getMetaClass(), binding.metaClass

[MSG]getMetaClass() can probably be rewritten as metaClass

➥ GroovyPageLineNumberTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert213

[SRC]void testSpanningMultipleLines() {

[MSG]Test method 'testSpanningMultipleLines' makes no assertions

UnusedImport35

[SRC]import org.codehaus.groovy.grails.web.taglib.exceptions...TagException

➥ GroovyPageMethodDispatchWithNamespaceTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod28

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ GroovyPageTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod266

[SRC]def runPageCode(pageCode) {

[MSG]The method runPageCode is public but not a test method

JUnitPublicNonTestMethod2144

[SRC]def getBinding(out) {

[MSG]The method getBinding is public but not a test method

UnnecessaryObjectReferences2158

[SRC]binding.setVariable(GroovyPage.OUT, out)

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter2155

[SRC]binding.setVariable(GroovyPage.SESSION, request.getSession())

[MSG]getSession() can probably be rewritten as session

➥ GroovyPagesServletTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper255

[SRC]void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper251

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

JUnitTestMethodWithoutAssert230

[SRC]void testHandleException() {

[MSG]Test method 'testHandleException' makes no assertions

UnusedVariable218

[SRC]def writer = gps.createResponseWriter(new MockHttpServletResponse())

[MSG]The variable [writer] is not used

UnnecessaryGetter248

[SRC]gps.handleException(request, response,e,response.getWriter(),gpte)

[MSG]getWriter() can probably be rewritten as writer

➥ GroovyPagesTemplateEngineTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper2192

[SRC]void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper2188

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

➥ ModifyOurScopeWithBodyTagTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport35

[SRC]import junit.framework.TestCase

➥ StaticContentRenderingTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport34

[SRC]import org.codehaus.groovy.grails.commons.ConfigurationHolder

➥ TagLibNamespaceTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod222

[SRC]void onTearDown() {

[MSG]The method onTearDown is public but not a test method

Package: src.test.org.codehaus.groovy.grails.web.pages.ext.jsp

➥ GroovyPageWithJSPTagsTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter222

[SRC]def rootLoader = new RootLoader([] as URL[], Thread.curr..assLoader())

[MSG]getContextClassLoader() can probably be rewritten as contextClassLoader

UnnecessaryGetter224

[SRC]rootLoader.addURL res.getURL()

[MSG]getURL() can probably be rewritten as URL

UnnecessaryGetter226

[SRC]rootLoader.addURL it.getURL()

[MSG]getURL() can probably be rewritten as URL

UnnecessaryGetter230

[SRC]webRequest.getCurrentRequest().setAttribute(GroovyPagesS..esServlet())

[MSG]getCurrentRequest() can probably be rewritten as currentRequest

➥ GroovyPagesPageContextTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper213

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper217

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter225

[SRC]assert pageContext.getServletConfig()

[MSG]getServletConfig() can probably be rewritten as servletConfig

UnnecessaryGetter226

[SRC]assert pageContext.getServletContext()

[MSG]getServletContext() can probably be rewritten as servletContext

UnnecessaryGetter227

[SRC]assert pageContext.getRequest()

[MSG]getRequest() can probably be rewritten as request

UnnecessaryGetter228

[SRC]assert pageContext.getResponse()

[MSG]getResponse() can probably be rewritten as response

UnnecessaryGetter229

[SRC]assert pageContext.getPage()

[MSG]getPage() can probably be rewritten as page

➥ IterativeJspTagTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper221

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper226

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter223

[SRC]webRequest.getCurrentRequest().setAttribute(GroovyPagesS..esServlet())

[MSG]getCurrentRequest() can probably be rewritten as currentRequest

UnnecessaryGetter234

[SRC]def rootLoader = new RootLoader([] as URL[], Thread.curr..assLoader())

[MSG]getContextClassLoader() can probably be rewritten as contextClassLoader

UnnecessaryGetter236

[SRC]rootLoader.addURL res.getURL()

[MSG]getURL() can probably be rewritten as URL

UnnecessaryGetter252

[SRC]JstlUtils.exposeLocalizationContext webRequest.getRequest(),null

[MSG]getRequest() can probably be rewritten as request

UnnecessaryGetter255

[SRC]def pageContext = PageContextFactory.getCurrent()

[MSG]getCurrent() can probably be rewritten as current

➥ MockRootLoaderTagLibraryResolver.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter217

[SRC]def rootLoader = new RootLoader([] as URL[], Thread.curr..assLoader())

[MSG]getContextClassLoader() can probably be rewritten as contextClassLoader

UnnecessaryGetter219

[SRC]rootLoader.addURL res.getURL()

[MSG]getURL() can probably be rewritten as URL

➥ SimpleJspTagTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper220

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper225

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter222

[SRC]webRequest.getCurrentRequest().setAttribute(GroovyPagesS..esServlet())

[MSG]getCurrentRequest() can probably be rewritten as currentRequest

UnnecessaryGetter245

[SRC]JstlUtils.exposeLocalizationContext webRequest.getRequest(),null

[MSG]getRequest() can probably be rewritten as request

UnusedImport38

[SRC]import javax.servlet.jsp.jstl.core.Config

➥ SimpleTagTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper221

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper226

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter223

[SRC]webRequest.getCurrentRequest().setAttribute(GroovyPagesS..esServlet())

[MSG]getCurrentRequest() can probably be rewritten as currentRequest

UnnecessaryGetter261

[SRC]getJspContext().getOut().println("extendsSimpleTagSupport:output");

[MSG]getOut() can probably be rewritten as out

UnnecessaryGetter261

[SRC]getJspContext().getOut().println("extendsSimpleTagSupport:output");

[MSG]getJspContext() can probably be rewritten as jspContext

UnnecessaryGetter268

[SRC]JspWriter out = getJspContext().getOut()

[MSG]getOut() can probably be rewritten as out

UnnecessaryGetter268

[SRC]JspWriter out = getJspContext().getOut()

[MSG]getJspContext() can probably be rewritten as jspContext

UnnecessaryGetter270

[SRC]super.getJspBody().invoke(out)

[MSG]getJspBody() can probably be rewritten as jspBody

➥ TagLibraryResolverTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter265

[SRC]new RootLoader([] as URL[], Thread.currentThread().getCo..assLoader())

[MSG]getContextClassLoader() can probably be rewritten as contextClassLoader

UnnecessaryGetter272

[SRC]new ByteArrayResource('''<?xml version="1.0" encoding="UTF-8"?>

[MSG]getInputStream() can probably be rewritten as inputStream

UnnecessaryGetter272

[SRC]new ByteArrayResource('''<?xml version="1.0" encoding="UTF-8"?>

[MSG]getBytes() can probably be rewritten as bytes

UnnecessaryGetter2118

[SRC]new ByteArrayResource('''<?xml version="1.0" encoding="UTF-8"?>

[MSG]getBytes() can probably be rewritten as bytes

➥ TldReaderTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter228

[SRC]def is = new InputSource(res.getInputStream())

[MSG]getInputStream() can probably be rewritten as inputStream

UnnecessaryGetter233

[SRC]def reader = factory.newSAXParser().getXMLReader()

[MSG]getXMLReader() can probably be rewritten as XMLReader

➥ WebXmlTagLibraryReaderTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter231

[SRC]def reader = factory.newSAXParser().getXMLReader()

[MSG]getXMLReader() can probably be rewritten as XMLReader

ImportFromSamePackage320

[SRC]import org.codehaus.groovy.grails.web.pages.ext.jsp.WebX..ibraryReader

Package: src.test.org.codehaus.groovy.grails.web.servlet

➥ BindDataMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2160

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ DefaultGrailsApplicationAttributesTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper212

[SRC]void setUp() {

[MSG]The method setUp() does not call super.setUp()

➥ FlashScopeWithErrorsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod227

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnusedImport319

[SRC]import org.springframework.mock.web.MockHttpServletRequest

➥ GrailsHttpSessionTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod230

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

UnusedVariable242

[SRC]def mock = new MockHttpSession()

[MSG]The variable [mock] is not used

➥ RenderMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable2149

[SRC]def resopnse = mockController.response

[MSG]The variable [resopnse] is not used

UnusedVariable2163

[SRC]def resopnse = mockController.response

[MSG]The variable [resopnse] is not used

Package: src.test.org.codehaus.groovy.grails.web.servlet.filter

➥ AbstractServletFilterTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper257

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

Package: src.test.org.codehaus.groovy.grails.web.servlet.mvc

➥ AbstractGrailsControllerTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2112

[SRC]void runTest(Closure callable) {

[MSG]The method runTest is public but not a test method

AbcComplexity240

[SRC]protected void setUp() {

[MSG]The ABC score for method [setUp] is [63.6]

UnnecessaryGetter249

[SRC]ga = new DefaultGrailsApplication(gcl.getLoadedClasses(), gcl)

[MSG]getLoadedClasses() can probably be rewritten as loadedClasses

UnnecessaryGetter281

[SRC]servletContext = ctx.getServletContext()

[MSG]getServletContext() can probably be rewritten as servletContext

UnnecessaryGetter288

[SRC]appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnusedImport322

[SRC]import org.codehaus.groovy.grails.commons.spring.GrailsA..ationContext

➥ CommandObjectActionMethodsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert247

[SRC]void testInvokeControllerMethodWithCommandObjectAndRenderMethod() {

[MSG]Test method 'testInvokeControllerMethodWithCommandObjectAndRenderMethod' makes no assertions

UnusedVariable236

[SRC]def cmd = ga.getClassLoader().loadClass("SampleCommand").newInstance()

[MSG]The variable [cmd] is not used

UnusedVariable248

[SRC]def cmd = ga.getClassLoader().loadClass("SampleCommand").newInstance()

[MSG]The variable [cmd] is not used

UnusedVariable253

[SRC]def model = ctrl.renderWithCmd()

[MSG]The variable [model] is not used

UnnecessaryGetter236

[SRC]def cmd = ga.getClassLoader().loadClass("SampleCommand").newInstance()

[MSG]getClassLoader() can probably be rewritten as classLoader

UnnecessaryGetter248

[SRC]def cmd = ga.getClassLoader().loadClass("SampleCommand").newInstance()

[MSG]getClassLoader() can probably be rewritten as classLoader

UnnecessaryGetter257

[SRC]def cmd1 = ga.getClassLoader().loadClass("SampleCommand"..ewInstance()

[MSG]getClassLoader() can probably be rewritten as classLoader

UnnecessaryGetter258

[SRC]def cmd2 = ga.getClassLoader().loadClass("SecondCommand"..ewInstance()

[MSG]getClassLoader() can probably be rewritten as classLoader

➥ CommandObjectEnhancementAppliedOnceTests.groovy

Rule NamePriorityLine #Source Line / Message
UseAssertTrueInsteadOfAssertEquals319

[SRC]assert WebMetaUtils.isCommandObjectAction(action) == true

[MSG]The expression '(WebMetaUtils.isCommandObjectAction(action) == true)' can be simplified to 'WebMetaUtils.isCommandObjectAction(action)'

UseAssertTrueInsteadOfAssertEquals323

[SRC]assert WebMetaUtils.isCommandObjectAction(fresh.index) == false

[MSG]The expression '(WebMetaUtils.isCommandObjectAction(fresh.index) == false)' can be simplified to '!WebMetaUtils.isCommandObjectAction(fresh.index)'

➥ CommandObjectErrorsTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedVariable263

[SRC]def error

[MSG]The variable [error] is not used

➥ CommandObjectsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod27

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ ControllerInheritanceTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert233

[SRC]void testCallSuperMethod() {

[MSG]Test method 'testCallSuperMethod' makes no assertions

➥ ControllersDynamicMethodsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod217

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

JUnitPublicNonTestMethod228

[SRC]void runTest(Closure callable) {

[MSG]The method runTest is public but not a test method

JUnitTestMethodWithoutAssert2134

[SRC]void testRenderMethod() {

[MSG]Test method 'testRenderMethod' makes no assertions

UnnecessaryGetter253

[SRC]def appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

➥ GrailsParameterMapTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert2111

[SRC]void testIterateOverMapContainingDate() {

[MSG]Test method 'testIterateOverMapContainingDate' makes no assertions

AbcComplexity235

[SRC]void testConversionHelperMethods() {

[MSG]The ABC score for method [testConversionHelperMethods] is [72.4]

UnnecessaryObjectReferences243

[SRC]map.array = ["one", "two" ] as String[]

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences244

[SRC]map.longNumber = 1234567890

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2133

[SRC]mockRequest.addParameter("a.e.g", "gValue")

[MSG]The code could be more concise by using a with() or identity() block

UseAssertTrueInsteadOfAssertEquals382

[SRC]assertEquals false, map.boolean('one')

[MSG]assertEquals can be simplified using assertTrue or assertFalse

UseAssertTrueInsteadOfAssertEquals383

[SRC]assertEquals true, map.boolean('bool')

[MSG]assertEquals can be simplified using assertTrue or assertFalse

➥ ParamsObjectTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryObjectReferences224

[SRC]request.addParameter("book.id", "10")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences225

[SRC]request.addParameter("publisher.name", "Apress")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences226

[SRC]request.addParameter("publisher.authors[0].name", "Fred")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences227

[SRC]request.addParameter("publisher.authors[1].name", "Joe")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences228

[SRC]request.addParameter("test..foo..bar", "Stuff")

[MSG]The code could be more concise by using a with() or identity() block

➥ RenderDynamicMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryObjectReferences2106

[SRC]testCtrl.renderXml()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2112

[SRC]testCtrl.renderJSON()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2118

[SRC]testCtrl.renderStatusAndText()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2124

[SRC]testCtrl.renderStatusOnly()

[MSG]The code could be more concise by using a with() or identity() block

ConsecutiveStringConcatenation330

[SRC]render "${'te' + 'xt'}"

[MSG]String concatenation can be joined into the literal 'text'

➥ SimpleGrailsControllerHelperTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTestMethodWithoutAssert251

[SRC]void testConstructHelper() {

[MSG]Test method 'testConstructHelper' makes no assertions

UnusedVariable253

[SRC]def webRequest = RequestContextHolder.currentRequestAttributes()

[MSG]The variable [webRequest] is not used

UnusedVariable254

[SRC]def helper = new SimpleGrailsControllerHelper(ga, ctx, servletContext)

[MSG]The variable [helper] is not used

UnnecessaryGetter262

[SRC]assert mv.getModel()["after"] == "value"

[MSG]getModel() can probably be rewritten as model

UnnecessaryGetter270

[SRC]assert mv.getModel()["after"] == "value"

[MSG]getModel() can probably be rewritten as model

UnnecessaryGetter278

[SRC]assert mv.getModel()["after"] == "/test3/list"

[MSG]getModel() can probably be rewritten as model

➥ TagLibDynamicMethodsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod217

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

Package: src.test.org.codehaus.groovy.grails.web.servlet.view

➥ GroovyPageViewTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper242

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

DuplicateImport37

[SRC]import org.springframework.web.context.request.*

Package: src.test.org.codehaus.groovy.grails.web.sitemesh

➥ FactoryHolderTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod239

[SRC]void refresh() {}

[MSG]The method refresh is both empty and not marked with @Override

UnnecessaryGetter212

[SRC]assertSame factory, FactoryHolder.getFactory()

[MSG]getFactory() can probably be rewritten as factory

UnnecessaryGetter218

[SRC]FactoryHolder.getFactory()

[MSG]getFactory() can probably be rewritten as factory

➥ GSPSitemeshPageTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitTearDownCallsSuper2108

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnusedVariable215

[SRC]def result = applyTemplate(template, [:])

[MSG]The variable [result] is not used

UnusedVariable223

[SRC]def result = applyTemplate(template, [:])

[MSG]The variable [result] is not used

UnusedVariable231

[SRC]def result = applyTemplate(template, [:])

[MSG]The variable [result] is not used

UnusedVariable239

[SRC]def result = applyTemplate(template, [:])

[MSG]The variable [result] is not used

UnusedVariable252

[SRC]def result = applyTemplate(template, [:])

[MSG]The variable [result] is not used

UnusedVariable261

[SRC]def result = applyTemplate(template, [:])

[MSG]The variable [result] is not used

UnusedVariable279

[SRC]def result = applyTemplate(template, [:], target1)

[MSG]The variable [result] is not used

UnusedVariable296

[SRC]def result = applyTemplate(template, [:])

[MSG]The variable [result] is not used

Package: src.test.org.codehaus.groovy.grails.web.taglib

➥ AbstractGrailsTagTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod267

[SRC]def withConfig(String text, Closure callable) {

[MSG]The method withConfig is public but not a test method

JUnitPublicNonTestMethod278

[SRC]def profile(String name, Closure callable) {

[MSG]The method profile is public but not a test method

JUnitPublicNonTestMethod288

[SRC]def withTag(String tagName, Writer out, Closure callable) {

[MSG]The method withTag is public but not a test method

JUnitPublicNonTestMethod2242

[SRC]void runTest(Closure callable) {

[MSG]The method runTest is public but not a test method

JUnitPublicNonTestMethod2246

[SRC]void printCompiledSource(template, params = [:]) {

[MSG]The method printCompiledSource is public but not a test method

JUnitPublicNonTestMethod2252

[SRC]def getCompiledSource(template, params = [:]) {

[MSG]The method getCompiledSource is public but not a test method

JUnitPublicNonTestMethod2269

[SRC]def assertCompiledSourceContains(expected, template, params = [:]) {

[MSG]The method assertCompiledSourceContains is public but not a test method

JUnitPublicNonTestMethod2274

[SRC]void assertOutputContains(expected, template, params = [:]) {

[MSG]The method assertOutputContains is public but not a test method

JUnitPublicNonTestMethod2279

[SRC]void assertOutputNotContains(expected, template, params = [:]) {

[MSG]The method assertOutputNotContains is public but not a test method

JUnitPublicNonTestMethod2297

[SRC]void assertOutputEquals(expected, template, params = [:]..tring() }) {

[MSG]The method assertOutputEquals is public but not a test method

JUnitPublicNonTestMethod2323

[SRC]def applyTemplate(template, params = [:], target = null,..e = null ) {

[MSG]The method applyTemplate is public but not a test method

JUnitPublicNonTestMethod2348

[SRC]String sitemeshPreprocess(String template) {

[MSG]The method sitemeshPreprocess is public but not a test method

JUnitPublicNonTestMethod2353

[SRC]String applyLayout(String layout, String template, Map params=[:]) {

[MSG]The method applyLayout is public but not a test method

JUnitSetUpCallsSuper2139

[SRC]protected void setUp() throws Exception {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper2218

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

AbcComplexity2139

[SRC]protected void setUp() throws Exception {

[MSG]The ABC score for method [setUp] is [80.7]

UnusedVariable2111

[SRC]GroovyPageOutputStack stack=GroovyPageOutputStack.createNew(out)

[MSG]The variable [stack] is not used

UnusedVariable2266

[SRC]String text = sw.toString()

[MSG]The variable [text] is not used

UnnecessaryGetter2188

[SRC]JstlUtils.exposeLocalizationContext webRequest.getRequest(),null

[MSG]getRequest() can probably be rewritten as request

UnnecessaryGetter2199

[SRC]appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnusedImport313

[SRC]import org.codehaus.groovy.grails.plugins.PluginMetaManager

➥ ApplicationTagLibTests.groovy

Rule NamePriorityLine #Source Line / Message
MethodCount215

[SRC]class ApplicationTagLibTests extends AbstractGrailsTagTests {

[MSG]Class org.codehaus.groovy.grails.web.taglib.ApplicationTagLibTests has 45 methods

UnnecessaryGetter220

[SRC]assertOutputEquals "/test/plugins/controllers-${GrailsUt..g", template

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

➥ CoreTagsTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import grails.util.GrailsUtil

➥ CountryTagLibTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod288

[SRC]void assertResultContains(result, expectedSubstring) {

[MSG]The method assertResultContains is public but not a test method

➥ FormRenderingTagLibTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod226

[SRC]void assertOutputEquals(expected, template, params = [:]) {

[MSG]The method assertOutputEquals is public but not a test method

➥ FormTagLib2Tests.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitHashMapInstantiation2251

[SRC]Map attrs = new HashMap()

[MSG]HashMap objects are better instantiated using the form "[] as HashMap"

JUnitTestMethodWithoutAssert223

[SRC]void testDatePickerTagWithDefaultDateAndPrecision() {

[MSG]Test method 'testDatePickerTagWithDefaultDateAndPrecision' makes no assertions

JUnitTestMethodWithoutAssert227

[SRC]void testDatePickerTagWithYearPrecision() {

[MSG]Test method 'testDatePickerTagWithYearPrecision' makes no assertions

JUnitTestMethodWithoutAssert231

[SRC]void testDatePickerTagWithMonthPrecision() {

[MSG]Test method 'testDatePickerTagWithMonthPrecision' makes no assertions

JUnitTestMethodWithoutAssert235

[SRC]void testDatePickerTagWithDayPrecision() {

[MSG]Test method 'testDatePickerTagWithDayPrecision' makes no assertions

JUnitTestMethodWithoutAssert239

[SRC]void testDatePickerTagWithHourPrecision() {

[MSG]Test method 'testDatePickerTagWithHourPrecision' makes no assertions

JUnitTestMethodWithoutAssert243

[SRC]void testDatePickerTagWithMinutePrecision() {

[MSG]Test method 'testDatePickerTagWithMinutePrecision' makes no assertions

JUnitTestMethodWithoutAssert247

[SRC]void testDatePickerTagWithCustomDate() {

[MSG]Test method 'testDatePickerTagWithCustomDate' makes no assertions

JUnitTestMethodWithoutAssert274

[SRC]void testDatePickerTagWithCustomDateAndPrecision() {

[MSG]Test method 'testDatePickerTagWithCustomDateAndPrecision' makes no assertions

UnusedPrivateField216

[SRC]private static final def SELECT_TAG_NAME = "testSelect"

[MSG]The field SELECT_TAG_NAME is not used within FormTagLib2Tests.groovy

UnusedPrivateMethod2225

[SRC]private void assertSelectFieldPresentWithValue(Document ..ing value) {

[MSG]The method assertSelectFieldPresentWithValue is not used within FormTagLib2Tests.groovy

UnusedPrivateMethod2231

[SRC]private void assertSelectFieldPresentWithValueAndText(Do..ing label) {

[MSG]The method assertSelectFieldPresentWithValueAndText is not used within FormTagLib2Tests.groovy

UnusedVariable2121

[SRC]String xp

[MSG]The variable [xp] is not used

UnnecessaryGetter252

[SRC]def defaultDate = Calendar.getInstance()

[MSG]getInstance() can probably be rewritten as instance

UnnecessaryGetter254

[SRC]Document document = getDatePickerOutput(null, 'day', def..e.getTime())

[MSG]getTime() can probably be rewritten as time

UnnecessaryGetter269

[SRC]DateFormat defaultFormat = DateFormat.getInstance()

[MSG]getInstance() can probably be rewritten as instance

➥ FormTagLib3Tests.groovy

Rule NamePriorityLine #Source Line / Message
ExplicitHashMapInstantiation2173

[SRC]final Map attrs = new HashMap()

[MSG]HashMap objects are better instantiated using the form "[] as HashMap"

UnusedPrivateField216

[SRC]private static final String DATE_PICKER_TAG_NAME = "testDatePicker"

[MSG]The field DATE_PICKER_TAG_NAME is not used within FormTagLib3Tests.groovy

UnusedPrivateField218

[SRC]private static final Collection DATE_PRECISIONS_INCLUDIN.. String[] ))

[MSG]The field DATE_PRECISIONS_INCLUDING_MINUTE is not used within FormTagLib3Tests.groovy

UnusedPrivateField219

[SRC]private static final Collection DATE_PRECISIONS_INCLUDIN.. String[] ))

[MSG]The field DATE_PRECISIONS_INCLUDING_HOUR is not used within FormTagLib3Tests.groovy

UnusedPrivateField220

[SRC]private static final Collection DATE_PRECISIONS_INCLUDIN.. String[] ))

[MSG]The field DATE_PRECISIONS_INCLUDING_DAY is not used within FormTagLib3Tests.groovy

UnusedPrivateField221

[SRC]private static final Collection DATE_PRECISIONS_INCLUDIN.. String[] ))

[MSG]The field DATE_PRECISIONS_INCLUDING_MONTH is not used within FormTagLib3Tests.groovy

UnnecessaryGetter2188

[SRC]final Element inputElement = document.getDocumentElement()

[MSG]getDocumentElement() can probably be rewritten as documentElement

➥ FormatTagLibTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter232

[SRC]assertOutputEquals("1980-02-03", template, [date:calender.getTime()])

[MSG]getTime() can probably be rewritten as time

UnnecessaryGetter238

[SRC]assertOutputEquals("February 3, 1980", template, [date:c...getTime()])

[MSG]getTime() can probably be rewritten as time

UnnecessaryGetter244

[SRC]assertOutputEquals("February 3, 1980 12:00 AM", template...getTime()])

[MSG]getTime() can probably be rewritten as time

UnnecessaryGetter279

[SRC]assertOutputEquals("1980-02-03", template, [date:calender.getTime()])

[MSG]getTime() can probably be rewritten as time

➥ GroovyFindAllTagTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryObjectReferences241

[SRC]tag.attributes = ['"expr"': " \${it.age > 19}", '"in"': "myObj"]

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences242

[SRC]tag.doStartTag()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences248

[SRC]tag.doEndTag()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryGetter253

[SRC]assertEquals("findAll", tag.getName())

[MSG]getName() can probably be rewritten as name

➥ GroovyGrepTagTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyCatchBlock215

[SRC]catch(Exception e) {

[MSG]The catch block is empty

➥ GroovySyntaxTagTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod256

[SRC]void doEndTag() {}

[MSG]The method doEndTag is both empty and not marked with @Override

EmptyMethod258

[SRC]void doStartTag() {}

[MSG]The method doStartTag is both empty and not marked with @Override

➥ InvokeTagLibAsMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod25

[SRC]void onSetUp() {

[MSG]The method onSetUp is public but not a test method

➥ JavascriptTagLibTests.groovy

Rule NamePriorityLine #Source Line / Message
EmptyMethod2381

[SRC]def prepareAjaxForm(Object attrs) {}

[MSG]The method prepareAjaxForm is both empty and not marked with @Override

JUnitPublicNonTestMethod2352

[SRC]def setRequestContext() {

[MSG]The method setRequestContext is public but not a test method

JUnitPublicNonTestMethod2356

[SRC]def setRequestContext(path) {

[MSG]The method setRequestContext is public but not a test method

JUnitPublicNonTestMethod2360

[SRC]def setupPluginController(tag) {

[MSG]The method setupPluginController is public but not a test method

MethodCount214

[SRC]class JavascriptTagLibTests extends AbstractGrailsTagTests {

[MSG]Class org.codehaus.groovy.grails.web.taglib.JavascriptTagLibTests has 39 methods

UnusedVariable245

[SRC]String newLine = EOL

[MSG]The variable [newLine] is not used

UnusedVariable2217

[SRC]def retval = tag.call(attrs) {"body"}

[MSG]The variable [retval] is not used

UnnecessaryGetter251

[SRC]def grailsVersion = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

UnnecessaryGetter2184

[SRC]GroovyObject tagLibrary = (GroovyObject) tag.getOwner()

[MSG]getOwner() can probably be rewritten as owner

UnnecessaryGetter2193

[SRC]sw.getBuffer().delete(0, sw.getBuffer().length())

[MSG]getBuffer() can probably be rewritten as buffer

UnnecessaryGetter2193

[SRC]sw.getBuffer().delete(0, sw.getBuffer().length())

[MSG]getBuffer() can probably be rewritten as buffer

UnnecessaryGetter2198

[SRC]sw.getBuffer().delete(0, sw.getBuffer().length())

[MSG]getBuffer() can probably be rewritten as buffer

UnnecessaryGetter2198

[SRC]sw.getBuffer().delete(0, sw.getBuffer().length())

[MSG]getBuffer() can probably be rewritten as buffer

UnnecessaryGetter2211

[SRC]GroovyObject tagLibrary = (GroovyObject) tag.getOwner()

[MSG]getOwner() can probably be rewritten as owner

UnnecessaryDefInMethodDeclaration3377

[SRC]def doRemoteFunction(Object taglib, Object attrs, Object out) {

[MSG]The def keyword is unneeded when a method returns the Object type

➥ LinkRenderingTagLib2Tests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod238

[SRC]void assertOutputEquals(expected, template, params = [:]) {

[MSG]The method assertOutputEquals is public but not a test method

UnusedImport33

[SRC]import org.codehaus.groovy.runtime.InvokerHelper

➥ LinkRenderingTagLibTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport33

[SRC]import org.codehaus.groovy.runtime.InvokerHelper

➥ NamespacedTagLibMethodTests.groovy

Rule NamePriorityLine #Source Line / Message
UnusedImport34

[SRC]import org.springframework.validation.MapBindingResult

➥ PluginTagLibTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter213

[SRC]def grailsVersion = GrailsUtil.getGrailsVersion()

[MSG]getGrailsVersion() can probably be rewritten as grailsVersion

➥ PropertyEditorTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryCollectCall295

[SRC]assertEquals(["grails", "groovy"], obj.tags.collect {it.name})

[MSG]The call to collect could probably be rewritten as a spread expression: obj.tags*.name

UnnecessaryGetter2130

[SRC]Object v = getValue()

[MSG]getValue() can probably be rewritten as value

➥ RenderTagLibTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2367

[SRC]void checkTagOutput(output, expectedClassValue, expected..edContent) {

[MSG]The method checkTagOutput is public but not a test method

JUnitPublicNonTestMethod2408

[SRC]void checkTagOutput(output, expectedClassValue, expected..therAttrs) {

[MSG]The method checkTagOutput is public but not a test method

JUnitTestMethodWithoutAssert239

[SRC]void testPaginateTag() {

[MSG]Test method 'testPaginateTag' makes no assertions

JUnitTestMethodWithoutAssert2150

[SRC]void testSortableColumnTag() {

[MSG]Test method 'testSortableColumnTag' makes no assertions

JUnitTestMethodWithoutAssert2164

[SRC]void testSortableColumnTagWithTitleKey() {

[MSG]Test method 'testSortableColumnTagWithTitleKey' makes no assertions

JUnitTestMethodWithoutAssert2210

[SRC]void testSortableColumnTagWithAction() {

[MSG]Test method 'testSortableColumnTagWithAction' makes no assertions

JUnitTestMethodWithoutAssert2224

[SRC]void testSortableColumnTagWithDefaultOrder() {

[MSG]Test method 'testSortableColumnTagWithDefaultOrder' makes no assertions

JUnitTestMethodWithoutAssert2268

[SRC]void testSortableColumnTagWithAdditionalAttributes() {

[MSG]Test method 'testSortableColumnTagWithAdditionalAttributes' makes no assertions

JUnitTestMethodWithoutAssert2283

[SRC]void testSortableColumnTagSorted() {

[MSG]Test method 'testSortableColumnTagSorted' makes no assertions

UnusedVariable248

[SRC]def head = ""

[MSG]The variable [head] is not used

UnnecessaryGetter2292

[SRC]webRequest.getParams().put("sort", "title")

[MSG]getParams() can probably be rewritten as params

UnnecessaryGetter2293

[SRC]webRequest.getParams().put("order", "asc")

[MSG]getParams() can probably be rewritten as params

UnnecessaryGetter2309

[SRC]webRequest.getParams().put("sort", "title")

[MSG]getParams() can probably be rewritten as params

UnnecessaryGetter2310

[SRC]webRequest.getParams().put("order", "desc")

[MSG]getParams() can probably be rewritten as params

UnnecessaryGetter2326

[SRC]webRequest.getParams().put("sort", "price")

[MSG]getParams() can probably be rewritten as params

UnnecessaryGetter2327

[SRC]webRequest.getParams().put("order", "desc")

[MSG]getParams() can probably be rewritten as params

UnnecessaryGetter2343

[SRC]webRequest.getParams().put("sort", "price")

[MSG]getParams() can probably be rewritten as params

UnnecessaryGetter2344

[SRC]webRequest.getParams().put("order", "desc")

[MSG]getParams() can probably be rewritten as params

➥ SelectTagTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2244

[SRC]void checkMultiSelect(List categories, List selected, Cl..sSelected) {

[MSG]The method checkMultiSelect is public but not a test method

JUnitTestMethodWithoutAssert2218

[SRC]void testMultipleSelect() {

[MSG]Test method 'testMultipleSelect' makes no assertions

JUnitTestMethodWithoutAssert2230

[SRC]void testMultipleSelectWithObjectValues() {

[MSG]Test method 'testMultipleSelectWithObjectValues' makes no assertions

UnusedPrivateMethod2333

[SRC]private void assertSelectFieldNotPresent(Document docume..fieldName) {

[MSG]The method assertSelectFieldNotPresent is not used within SelectTagTests.groovy

➥ ValidationTagLibTests.groovy

Rule NamePriorityLine #Source Line / Message
MethodCount214

[SRC]class ValidationTagLibTests extends AbstractGrailsTagTests {

[MSG]Class org.codehaus.groovy.grails.web.taglib.ValidationTagLibTests has 32 methods

UnnecessaryObjectReferences2215

[SRC]b.publisherURL = new URL("http://canoo.com/gia")

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2216

[SRC]b.releaseDate = new Date()

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2217

[SRC]b.usPrice = 10.99

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2506

[SRC]gcl.parseClass('''

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2517

[SRC]gcl.parseClass('''

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2618

[SRC]gcl.parseClass('''

[MSG]The code could be more concise by using a with() or identity() block

UnnecessaryObjectReferences2629

[SRC]gcl.parseClass('''

[MSG]The code could be more concise by using a with() or identity() block

Package: src.test.org.codehaus.groovy.grails.web.util

➥ StreamCharBufferGroovyTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper27

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

➥ WebUtilsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2116

[SRC]void clearGrailsWebRequest() {

[MSG]The method clearGrailsWebRequest is public but not a test method

JUnitSetUpCallsSuper217

[SRC]protected void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper237

[SRC]protected void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter278

[SRC]assertNull RequestContextHolder.getRequestAttributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGetter298

[SRC]assertNull RequestContextHolder.getRequestAttributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGetter2112

[SRC]assertEquals mockWebRequest, RequestContextHolder.getReq..Attributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGetter2129

[SRC]assertNull RequestContextHolder.getRequestAttributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

UnnecessaryGetter2135

[SRC]assertNull RequestContextHolder.getRequestAttributes()

[MSG]getRequestAttributes() can probably be rewritten as requestAttributes

Package: src.test.org.codehaus.groovy.grails.webflow

➥ FlowCommandObjectsTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod287

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

UnnecessaryGetter223

[SRC]def model = getFlowScope()

[MSG]getFlowScope() can probably be rewritten as flowScope

UnnecessaryGetter251

[SRC]def model = getFlowScope()

[MSG]getFlowScope() can probably be rewritten as flowScope

UnnecessaryGetter274

[SRC]def model = getFlowScope()

[MSG]getFlowScope() can probably be rewritten as flowScope

UnusedImport36

[SRC]import org.springframework.webflow.context.servlet.Servl..ernalContext

UnusedImport35

[SRC]import org.codehaus.groovy.grails.webflow.engine.builder.FlowBuilder

UnusedImport34

[SRC]import org.springframework.webflow.definition.FlowDefinition

➥ FlowRedirectTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod252

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

UnnecessaryGetter223

[SRC]assertEquals "contextRelative:/test/foo",context.getExte..edirectUrl()

[MSG]getExternalRedirectUrl() can probably be rewritten as externalRedirectUrl

UnnecessaryGetter232

[SRC]assertEquals "contextRelative:/test/foo/1",context.getEx..edirectUrl()

[MSG]getExternalRedirectUrl() can probably be rewritten as externalRedirectUrl

UnnecessaryGetter244

[SRC]assertEquals "contextRelative:/mycontroller/foo",context..edirectUrl()

[MSG]getExternalRedirectUrl() can probably be rewritten as externalRedirectUrl

UnusedImport310

[SRC]import org.springframework.webflow.definition.FlowDefinition

➥ FlowTagInvokationTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod233

[SRC]void onInit() {

[MSG]The method onInit is public but not a test method

JUnitPublicNonTestMethod242

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

UnnecessaryGetter220

[SRC]def model = getFlowScope()

[MSG]getFlowScope() can probably be rewritten as flowScope

UnnecessaryGetter229

[SRC]def model = getFlowScope()

[MSG]getFlowScope() can probably be rewritten as flowScope

UnusedImport35

[SRC]import org.codehaus.groovy.grails.webflow.engine.builder.FlowBuilder

UnusedImport34

[SRC]import org.springframework.webflow.definition.FlowDefinition

➥ SubflowExecutionTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod229

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

➥ SubflowExecutionWithExternalSubflowTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod221

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

UnusedImport33

[SRC]import junit.framework.TestCase

Package: src.test.org.codehaus.groovy.grails.webflow.engine.builder

➥ ControllerFlowRegistryTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper222

[SRC]void setUp() {

[MSG]The method setUp() does not call super.setUp()

UnnecessaryGetter273

[SRC]flowBuilderServices.expressionParser = DefaultExpression..sionParser()

[MSG]getExpressionParser() can probably be rewritten as expressionParser

UnnecessaryGetter278

[SRC]FlowDefinitionRegistry registry = factoryBean.getObject()

[MSG]getObject() can probably be rewritten as object

UnnecessaryGetter281

[SRC]assertEquals 1,registry.getFlowDefinitionCount()

[MSG]getFlowDefinitionCount() can probably be rewritten as flowDefinitionCount

UnusedImport35

[SRC]import org.codehaus.groovy.grails.support.MockApplicationContext

➥ FlowBuilderDecisionExecutionTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod210

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

➥ FlowBuilderDynamicTransitionTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod233

[SRC]String getFlowId() { "myFlow" }

[MSG]The method getFlowId is public but not a test method

JUnitPublicNonTestMethod235

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

UnnecessaryGetter212

[SRC]def startState = flowDefinition.getStartState()

[MSG]getStartState() can probably be rewritten as startState

➥ FlowBuilderExecutionTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod210

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

UnnecessaryGetter241

[SRC]def model = getFlowScope()

[MSG]getFlowScope() can probably be rewritten as flowScope

➥ FlowBuilderSubFlowExecutionTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod229

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

JUnitPublicNonTestMethod259

[SRC]def foo() { "bar" }

[MSG]The method foo is public but not a test method

UnnecessaryGetter273

[SRC]def theFlow = getFlowDefinition()

[MSG]getFlowDefinition() can probably be rewritten as flowDefinition

➥ FlowBuilderTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitSetUpCallsSuper216

[SRC]void setUp() {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper226

[SRC]void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

UnnecessaryGetter223

[SRC]flowBuilderServices.expressionParser = DefaultExpression..sionParser()

[MSG]getExpressionParser() can probably be rewritten as expressionParser

UnnecessaryGetter2154

[SRC]def flow = new FlowBuilder("myFlow",getFlowBuilderServic..pl()).flow {

[MSG]getFlowBuilderServices() can probably be rewritten as flowBuilderServices

➥ FlowBuilderTransitionCriteriaTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod27

[SRC]Closure getFlowClosure() {

[MSG]The method getFlowClosure is public but not a test method

➥ RuntimeRedirectActionTests.groovy

Rule NamePriorityLine #Source Line / Message
UnnecessaryGetter227

[SRC]context.getFlowScope().put("id", "1")

[MSG]getFlowScope() can probably be rewritten as flowScope

UnnecessaryGetter229

[SRC]assert "contextRelative:/book/show/1" == ext.getExternalRedirectUrl()

[MSG]getExternalRedirectUrl() can probably be rewritten as externalRedirectUrl

UnnecessaryGetter231

[SRC]context.getFlowScope().put("id", "2")

[MSG]getFlowScope() can probably be rewritten as flowScope

UnnecessaryGetter233

[SRC]assert "contextRelative:/book/show/2" == ext.getExternalRedirectUrl()

[MSG]getExternalRedirectUrl() can probably be rewritten as externalRedirectUrl

Package: src.test.org.codehaus.groovy.grails.webflow.support

➥ AbstractGrailsTagAwareFlowExecutionTests.groovy

Rule NamePriorityLine #Source Line / Message
JUnitPublicNonTestMethod2156

[SRC]FlowDefinition registerFlow(String flowId, Closure flowClosure) {

[MSG]The method registerFlow is public but not a test method

JUnitPublicNonTestMethod2165

[SRC]FlowDefinition getFlowDefinition() {

[MSG]The method getFlowDefinition is public but not a test method

JUnitPublicNonTestMethod2173

[SRC]String getFlowId() { 'testFlow' }

[MSG]The method getFlowId is public but not a test method

JUnitPublicNonTestMethod2175

[SRC]abstract Closure getFlowClosure()

[MSG]The method getFlowClosure is public but not a test method

JUnitSetUpCallsSuper263

[SRC]final void setUp() throws Exception {

[MSG]The method setUp() does not call super.setUp()

JUnitTearDownCallsSuper2136

[SRC]final void tearDown() {

[MSG]The method tearDown() does not call super.tearDown()

AbcComplexity263

[SRC]final void setUp() throws Exception {

[MSG]The ABC score for method [setUp] is [75.0]

UnnecessaryGetter2110

[SRC]appCtx = springConfig.getApplicationContext()

[MSG]getApplicationContext() can probably be rewritten as applicationContext

UnnecessaryGetter2118

[SRC]flowBuilderServices.expressionParser = DefaultExpression..sionParser()

[MSG]getExpressionParser() can probably be rewritten as expressionParser

UnnecessaryGetter2157

[SRC]FlowBuilder builder = new FlowBuilder(flowId, flowClosur..nRegistry())

[MSG]getFlowDefinitionRegistry() can probably be rewritten as flowDefinitionRegistry

UnnecessaryGetter2160

[SRC]FlowAssembler assembler = new FlowAssembler(builder, bui..erContext())

[MSG]getFlowBuilderContext() can probably be rewritten as flowBuilderContext

UnnecessaryGetter2161

[SRC]getFlowDefinitionRegistry().registerFlowDefinition(new D..(assembler))

[MSG]getFlowDefinitionRegistry() can probably be rewritten as flowDefinitionRegistry

UnnecessaryGetter2162

[SRC]return getFlowDefinitionRegistry().getFlowDefinition(flowId)

[MSG]getFlowDefinitionRegistry() can probably be rewritten as flowDefinitionRegistry

UnnecessaryGetter2166

[SRC]return registerFlow(getFlowId(), getFlowClosure())

[MSG]getFlowId() can probably be rewritten as flowId

UnnecessaryGetter2166

[SRC]return registerFlow(getFlowId(), getFlowClosure())

[MSG]getFlowClosure() can probably be rewritten as flowClosure

UnusedImport315

[SRC]import org.codehaus.groovy.runtime.InvokerHelper

Rule Descriptions

#Rule NameDescription
1AbcComplexityChecks the ABC metric of size/complexity for methods/classes.A method (or "closure field") with an ABC complexity value (score) greater than the maxMethodComplexity property (60) causes a violation. Likewise, a class that has an (average method) ABC complexityvalue greater than the maxClassAverageMethodComplexity property (60) causes a violation.
2AddEmptyStringFinds empty string literals which are being added. This is an inefficient way to convert any type to a String.
3AssignmentInConditionalAn assignment operator (=) was used in a conditional test. This is usually a typo, and the comparison operator (==) was intended.
4BigDecimalInstantiationChecks for calls to the BigDecimal constructors that take a double parameter, which may result in an unexpected BigDecimal value.
5BooleanGetBooleanThis rule catches usages of java.lang.Boolean.getBoolean(String) which reads a boolean from the System properties. It is often mistakenly used to attempt to read user input or parse a String into a boolean. It is a poor piece of API to use; replace it with System.properties['prop̈́'].
6BooleanMethodReturnsNullMethod with Boolean return type returns explicit null. A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException.
7BrokenOddnessCheckThe code uses x % 2 == 1 to check to see if a value is odd, but this won't work for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check for oddness, consider using x & 1 == 1, or x % 2 != 0.
8BusyWaitBusy waiting (forcing a Thread.sleep() while waiting on a condition) should be avoided. Prefer using the gate and barrier objects in the java.util.concurrent package.
9ChainedTestA test method that invokes another test method is a chained test; the methods are dependent on one another. Tests should be isolated, and not be dependent on one another.
10ClassSizeChecks if the size of a class exceeds the number of lines specified by the maxLines property (1000).
11CloneableWithoutCloneA class that implements java.lang.Cloneable should define a clone() method.
12CompareToWithoutComparableIf you implement a compareTo method then you should also implement the Comparable interface. If you don't then you could possibly get an exception if the Groovy == operator is invoked on your object. This is an issue fixed in Groovy 1.8 but present in previous versions.
13ConfusingTernaryIn a ternary expression avoid negation in the test. For example, rephrase: "(x != y) ? diff : same" as: "(x == y) ? same : diff". Consistent use of this rule makes the code easier to read. Also, this resolves trivial ordering problems, such as "does the error case go first?" or "does the common case go first?".
14ConsecutiveLiteralAppendsViolations occur when method calls to append(Object) are chained together with literals as parameters. The chained calls can be joined into one invocation.
15ConsecutiveStringConcatenationCatches concatenation of two string literals on the same line. These can safely by joined.
16ConstantIfExpressionChecks for if statements with a constant value for the if expression, such as true, false, null, or a literal constant value.
17ConstantTernaryExpressionChecks for ternary expressions with a constant value for the boolean expression, such as true, false, null, or a literal constant value.
18CoupledTestCaseThis rule finds test cases that are coupled to other test cases, either by invoking static methods on another test case or by creating instances of another test case. If you require shared logic in test cases then extract that logic to a new class where it can properly be reused.
19CyclomaticComplexityChecks the cyclomatic complexity for methods/classes.A method (or "closure field") with a cyclomatic complexity value greater than the maxMethodComplexity property (20) causes a violation. Likewise, a class that has an (average method) cyclomatic complexityvalue greater than the maxClassAverageMethodComplexity property (20) causes a violation.
20DeadCodeDead code appears after a return statement or an exception is thrown. If code appears after one of these statements then it will never be executed and can be safely deleted.
21DoubleCheckedLockingThis rule detects double checked locking, where a 'lock hint' is tested for null before initializing an object within a synchronized block. Double checked locking does not guarantee correctness and is an anti-pattern.
22DoubleNegativeThere is no point in using a double negative, it is always positive. For instance !!x can always be simplified to x. And !(!x) can as well.
23DuplicateCaseStatementCheck for duplicate case statements in a switch block, such as two equal integers or strings.
24DuplicateImportDuplicate import statements are unnecessary.
25EmptyCatchBlockIn most cases, exceptions should not be caught and ignored (swallowed).
26EmptyElseBlockEmpty else blocks are confusing and serve no purpose.
27EmptyFinallyBlockEmpty finally blocks are confusing and serve no purpose.
28EmptyForStatementEmpty for statements are confusing and serve no purpose.
29EmptyIfStatementEmpty if statements are confusing and serve no purpose.
30EmptyInstanceInitializerAn empty class instance initializer was found. It is safe to remove it.
31EmptyMethodA method was found without an implementation. If the method is overriding or implementing a parent method, then mark it with the @Override annotation.
32EmptyStaticInitializerAn empty static initializer was found. It is safe to remove it.
33EmptySwitchStatementEmpty switch statements are confusing and serve no purpose.
34EmptySynchronizedStatementEmpty synchronized statements are confusing and serve no purpose.
35EmptyTryBlockEmpty try blocks are confusing and serve no purpose.
36EmptyWhileStatementEmpty while statements are confusing and serve no purpose.
37EqualsAndHashCodeIf either the boolean equals(Object) or the int hashCode() methods are overridden within a class, then both must be overridden.
38ExplicitArrayListInstantiationThis rule checks for the explicit instantiation of an ArrayList using the no-arg constructor. In Groovy, it is best to write new ArrayList() as [], which creates the same object.
39ExplicitCallToAndMethodThis rule detects when the and(Object) method is called directly in code instead of using the & operator. A groovier way to express this: a.and(b) is this: a & b
40ExplicitCallToCompareToMethodThis rule detects when the compareTo(Object) method is called directly in code instead of using the <=>, >, >=, <, and <= operators. A groovier way to express this: a.compareTo(b) is this: a <=> b, or using the other operators.
41ExplicitCallToDivMethodThis rule detects when the div(Object) method is called directly in code instead of using the / operator. A groovier way to express this: a.div(b) is this: a / b
42ExplicitCallToEqualsMethodThis rule detects when the equals(Object) method is called directly in code instead of using the == or != operator. A groovier way to express this: a.equals(b) is this: a == b and a groovier way to express : !a.equals(b) is : a != b
43ExplicitCallToGetAtMethodThis rule detects when the getAt(Object) method is called directly in code instead of using the [] index operator. A groovier way to express this: a.getAt(b) is this: a[b]
44ExplicitCallToLeftShiftMethodThis rule detects when the leftShift(Object) method is called directly in code instead of using the << operator. A groovier way to express this: a.leftShift(b) is this: a << b
45ExplicitCallToMinusMethodThis rule detects when the minus(Object) method is called directly in code instead of using the - operator. A groovier way to express this: a.minus(b) is this: a - b
46ExplicitCallToModMethodThis rule detects when the mod(Object) method is called directly in code instead of using the % operator. A groovier way to express this: a.mod(b) is this: a % b
47ExplicitCallToMultiplyMethodThis rule detects when the minus(Object) method is called directly in code instead of using the * operator. A groovier way to express this: a.multiply(b) is this: a * b
48ExplicitCallToOrMethodThis rule detects when the or(Object) method is called directly in code instead of using the | operator. A groovier way to express this: a.or(b) is this: a | b
49ExplicitCallToPlusMethodThis rule detects when the plus(Object) method is called directly in code instead of using the + operator. A groovier way to express this: a.plus(b) is this: a + b
50ExplicitCallToPowerMethodThis rule detects when the power(Object) method is called directly in code instead of using the ** operator. A groovier way to express this: a.power(b) is this: a ** b
51ExplicitCallToRightShiftMethodThis rule detects when the rightShift(Object) method is called directly in code instead of using the >> operator. A groovier way to express this: a.rightShift(b) is this: a >> b
52ExplicitCallToXorMethodThis rule detects when the xor(Object) method is called directly in code instead of using the ^ operator. A groovier way to express this: a.xor(b) is this: a ^ b
53ExplicitGarbageCollectionCalls to System.gc(), Runtime.getRuntime().gc(), and System.runFinalization() are not advised. Code should have the same behavior whether the garbage collection is disabled using the option -Xdisableexplicitgc or not. Moreover, "modern" jvms do a very good job handling garbage collections. If memory usage issues unrelated to memory leaks develop within an application, it should be dealt with JVM options rather than within the code itself.
54ExplicitHashMapInstantiationThis rule checks for the explicit instantiation of a HashMap using the no-arg constructor. In Groovy, it is best to write new HashMap() as [:], which creates the same object.
55ExplicitHashSetInstantiationThis rule checks for the explicit instantiation of a HashSet using the no-arg constructor. In Groovy, it is best to write new HashSet() as [] as Set, which creates the same object.
56ExplicitLinkedListInstantiationThis rule checks for the explicit instantiation of a LinkedList using the no-arg constructor. In Groovy, it is best to write new LinkedList() as [] as Queue, which creates the same object.
57ExplicitStackInstantiationThis rule checks for the explicit instantiation of a Stack using the no-arg constructor. In Groovy, it is best to write new Stack() as [] as Stack, which creates the same object.
58ExplicitTreeSetInstantiationThis rule checks for the explicit instantiation of a TreeSet using the no-arg constructor. In Groovy, it is best to write new TreeSet() as [] as SortedSet, which creates the same object.
59GStringAsMapKeyA GString should not be used as a map key since its hashcode is not guaranteed to be stable. Consider calling key.toString().
60GroovyLangImmutableThe groovy.lang.Immutable annotation has been deprecated and replaced by groovy.transform.Immutable. Do not use the Immutable in groovy.lang.
61ImportFromSamePackageAn import of a class that is within the same package is unnecessary.
62InconsistentPropertyLockingClass contains similarly-named get and set methods where one method of the pair is marked either @WithReadLock or @WithWriteLock and the other is not locked at all.
63InconsistentPropertySynchronizationClass contains similarly-named get and set methods where the set method is synchronized and the get method is not, or the get method is synchronized and the set method is not.
64IntegerGetIntegerThis rule catches usages of java.lang.Integer.getInteger(String, ...) which reads an Integer from the System properties. It is often mistakenly used to attempt to read user input or parse a String into an Integer. It is a poor piece of API to use; replace it with System.properties['prop'].
65InvertedIfElseAn inverted if-else statement is one in which there is a single if statement with a single else branch and the boolean test of the if is negated. For instance if (!x) false else true. It is usually clearer to write this as if (x) true else false.
66JUnitAssertAlwaysFailsChecks for JUnit assert() method calls with constant arguments such that the assertion always fails. This includes: assertTrue(false), assertFalse(true) and assertNull(CONSTANT).
67JUnitAssertAlwaysSucceedsChecks for JUnit assert() method calls with constant arguments such that the assertion always succeeds. This includes: assertTrue(true), assertFalse(false) and assertNull(null).
68JUnitFailWithoutMessageThis rule detects JUnit calling the fail() method without an argument. For better error reporting you should always provide a message.
69JUnitPublicNonTestMethodChecks if a JUnit test class contains public methods other than standard test methods, JUnit framework methods or methods with JUnit annotations.
70JUnitSetUpCallsSuperChecks that if the JUnit setUp() method is defined, that it includes a call to super.setUp().
71JUnitTearDownCallsSuperChecks that if the JUnit tearDown() method is defined, that it includes a call to super.tearDown().
72JUnitTestMethodWithoutAssertThis rule searches for test methods that do not contain assert statements. Either the test method is missing assert statements, which is an error, or the test method contains custom assert statements that do not follow a proper assert naming convention. Test methods are defined as public void methods that begin with the work test or have a @Test annotation. By default this rule applies to the default test class names, but this can be changed using the rule's applyToClassNames property.
73JUnitUnnecessarySetUpChecks for JUnit setUp() methods that contain only a call to super.setUp().
74JUnitUnnecessaryTearDownChecks for JUnit tearDown() methods that contain only a call to super.tearDown().
75MethodCountA class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.The maxMethods property (30) specifies the threshold.
76MethodSizeChecks if the size of a method exceeds the number of lines specified by the maxLines property (100).
77NestedBlockDepthChecks for blocks or closures nested more than maxNestedBlockDepth (5) levels deep.
78NestedSynchronizationNested synchronized statements should be avoided. Nested synchronized statements are either useless (if the lock objects are identical) or prone to deadlock.
79RemoveAllOnSelfDon't use removeAll to clear a collection. If you want to remove all elements from a collection c, use c.clear, not c.removeAll(c). Calling c.removeAll(c) to clear a collection is less clear, susceptible to errors from typos, less efficient and for some collections, might throw a ConcurrentModificationException.
80ReturnFromFinallyBlockReturning from a finally block is confusing and can hide the original exception.
81ReturnsNullInsteadOfEmptyArrayConsider returning a zero length array rather than null. It is often a better design to return a length zero array rather than a null reference to indicate that there are no results (i.e., an empty list of results). This way, no explicit check for null is needed by clients of the method.
82ReturnsNullInsteadOfEmptyCollectionConsider returning a zero length collection rather than null. It is often a better design to return a length zero collection rather than a null reference to indicate that there are no results (i.e., an empty list of results). This way, no explicit check for null is needed by clients of the method.
83SerialVersionUIDA serialVersionUID is normally intended to be used with Serialization. It needs to be of type long, static, and final. Also, it should have a visibility modifier such as public or private. Providing no modifier creates a Property and Groovy generates a getter, which is probably not intended.
84SerializableClassMustDefineSerialVersionUIDClasses that implement Serializable should define a serialVersionUID. If you don't define serialVersionUID, the system will make one by hashing most of your class's features. Then if you change anything, the UID will change and Java won't let you reload old data.
85SimpleDateFormatMissingLocaleBe sure to specify a Locale when creating a new instance of SimpleDateFormat; the class is locale-sensitive. If you instantiate SimpleDateFormat without a Locale parameter, it will format the date and time according to the default Locale. Both the pattern and the Locale determine the format. For the same pattern, SimpleDateFormat may format a date and time differently if the Locale varies.
86StaticCalendarFieldCalendar objects should not be used as static fields. Calendars are inherently unsafe for multihtreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application.
87StaticDateFormatFieldDateFormat objects should not be used as static fields. DateFormat are inherently unsafe for multithreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application.
88StaticMatcherFieldMatcher objects should not be used as static fields. Calendars are inherently unsafe for multithreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application.
89SynchronizedMethodThis rule reports uses of the synchronized keyword on methods. Synchronized methods are the same as synchronizing on 'this', which effectively make your synchronization policy public and modifiable by other objects. To avoid possibilities of deadlock, it is better to synchronize on internal objects.
90SynchronizedOnBoxedPrimitiveThe code synchronizes on a boxed primitive constant, such as an Integer. Since Integer objects can be cached and shared, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock
91SynchronizedOnGetClassSynchronization on getClass rather than class literal. This instance method synchronizes on this.getClass(). If this class is subclassed, subclasses will synchronize on the class object for the subclass, which isn't likely what was intended.
92SynchronizedOnReentrantLockSynchronizing on a ReentrantLock field is almost never the intended usage. A ReentrantLock should be obtained using the lock() method and released in a finally block using the unlock() method.
93SynchronizedOnStringSynchronization on a String field can lead to deadlock because Strings are interned by the JVM and can be shared.
94SynchronizedOnThisThis rule reports uses of the synchronized blocks where the synchronization reference is 'this'. Doing this effectively makes your synchronization policy public and modifiable by other objects. To avoid possibilities of deadlock, it is better to synchronize on internal objects.
95SynchronizedReadObjectMethodCatches Serializable classes that define a synchronized readObject method. By definition, an object created by deserialization is only reachable by one thread, and thus there is no need for readObject() to be synchronized. If the readObject() method itself is causing the object to become visible to another thread, that is an example of very dubious coding style.
96SystemRunFinalizersOnExitMethod calls to System.runFinalizersOnExit() should not be allowed. This method is inherently non-thread-safe, may result in data corruption, deadlock, and may effect parts of the program far removed from it's call point. It is deprecated, and it's use strongly discouraged.
97ThreadGroupAvoid using ThreadGroup; although it is intended to be used in a threaded environment it contains methods that are not thread safe.
98ThreadLocalNotStaticFinalThreadLocal fields should be static and final. In the most common case a java.lang.ThreadLocal instance associates state with a thread. A non-static non-final java.lang.ThreadLocal field associates state with an instance-thread combination. This is seldom necessary and often a bug which can cause memory leaks and possibly incorrect behavior.
99ThreadYieldMethod calls to Thread.yield() should not be allowed. This method has no useful guaranteed semantics, and is often used by inexperienced programmers to mask race conditions.
100ThrowExceptionFromFinallyBlockThrowing an exception from a finally block is confusing and can hide the original exception.
101UnnecessaryBigDecimalInstantiationIt is unnecessary to instantiate BigDecimal objects. Instead just use the decimal literal or the 'G' identifier to force the type, such as 123.45 or 123.45G.
102UnnecessaryBigIntegerInstantiationIt is unnecessary to instantiate BigInteger objects. Instead just use the literal with the 'G' identifier to force the type, such as 8G or 42G.
103UnnecessaryBooleanExpressionChecks for unnecessary boolean expressions, including ANDing (&&) or ORing (||) with true, false, null, or a Map/List/String/Number literal. Also checks for negation (!) of true, false, null, or a Map/List/String/Number literal.
104UnnecessaryBooleanInstantiationUse 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).
105UnnecessaryCallForLastElementThis rule checks for excessively verbose methods of accessing the last element of an array or list. For instance, it is possible to access the last element of an array by performing array[array.length - 1], in Groovy it is simpler to either call array.last() or array[-1]. The same is true for lists. This violation is triggered whenever a get, getAt, or array-style access is used with an object size check.
106UnnecessaryCallToSubstringCalling String.substring(0) always returns the original string. This code is meaningless.
107UnnecessaryCatchBlockViolations are triggered when a catch block does nothing but throw the original exception. In this scenario there is usually no need for a catch block, just let the exception be thrown from the original code. This condition frequently occurs when catching an exception for debugging purposes but then forgetting to take the catch statement out.
108UnnecessaryCollectCallSome method calls to Object.collect(Closure) can be replaced with the spread operator. For instance, list.collect { it.multiply(2) } can be replaced by list*.multiply(2).
109UnnecessaryCollectionCallUseless call to collections. This call doesn't make sense. For any collection c, calling c.containsAll(c) should always be true, and c.retainAll(c) should have no effect.
110UnnecessaryConstructorThis rule detects when a constructor is not necessary; i.e., when there's only one constructor, it's public, has an empty body, and takes no arguments.
111UnnecessaryDefInMethodDeclarationIf a method has a visibility modifier, then the def keyword is unneeded. For instance 'def private method() {}' is redundant and can be simplified to 'private method() {}'.
112UnnecessaryDoubleInstantiationIt is unnecessary to instantiate Double objects. Instead just use the double literal or the 'D' identifier to force the type, such as 123.45d or 0.42d.
113UnnecessaryFailIn a unit test, catching an exception and immediately calling Assert.fail() is pointless and hides the stack trace. It is better to rethrow the exception or not catch the exception at all.
114UnnecessaryFloatInstantiationIt is unnecessary to instantiate Float objects. Instead just use the float literal with the 'F' identifier to force the type, such as 123.45F or 0.42f.
115UnnecessaryGetterChecks for explicit calls to getter/accessor methods which can, for the most part, be replaced by property access. A getter is defined as a method call that matches get[A-Z] but not getClass() or get[A-Z][A-Z] such as getURL(). Getters do not take method arguments.
116UnnecessaryGroovyImportA Groovy file does not need to include an import for classes from java.lang, java.util, java.io, java.net, groovy.lang and groovy.util, as well as the classes java.math.BigDecimal and java.math.BigInteger.
117UnnecessaryIfStatementChecks for if statements where the if and else blocks are merely returning true and false constants. These cases can be replaced by a simple return statement.
118UnnecessaryInstantiationToGetClassAvoid instantiating an object just to call getClass() on it; use the .class public member instead.
119UnnecessaryIntegerInstantiationIt is unnecessary to instantiate Integer objects. Instead just use the literal with the 'I' identifier to force the type, such as 8I or 42i.
120UnnecessaryLongInstantiationIt is unnecessary to instantiate Long objects. Instead just use the literal with the 'L' identifier to force the type, such as 8L or 42L.
121UnnecessaryModOneAny expression mod 1 (exp % 1) is guaranteed to always return zero. This code is probably an error, and should be either (exp & 1) or (exp % 2).
122UnnecessaryNullCheckGroovy contains the safe dereference operator, which can be used in boolean conditional statements to safely replace explicit "x == null" tests.
123UnnecessaryNullCheckBeforeInstanceOfThere is no need to check for null before an instanceof; the instanceof keyword returns false when given a null argument.
124UnnecessaryObjectReferencesViolations are triggered when an excessive set of consecutive statements all reference the same variable. This can be made more readable by using a with or identity block.
125UnnecessaryOverridingMethodThe overriding method merely calls the same method defined in a superclass
126UnnecessarySelfAssignmentMethod contains a pointless self-assignment to a variable or property.
127UnnecessaryStringInstantiationUse a String literal (e.g., "...") instead of calling the corresponding String constructor (new String("..")) directly.
128UnnecessaryTernaryExpressionChecks for ternary expressions where the conditional expression always evaluates to a boolean and the true and false expressions are merely returning true and false constants. Also checks for ternary expressions where both expressions are the same constant or variable.
129UnnecessaryTransientModifierThe field is marked as transient, but the class isn't Serializable, so marking it as transient has no effect.
130UnusedArrayChecks for array allocations that are not assigned or used, unless it is the last statement within a block.
131UnusedImportImports for a class that is never referenced within the source file is unnecessary.
132UnusedObjectChecks for object allocations that are not assigned or used, unless it is the last statement within a block
133UnusedPrivateFieldChecks for private fields that are not referenced within the same class.
134UnusedPrivateMethodChecks for private methods that are not referenced within the same class.
135UnusedPrivateMethodParameterChecks for parameters to private methods that are not referenced within the method body.
136UnusedVariableChecks for variables that are never referenced.
137UseAssertEqualsInsteadOfAssertTrueThis rule detects JUnit assertions in object equality. These assertions should be made by more specific methods, like assertEquals.
138UseAssertFalseInsteadOfNegationIn unit tests, if a condition is expected to be false then there is no sense using assertTrue with the negation operator. For instance, assertTrue(!condition) can always be simplified to assertFalse(condition)
139UseAssertNullInsteadOfAssertEqualsThis rule detects JUnit calling assertEquals where the first or second parameter is null. These assertion should be made against the assertNull method instead.
140UseAssertSameInsteadOfAssertTrueThis rule detects JUnit calling assertTrue where the first or second parameter is an Object#is() call testing for reference equality. These assertion should be made against the assertSame method instead.
141UseAssertTrueInsteadOfAssertEqualsThis rule detects JUnit calling assertEquals where the first parameter is a boolean. These assertions should be made by more specific methods, like assertTrue or assertFalse.
142UseAssertTrueInsteadOfNegationIn unit tests, if a condition is expected to be true then there is no sense using assertFalse with the negation operator. For instance, assertFalse(!condition) can always be simplified to assertTrue(condition)
143UseOfNotifyMethodThis code calls notify() rather than notifyAll(). Java monitors are often used for multiple conditions. Calling notify() only wakes up one thread, meaning that the thread woken up might not be the one waiting for the condition that the caller just satisfied.
144VolatileArrayFieldVolatile array fields are unsafe because the contents of the array are not treated as volatile. Changing the entire array reference is visible to other threads, but changing an array element is not.
145VolatileLongOrDoubleFieldLong or double fields should not be declared as volatile. Java specifies that reads and writes from such fields are atomic, but many JVM's have violated this specification. Unless you are certain of your JVM, it is better to synchronize access to such fields rather than declare them volatile. This rule flags fields marked volatile when their type is double or long or the name of their type is "Double" or "Long".
146WaitOutsideOfWhileLoopCalls to Object.wait() must be within a while loop. Consider using the Java concurrency utilities instead of wait() and notify().