CodeNarc Report

Report title:
Date:Sep 15, 2020, 3:28:26 AM
Generated with:CodeNarc v1.6

Summary

PackageTotal FilesFiles with ViolationsPriority 1Priority 2Priority 3
All Packages3232-1721196
tech/muyan77-2777
tech/muyan/config11-215
tech/muyan/customise11-57
tech/muyan/dynamic/field33-2251
tech/muyan/dynamic/form11-418
tech/muyan/helper77-32278
tech/muyan/importexport22-22285
tech/muyan/importexport/converter22-8150
tech/muyan/security88-50315

Package: tech.muyan

➥ ActionMetaControllerTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]class ActionMetaControllerTest extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName213

[SRC]def "test checkAuthority"() {

[MSG]Violation in class ActionMetaControllerTest. The method name test checkAuthority in class tech.muyan.ActionMetaControllerTest does not match [a-z]\w*

MethodName250

[SRC]def "test buildErrorMsg"() {

[MSG]Violation in class ActionMetaControllerTest. The method name test buildErrorMsg in class tech.muyan.ActionMetaControllerTest does not match [a-z]\w*

MethodReturnTypeRequired313

[SRC]def "test checkAuthority"() {

[MSG]Method "test checkAuthority" has a dynamic return type

UnnecessaryDotClass316

[SRC]Authentication auth = Mock(Authentication.class)

[MSG]Authentication.class can be rewritten as Authentication

UnnecessaryDotClass320

[SRC]GrantedAuthority authority = Mock(GrantedAuthority.class)

[MSG]GrantedAuthority.class can be rewritten as GrantedAuthority

ImplicitClosureParameter321

[SRC]authority.authority >> it

[MSG]By convention closure parameters should be specified explicitly.

UnnecessaryBooleanExpression336

[SRC]'' | ['user'] || false

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression337

[SRC]'' | [''] || false

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression338

[SRC]'biz_user' | ['user', 'admin'] || false

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression339

[SRC]'biz_user' | ['biz_user'] || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression340

[SRC]'biz_user' | ['biz_user', 'admin'] || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression341

[SRC]'biz_user' | ['developer', 'biz_user', 'admin'] || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression342

[SRC]'biz_user' | ['developer', 'biz_user'] || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression343

[SRC]'biz_user,user' | ['biz_user'] || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression344

[SRC]'biz_user,user' | ['biz_user', 'admin'] || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression345

[SRC]'biz_user,user' | ['developer', 'biz_user', 'admin'] || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression346

[SRC]'biz_user,user' | ['developer', 'biz_user'] || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression347

[SRC]'user,biz_user' | ['user', 'admin'] || true

[MSG]The expression using || is compared to a constant

MethodReturnTypeRequired350

[SRC]def "test buildErrorMsg"() {

[MSG]Method "test buildErrorMsg" has a dynamic return type

VariableTypeRequired353

[SRC]def r = ActionMetaController.buildErrorMsg(

[MSG]The type is not specified for variable "r"

UnnecessaryGString370

[SRC]assert (r['createErrorMsg'] as String).replace(" ", "") ..ace(" ", "")

[MSG]The String ' ' can be wrapped in single quotes instead of double quotes

UnnecessaryGString370

[SRC]assert (r['createErrorMsg'] as String).replace(" ", "") ..ace(" ", "")

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString370

[SRC]assert (r['createErrorMsg'] as String).replace(" ", "") ..ace(" ", "")

[MSG]The String ' ' can be wrapped in single quotes instead of double quotes

UnnecessaryGString370

[SRC]assert (r['createErrorMsg'] as String).replace(" ", "") ..ace(" ", "")

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString375

[SRC]"user" | "create" | "GET" | "/domainObject" | new .. | "me"

[MSG]The String 'user' can be wrapped in single quotes instead of double quotes

UnnecessaryGString375

[SRC]"user" | "create" | "GET" | "/domainObject" | new .. | "me"

[MSG]The String 'create' can be wrapped in single quotes instead of double quotes

UnnecessaryGString375

[SRC]"user" | "create" | "GET" | "/domainObject" | new .. | "me"

[MSG]The String 'GET' can be wrapped in single quotes instead of double quotes

UnnecessaryGString375

[SRC]"user" | "create" | "GET" | "/domainObject" | new .. | "me"

[MSG]The String '/domainObject' can be wrapped in single quotes instead of double quotes

UnnecessaryGString375

[SRC]"user" | "create" | "GET" | "/domainObject" | new .. | "me"

[MSG]The String 'me' can be wrapped in single quotes instead of double quotes

➥ ContractLineSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic26

[SRC]class ContractLineSpec extends Specification implements ..tractLine> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName28

[SRC]void "test contract line should belongs to a contract"() {

[MSG]Violation in class ContractLineSpec. The method name test contract line should belongs to a contract in class tech.muyan.ContractLineSpec does not match [a-z]\w*

NoDef310

[SRC]def cl = new ContractLine(

[MSG]def for declaration should not be used

VariableTypeRequired310

[SRC]def cl = new ContractLine(

[MSG]The type is not specified for variable "cl"

➥ ContractLineTypeSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic28

[SRC]class ContractLineTypeSpec extends Specification impleme..tLineType> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod217

[SRC]def cleanup() {

[MSG]Violation in class ContractLineTypeSpec. The method cleanup is both empty and not marked with @Override

MethodName220

[SRC]void "test contract line type can be saved"() {

[MSG]Violation in class ContractLineTypeSpec. The method name test contract line type can be saved in class tech.muyan.ContractLineTypeSpec does not match [a-z]\w*

MethodName234

[SRC]void "contract line type name should be unique"() {

[MSG]Violation in class ContractLineTypeSpec. The method name contract line type name should be unique in class tech.muyan.ContractLineTypeSpec does not match [a-z]\w*

MethodName266

[SRC]void "test contract line type name should not be null"() {

[MSG]Violation in class ContractLineTypeSpec. The method name test contract line type name should not be null in class tech.muyan.ContractLineTypeSpec does not match [a-z]\w*

MethodReturnTypeRequired313

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef313

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired317

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef317

[SRC]def cleanup() {

[MSG]def for method return type should not be used

NoDef322

[SRC]def clt = new ContractLineType(name: "price_line", label..Price Line")

[MSG]def for declaration should not be used

VariableTypeRequired322

[SRC]def clt = new ContractLineType(name: "price_line", label..Price Line")

[MSG]The type is not specified for variable "clt"

UnnecessaryGString322

[SRC]def clt = new ContractLineType(name: "price_line", label..Price Line")

[MSG]The String 'price_line' can be wrapped in single quotes instead of double quotes

UnnecessaryGString322

[SRC]def clt = new ContractLineType(name: "price_line", label..Price Line")

[MSG]The String 'Price Line' can be wrapped in single quotes instead of double quotes

NoDef336

[SRC]def c1 = new ContractLineType(name: "c1", label: "title1")

[MSG]def for declaration should not be used

VariableTypeRequired336

[SRC]def c1 = new ContractLineType(name: "c1", label: "title1")

[MSG]The type is not specified for variable "c1"

UnnecessaryGString336

[SRC]def c1 = new ContractLineType(name: "c1", label: "title1")

[MSG]The String 'c1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString336

[SRC]def c1 = new ContractLineType(name: "c1", label: "title1")

[MSG]The String 'title1' can be wrapped in single quotes instead of double quotes

NoDef348

[SRC]def c2 = new ContractLineType(name: 'c1', label: "title2")

[MSG]def for declaration should not be used

VariableTypeRequired348

[SRC]def c2 = new ContractLineType(name: 'c1', label: "title2")

[MSG]The type is not specified for variable "c2"

UnnecessaryGString348

[SRC]def c2 = new ContractLineType(name: 'c1', label: "title2")

[MSG]The String 'title2' can be wrapped in single quotes instead of double quotes

➥ ContractSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic211

[SRC]class ContractSpec extends Specification implements Doma..<Contract> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod220

[SRC]def cleanup() {

[MSG]Violation in class ContractSpec. The method cleanup is both empty and not marked with @Override

MethodName223

[SRC]void "test domain name should not be blank"() {

[MSG]Violation in class ContractSpec. The method name test domain name should not be blank in class tech.muyan.ContractSpec does not match [a-z]\w*

MethodName232

[SRC]void "test domain name should not be null"() {

[MSG]Violation in class ContractSpec. The method name test domain name should not be null in class tech.muyan.ContractSpec does not match [a-z]\w*

MethodName242

[SRC]void "name should be unique"() {

[MSG]Violation in class ContractSpec. The method name name should be unique in class tech.muyan.ContractSpec does not match [a-z]\w*

MethodName274

[SRC]void "test owner organization should not be null"() {

[MSG]Violation in class ContractSpec. The method name test owner organization should not be null in class tech.muyan.ContractSpec does not match [a-z]\w*

UnusedImport35

[SRC]import spock.lang.Unroll

[MSG]The [spock.lang.Unroll] import is never referenced

UnusedImport37

[SRC]import spock.lang.Ignore

[MSG]The [spock.lang.Ignore] import is never referenced

MethodReturnTypeRequired316

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef316

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired320

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef320

[SRC]def cleanup() {

[MSG]def for method return type should not be used

UnnecessaryGString325

[SRC]domain.name = ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NoDef344

[SRC]def c1 = new Contract(name: "c1", title: "title1", reivi..tatus.DRAFT)

[MSG]def for declaration should not be used

VariableTypeRequired344

[SRC]def c1 = new Contract(name: "c1", title: "title1", reivi..tatus.DRAFT)

[MSG]The type is not specified for variable "c1"

UnnecessaryGString344

[SRC]def c1 = new Contract(name: "c1", title: "title1", reivi..tatus.DRAFT)

[MSG]The String 'c1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString344

[SRC]def c1 = new Contract(name: "c1", title: "title1", reivi..tatus.DRAFT)

[MSG]The String 'title1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString344

[SRC]def c1 = new Contract(name: "c1", title: "title1", reivi..tatus.DRAFT)

[MSG]The String 'org1' can be wrapped in single quotes instead of double quotes

NoDef356

[SRC]def c2 = new Contract(name: 'c1', title: "title2", revis..tatus.DRAFT)

[MSG]def for declaration should not be used

VariableTypeRequired356

[SRC]def c2 = new Contract(name: 'c1', title: "title2", revis..tatus.DRAFT)

[MSG]The type is not specified for variable "c2"

UnnecessaryGString356

[SRC]def c2 = new Contract(name: 'c1', title: "title2", revis..tatus.DRAFT)

[MSG]The String 'title2' can be wrapped in single quotes instead of double quotes

➥ DomainClassSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic27

[SRC]class DomainClassSpec extends Specification implements D..mainClass> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod216

[SRC]def cleanup() {

[MSG]Violation in class DomainClassSpec. The method cleanup is both empty and not marked with @Override

MethodName219

[SRC]void "test fullName should not be null"() {

[MSG]Violation in class DomainClassSpec. The method name test fullName should not be null in class tech.muyan.DomainClassSpec does not match [a-z]\w*

MethodName230

[SRC]void "test shortName should not be null"() {

[MSG]Violation in class DomainClassSpec. The method name test shortName should not be null in class tech.muyan.DomainClassSpec does not match [a-z]\w*

MethodName241

[SRC]void "test label should not be null"() {

[MSG]Violation in class DomainClassSpec. The method name test label should not be null in class tech.muyan.DomainClassSpec does not match [a-z]\w*

MethodReturnTypeRequired312

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef312

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired316

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef316

[SRC]def cleanup() {

[MSG]def for method return type should not be used

UnnecessaryGString323

[SRC]then: "fullName property is not valid"

[MSG]The String 'fullName property is not valid' can be wrapped in single quotes instead of double quotes

UnnecessaryGString326

[SRC]and: "valid error is nullable"

[MSG]The String 'valid error is nullable' can be wrapped in single quotes instead of double quotes

UnnecessaryGString334

[SRC]then: "shortName property is not valid"

[MSG]The String 'shortName property is not valid' can be wrapped in single quotes instead of double quotes

UnnecessaryGString337

[SRC]and: "valid error is nullable"

[MSG]The String 'valid error is nullable' can be wrapped in single quotes instead of double quotes

UnnecessaryGString345

[SRC]then: "label property is not valid"

[MSG]The String 'label property is not valid' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]and: "valid error is nullable"

[MSG]The String 'valid error is nullable' can be wrapped in single quotes instead of double quotes

➥ OrganizationSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]class OrganizationSpec extends Specification implements ..anization> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName221

[SRC]void "test name can not be blank"() {

[MSG]Violation in class OrganizationSpec. The method name test name can not be blank in class tech.muyan.OrganizationSpec does not match [a-z]\w*

MethodName230

[SRC]void "test name can not be null"() {

[MSG]Violation in class OrganizationSpec. The method name test name can not be null in class tech.muyan.OrganizationSpec does not match [a-z]\w*

MethodName239

[SRC]void "test parent organization can be empty"() {

[MSG]Violation in class OrganizationSpec. The method name test parent organization can be empty in class tech.muyan.OrganizationSpec does not match [a-z]\w*

MethodName247

[SRC]void "test name should be unique"() {

[MSG]Violation in class OrganizationSpec. The method name test name should be unique in class tech.muyan.OrganizationSpec does not match [a-z]\w*

MethodReturnTypeRequired317

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef317

[SRC]def setup() {

[MSG]def for method return type should not be used

UnnecessaryGString323

[SRC]domain.name = ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NoDef349

[SRC]def org1 = new Organization(name: "org1")

[MSG]def for declaration should not be used

VariableTypeRequired349

[SRC]def org1 = new Organization(name: "org1")

[MSG]The type is not specified for variable "org1"

UnnecessaryGString349

[SRC]def org1 = new Organization(name: "org1")

[MSG]The String 'org1' can be wrapped in single quotes instead of double quotes

NoDef361

[SRC]def org2 = new Organization(name: 'org1')

[MSG]def for declaration should not be used

VariableTypeRequired361

[SRC]def org2 = new Organization(name: 'org1')

[MSG]The type is not specified for variable "org2"

➥ WithProperty.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic27

[SRC]class WithProperty extends WithDynamicFields {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

Package: tech.muyan.config

➥ DynamicFieldTypeToComponentMappingTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic220

[SRC]class DynamicFieldTypeToComponentMappingTest extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName221

[SRC]def "test DynamicFieldTypeToComponentMappingTest initMapping"() {

[MSG]Violation in class DynamicFieldTypeToComponentMappingTest. The method name test DynamicFieldTypeToComponentMappingTest initMapping in class tech.muyan.config.DynamicFieldTypeToComponentMappingTest does not match [a-z]\w*

MisorderedStaticImports37

[SRC]import static tech.muyan.enums.DisplayComponentType.ABSTRACT_DATE

[MSG]Static imports should appear before normal imports

MisorderedStaticImports38

[SRC]import static tech.muyan.enums.DisplayComponentType.FLOA..ION_OR_INPUT

[MSG]Static imports should appear before normal imports

MisorderedStaticImports39

[SRC]import static tech.muyan.enums.DisplayComponentType.INTE..LE_SELECTION

[MSG]Static imports should appear before normal imports

MisorderedStaticImports310

[SRC]import static tech.muyan.enums.DisplayComponentType.MULT.._FILE_UPLOAD

[MSG]Static imports should appear before normal imports

MisorderedStaticImports311

[SRC]import static tech.muyan.enums.DisplayComponentType.OBJE..LE_SELECTION

[MSG]Static imports should appear before normal imports

MisorderedStaticImports312

[SRC]import static tech.muyan.enums.DisplayComponentType.RELATIVE_DATE_TIME

[MSG]Static imports should appear before normal imports

MisorderedStaticImports313

[SRC]import static tech.muyan.enums.DisplayComponentType.SING..IMAGE_UPLOAD

[MSG]Static imports should appear before normal imports

MisorderedStaticImports314

[SRC]import static tech.muyan.enums.DisplayComponentType.TEXT_AREA

[MSG]Static imports should appear before normal imports

MethodReturnTypeRequired321

[SRC]def "test DynamicFieldTypeToComponentMappingTest initMapping"() {

[MSG]Method "test DynamicFieldTypeToComponentMappingTest initMapping" has a dynamic return type

VariableTypeRequired324

[SRC]def mapping = DynamicFieldTypeToComponentMapping.FieldTy..onentMapping

[MSG]The type is not specified for variable "mapping"

VariableTypeRequired330

[SRC]def elements = mapping.get(fieldType)

[MSG]The type is not specified for variable "elements"

UnnecessaryObjectReferences344

[SRC]DynamicFieldDataType.STRING || 8 | TEXT_AREA

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

UnnecessaryObjectReferences345

[SRC]DynamicFieldDataType.OBJECT || 2 | OBJECT_MULTIPLE_SELECTION

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

UnnecessaryObjectReferences346

[SRC]DynamicFieldDataType.IMAGE || 2 | SINGLE_IMAGE_UPLOAD

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

UnnecessaryObjectReferences347

[SRC]DynamicFieldDataType.FILE || 2 | MULTIPLE_FILE_UPLOAD

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

Package: tech.muyan.customise

➥ EngineTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic29

[SRC]class EngineTest extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName210

[SRC]void "test customise engine"() {

[MSG]Violation in class EngineTest. The method name test customise engine in class tech.muyan.customise.EngineTest does not match [a-z]\w*

UnnecessaryCast222

[SRC][:] as Map<String, Object> | "println('hello')" || null

[MSG]The cast (Map <String, Object>) [:] in class tech.muyan.customise.EngineTest is unnecessary

UnnecessaryCast223

[SRC][:] as Map<String, Object> | '["r": "hello"]'..r': 'hello']

[MSG]The cast (Map <String, Object>) [:] in class tech.muyan.customise.EngineTest is unnecessary

UnnecessaryCast224

[SRC]["r": "hello"] as Map<String, Object> | '["r": r]' ..r': 'hello']

[MSG]The cast (Map <String, Object>) [r:hello] in class tech.muyan.customise.EngineTest is unnecessary

NoDef314

[SRC]def result = Engine.run(parameters, code, this.class.classLoader)

[MSG]def for declaration should not be used

VariableTypeRequired314

[SRC]def result = Engine.run(parameters, code, this.class.classLoader)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression322

[SRC][:] as Map<String, Object> | "println('hello')" || null

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression323

[SRC][:] as Map<String, Object> | '["r": "hello"]'..r': 'hello']

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression324

[SRC]["r": "hello"] as Map<String, Object> | '["r": r]' ..r': 'hello']

[MSG]The expression using || is compared to a constant

UnnecessaryGString324

[SRC]["r": "hello"] as Map<String, Object> | '["r": r]' ..r': 'hello']

[MSG]The String 'r' can be wrapped in single quotes instead of double quotes

UnnecessaryGString324

[SRC]["r": "hello"] as Map<String, Object> | '["r": r]' ..r': 'hello']

[MSG]The String 'hello' can be wrapped in single quotes instead of double quotes

Package: tech.muyan.dynamic.field

➥ DynamicFieldDefinitionSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic214

[SRC]class DynamicFieldDefinitionSpec extends Specification i..efinition> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod223

[SRC]def cleanup() {

[MSG]Violation in class DynamicFieldDefinitionSpec. The method cleanup is both empty and not marked with @Override

MethodName226

[SRC]void "test field should not be null"() {

[MSG]Violation in class DynamicFieldDefinitionSpec. The method name test field should not be null in class tech.muyan.dynamic.field.DynamicFieldDefinitionSpec does not match [a-z]\w*

MethodName240

[SRC]void "test field can be blank or null"() {

[MSG]Violation in class DynamicFieldDefinitionSpec. The method name test field can be blank or null in class tech.muyan.dynamic.field.DynamicFieldDefinitionSpec does not match [a-z]\w*

MethodName255

[SRC]void "test render"() {

[MSG]Violation in class DynamicFieldDefinitionSpec. The method name test render in class tech.muyan.dynamic.field.DynamicFieldDefinitionSpec does not match [a-z]\w*

ImportFromSamePackage36

[SRC]import tech.muyan.dynamic.field.DynamicFieldDefinition

MisorderedStaticImports38

[SRC]import static tech.muyan.enums.DynamicFieldDataType.*

[MSG]Static imports should appear before normal imports

NoWildcardImports38

[SRC]import static tech.muyan.enums.DynamicFieldDataType.*

[MSG]Wildcard (star) import

MethodReturnTypeRequired319

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef319

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired323

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef323

[SRC]def cleanup() {

[MSG]def for method return type should not be used

UnnecessaryGString336

[SRC]"fieldType" | null | 'nullable'

[MSG]The String 'fieldType' can be wrapped in single quotes instead of double quotes

UnnecessaryGString337

[SRC]"label" | '' | 'blank'

[MSG]The String 'label' can be wrapped in single quotes instead of double quotes

UnnecessaryGString349

[SRC]"optionsJson" | ''

[MSG]The String 'optionsJson' can be wrapped in single quotes instead of double quotes

UnnecessaryGString350

[SRC]"optionsJson" | null

[MSG]The String 'optionsJson' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]"referenceClazz" | ''

[MSG]The String 'referenceClazz' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]"referenceClazz" | null

[MSG]The String 'referenceClazz' can be wrapped in single quotes instead of double quotes

UnnecessaryGString357

[SRC]domain.label = "Label"

[MSG]The String 'Label' can be wrapped in single quotes instead of double quotes

UnnecessaryGString361

[SRC]domain.name = "myName"

[MSG]The String 'myName' can be wrapped in single quotes instead of double quotes

NoDef362

[SRC]def renderResult = domain.render()

[MSG]def for declaration should not be used

VariableTypeRequired362

[SRC]def renderResult = domain.render()

[MSG]The type is not specified for variable "renderResult"

UnnecessaryGString365

[SRC]renderResult.label == "Label"

[MSG]The String 'Label' can be wrapped in single quotes instead of double quotes

UnnecessaryGString366

[SRC]renderResult.fieldType == "STRING"

[MSG]The String 'STRING' can be wrapped in single quotes instead of double quotes

➥ DynamicFieldValueSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic211

[SRC]class DynamicFieldValueSpec extends Specification implem..ieldValue> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod220

[SRC]def cleanup() {

[MSG]Violation in class DynamicFieldValueSpec. The method cleanup is both empty and not marked with @Override

MethodName223

[SRC]void "test field can be blank or null"() {

[MSG]Violation in class DynamicFieldValueSpec. The method name test field can be blank or null in class tech.muyan.dynamic.field.DynamicFieldValueSpec does not match [a-z]\w*

MethodName241

[SRC]void "test field can not be updated"() {

[MSG]Violation in class DynamicFieldValueSpec. The method name test field can not be updated in class tech.muyan.dynamic.field.DynamicFieldValueSpec does not match [a-z]\w*

MethodName254

[SRC]void "test objectDynamicField can not be null"() {

[MSG]Violation in class DynamicFieldValueSpec. The method name test objectDynamicField can not be null in class tech.muyan.dynamic.field.DynamicFieldValueSpec does not match [a-z]\w*

MethodReturnTypeRequired316

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef316

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired320

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef320

[SRC]def cleanup() {

[MSG]def for method return type should not be used

UnnecessaryGString332

[SRC]"stringValue" | ""

[MSG]The String 'stringValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString332

[SRC]"stringValue" | ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString333

[SRC]"objectId" | ""

[MSG]The String 'objectId' can be wrapped in single quotes instead of double quotes

UnnecessaryGString333

[SRC]"objectId" | ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString334

[SRC]"stringValue" | null

[MSG]The String 'stringValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString335

[SRC]"objectId" | null

[MSG]The String 'objectId' can be wrapped in single quotes instead of double quotes

UnnecessaryGString336

[SRC]"dateValue" | null

[MSG]The String 'dateValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString337

[SRC]"numericValue" | null

[MSG]The String 'numericValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString338

[SRC]"storage" | null

[MSG]The String 'storage' can be wrapped in single quotes instead of double quotes

UnnecessaryGString350

[SRC]"fieldType" | null

[MSG]The String 'fieldType' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]"ownerClazz" | null

[MSG]The String 'ownerClazz' can be wrapped in single quotes instead of double quotes

➥ ObjectDynamicFieldSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class ObjectDynamicFieldSpec extends Specification imple..amicField> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod219

[SRC]def cleanup() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method cleanup is both empty and not marked with @Override

MethodName222

[SRC]void "test objectReferenceType can be null"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test objectReferenceType can be null in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

MethodName230

[SRC]void "test meta can be blank"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test meta can be blank in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

MethodName238

[SRC]void "test meta can be null"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test meta can be null in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

MethodName246

[SRC]void "test validation can be blank"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test validation can be blank in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

MethodName254

[SRC]void "test validation can be null"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test validation can be null in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

MethodName262

[SRC]void "test displayComponentType can not be null"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test displayComponentType can not be null in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

MethodName271

[SRC]void "test label can not be null"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test label can not be null in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

MethodName280

[SRC]void "test objectType can not be null"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test objectType can not be null in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

MethodName289

[SRC]void "test get field type dynamicField is not null"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test get field type dynamicField is not null in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

MethodName2101

[SRC]void "test get field type dynamicField is null"() {

[MSG]Violation in class ObjectDynamicFieldSpec. The method name test get field type dynamicField is null in class tech.muyan.dynamic.field.ObjectDynamicFieldSpec does not match [a-z]\w*

ImportFromSamePackage36

[SRC]import tech.muyan.dynamic.field.ObjectDynamicField

MisorderedStaticImports38

[SRC]import static tech.muyan.enums.DynamicFieldDataType.*

[MSG]Static imports should appear before normal imports

NoWildcardImports38

[SRC]import static tech.muyan.enums.DynamicFieldDataType.*

[MSG]Wildcard (star) import

MethodReturnTypeRequired315

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef315

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired319

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef319

[SRC]def cleanup() {

[MSG]def for method return type should not be used

UnnecessaryGString332

[SRC]domain.meta = ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]domain.validation = ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NoDef391

[SRC]def definition = new DynamicFieldDefinition()

[MSG]def for declaration should not be used

VariableTypeRequired391

[SRC]def definition = new DynamicFieldDefinition()

[MSG]The type is not specified for variable "definition"

NoDef394

[SRC]def result = domain.getFieldType()

[MSG]def for declaration should not be used

VariableTypeRequired394

[SRC]def result = domain.getFieldType()

[MSG]The type is not specified for variable "result"

UnnecessaryGetter394

[SRC]def result = domain.getFieldType()

[MSG]getFieldType() can probably be rewritten as fieldType

NoDef3104

[SRC]def result = domain.getFieldType()

[MSG]def for declaration should not be used

VariableTypeRequired3104

[SRC]def result = domain.getFieldType()

[MSG]The type is not specified for variable "result"

UnnecessaryGetter3104

[SRC]def result = domain.getFieldType()

[MSG]getFieldType() can probably be rewritten as fieldType

Package: tech.muyan.dynamic.form

➥ DynamicMenuSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]class DynamicMenuSpec extends Specification implements D..namicMenu> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod214

[SRC]def setup() {

[MSG]Violation in class DynamicMenuSpec. The method setup is both empty and not marked with @Override

EmptyMethod217

[SRC]def cleanup() {

[MSG]Violation in class DynamicMenuSpec. The method cleanup is both empty and not marked with @Override

MethodName220

[SRC]def "test render"() {

[MSG]Violation in class DynamicMenuSpec. The method name test render in class tech.muyan.dynamic.form.DynamicMenuSpec does not match [a-z]\w*

UnnecessarySemicolon31

[SRC]package tech.muyan.dynamic.form;

[MSG]Semicolons as line endings can be removed safely

MisorderedStaticImports39

[SRC]import static tech.muyan.enums.MenuType.*

[MSG]Static imports should appear before normal imports

NoWildcardImports39

[SRC]import static tech.muyan.enums.MenuType.*

[MSG]Wildcard (star) import

MethodReturnTypeRequired314

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef314

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired317

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef317

[SRC]def cleanup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired320

[SRC]def "test render"() {

[MSG]Method "test render" has a dynamic return type

VariableTypeRequired322

[SRC]def org = new Organization(name: "org1")

[MSG]The type is not specified for variable "org"

UnnecessaryGString322

[SRC]def org = new Organization(name: "org1")

[MSG]The String 'org1' can be wrapped in single quotes instead of double quotes

VariableTypeRequired323

[SRC]def pm = new DynamicMenu(

[MSG]The type is not specified for variable "pm"

UnnecessaryGString326

[SRC]label: "PM",

[MSG]The String 'PM' can be wrapped in single quotes instead of double quotes

VariableTypeRequired332

[SRC]def cm = new DynamicMenu(

[MSG]The type is not specified for variable "cm"

UnnecessaryGString335

[SRC]label: "CM",

[MSG]The String 'CM' can be wrapped in single quotes instead of double quotes

UnnecessaryGString338

[SRC]link: "http://google.com",

[MSG]The String 'http://google.com' can be wrapped in single quotes instead of double quotes

VariableTypeRequired341

[SRC]def result = cm.render()

[MSG]The type is not specified for variable "result"

UnnecessaryGString345

[SRC]result.label == "CM"

[MSG]The String 'CM' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]result.link == "http://google.com"

[MSG]The String 'http://google.com' can be wrapped in single quotes instead of double quotes

Package: tech.muyan.helper

➥ ConvertHelperSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic29

[SRC]class ConvertHelperSpec extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod211

[SRC]def setup() {

[MSG]Violation in class ConvertHelperSpec. The method setup is both empty and not marked with @Override

EmptyMethod214

[SRC]def cleanup() {

[MSG]Violation in class ConvertHelperSpec. The method cleanup is both empty and not marked with @Override

MethodName217

[SRC]def "test Convert List"() {

[MSG]Violation in class ConvertHelperSpec. The method name test Convert List in class tech.muyan.helper.ConvertHelperSpec does not match [a-z]\w*

UnnecessarySemicolon31

[SRC]package tech.muyan.helper;

[MSG]Semicolons as line endings can be removed safely

ImportFromSamePackage35

[SRC]import tech.muyan.helper.ConverterHelper

MethodReturnTypeRequired311

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef311

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired314

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef314

[SRC]def cleanup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired317

[SRC]def "test Convert List"() {

[MSG]Method "test Convert List" has a dynamic return type

VariableTypeRequired320

[SRC]def converter = ConverterFactory.getConverter(type)

[MSG]The type is not specified for variable "converter"

VariableTypeRequired321

[SRC]def result = ConverterHelper.convertList(converter, type..Key", input)

[MSG]The type is not specified for variable "result"

UnnecessaryGString321

[SRC]def result = ConverterHelper.convertList(converter, type..Key", input)

[MSG]The String 'columnKey' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression328

[SRC]"string" | ["a", "b", "c"] || ["a", "b", "c"]

[MSG]The expression using || is compared to a constant

UnnecessaryGString328

[SRC]"string" | ["a", "b", "c"] || ["a", "b", "c"]

[MSG]The String 'string' can be wrapped in single quotes instead of double quotes

UnnecessaryGString328

[SRC]"string" | ["a", "b", "c"] || ["a", "b", "c"]

[MSG]The String 'a' can be wrapped in single quotes instead of double quotes

UnnecessaryGString328

[SRC]"string" | ["a", "b", "c"] || ["a", "b", "c"]

[MSG]The String 'b' can be wrapped in single quotes instead of double quotes

UnnecessaryGString328

[SRC]"string" | ["a", "b", "c"] || ["a", "b", "c"]

[MSG]The String 'c' can be wrapped in single quotes instead of double quotes

UnnecessaryGString328

[SRC]"string" | ["a", "b", "c"] || ["a", "b", "c"]

[MSG]The String 'a' can be wrapped in single quotes instead of double quotes

UnnecessaryGString328

[SRC]"string" | ["a", "b", "c"] || ["a", "b", "c"]

[MSG]The String 'b' can be wrapped in single quotes instead of double quotes

UnnecessaryGString328

[SRC]"string" | ["a", "b", "c"] || ["a", "b", "c"]

[MSG]The String 'c' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression329

[SRC]"integer"| ["1", "2", "3"] || [1, 2, 3]

[MSG]The expression using || is compared to a constant

UnnecessaryGString329

[SRC]"integer"| ["1", "2", "3"] || [1, 2, 3]

[MSG]The String 'integer' can be wrapped in single quotes instead of double quotes

UnnecessaryGString329

[SRC]"integer"| ["1", "2", "3"] || [1, 2, 3]

[MSG]The String '1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString329

[SRC]"integer"| ["1", "2", "3"] || [1, 2, 3]

[MSG]The String '2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString329

[SRC]"integer"| ["1", "2", "3"] || [1, 2, 3]

[MSG]The String '3' can be wrapped in single quotes instead of double quotes

➥ DynamicFieldHelperSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic224

[SRC]class DynamicFieldHelperSpec extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName227

[SRC]def "save all to owner"() {

[MSG]Violation in class DynamicFieldHelperSpec. The method name save all to owner in class tech.muyan.helper.DynamicFieldHelperSpec does not match [a-z]\w*

MethodName258

[SRC]def "test build dynamic field with options"() {

[MSG]Violation in class DynamicFieldHelperSpec. The method name test build dynamic field with options in class tech.muyan.helper.DynamicFieldHelperSpec does not match [a-z]\w*

MethodName285

[SRC]def "test build dynamic field option not valid"() {

[MSG]Violation in class DynamicFieldHelperSpec. The method name test build dynamic field option not valid in class tech.muyan.helper.DynamicFieldHelperSpec does not match [a-z]\w*

MethodName2111

[SRC]def "test build"() {

[MSG]Violation in class DynamicFieldHelperSpec. The method name test build in class tech.muyan.helper.DynamicFieldHelperSpec does not match [a-z]\w*

MethodName2134

[SRC]def "test createDynamicFieldValue"() {

[MSG]Violation in class DynamicFieldHelperSpec. The method name test createDynamicFieldValue in class tech.muyan.helper.DynamicFieldHelperSpec does not match [a-z]\w*

MethodName2147

[SRC]def "test getDynamicFieldValuesOf"() {

[MSG]Violation in class DynamicFieldHelperSpec. The method name test getDynamicFieldValuesOf in class tech.muyan.helper.DynamicFieldHelperSpec does not match [a-z]\w*

MethodName2167

[SRC]def "test getDynamicFieldValueByType"() {

[MSG]Violation in class DynamicFieldHelperSpec. The method name test getDynamicFieldValueByType in class tech.muyan.helper.DynamicFieldHelperSpec does not match [a-z]\w*

MethodName2183

[SRC]def "test getDomainProperties"() {

[MSG]Violation in class DynamicFieldHelperSpec. The method name test getDomainProperties in class tech.muyan.helper.DynamicFieldHelperSpec does not match [a-z]\w*

MisorderedStaticImports316

[SRC]import static tech.muyan.enums.DisplayComponentType.STRI..LE_SELECTION

[MSG]Static imports should appear before normal imports

MisorderedStaticImports317

[SRC]import static tech.muyan.enums.DisplayComponentType.STRI..LE_SELECTION

[MSG]Static imports should appear before normal imports

MisorderedStaticImports318

[SRC]import static tech.muyan.enums.DynamicFieldDataType.*

[MSG]Static imports should appear before normal imports

NoWildcardImports318

[SRC]import static tech.muyan.enums.DynamicFieldDataType.*

[MSG]Wildcard (star) import

MethodReturnTypeRequired327

[SRC]def "save all to owner"() {

[MSG]Method "save all to owner" has a dynamic return type

UnnecessaryDotClass329

[SRC]GroovySpy(DynamicFieldValue.class, global: true)

[MSG]DynamicFieldValue.class can be rewritten as DynamicFieldValue

VariableTypeRequired330

[SRC]def dfv1 = new DynamicFieldValue()

[MSG]The type is not specified for variable "dfv1"

VariableTypeRequired331

[SRC]def dfv2 = new DynamicFieldValue()

[MSG]The type is not specified for variable "dfv2"

VariableTypeRequired332

[SRC]def dfv3 = new DynamicFieldValue()

[MSG]The type is not specified for variable "dfv3"

VariableTypeRequired333

[SRC]def dfv4 = new DynamicFieldValue()

[MSG]The type is not specified for variable "dfv4"

UnnecessaryDotClass334

[SRC]ObjectDynamicField odf = Mock(ObjectDynamicField.class)

[MSG]ObjectDynamicField.class can be rewritten as ObjectDynamicField

VariableTypeRequired335

[SRC]def values = List.of(

[MSG]The type is not specified for variable "values"

UnnecessaryGString336

[SRC]new DynamicFieldValue(jsonValue: "1", numericValue: 1, o..Field: odf),

[MSG]The String '1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString337

[SRC]new DynamicFieldValue(jsonValue: "abc", stringValue: "ab..Field: odf),

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString337

[SRC]new DynamicFieldValue(jsonValue: "abc", stringValue: "ab..Field: odf),

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString338

[SRC]new DynamicFieldValue(jsonValue: "true", booleanValue: t..Field: odf),

[MSG]The String 'true' can be wrapped in single quotes instead of double quotes

UnnecessaryGString339

[SRC]new DynamicFieldValue(jsonValue: "2020-09-01", dateValue..cField: odf)

[MSG]The String '2020-09-01' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]dfv1.jsonValue == "1"

[MSG]The String '1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString350

[SRC]dfv2.jsonValue == "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]dfv2.stringValue == "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]dfv3.jsonValue == "true"

[MSG]The String 'true' can be wrapped in single quotes instead of double quotes

UnnecessaryGString354

[SRC]dfv4.jsonValue == "2020-09-01"

[MSG]The String '2020-09-01' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired358

[SRC]def "test build dynamic field with options"() {

[MSG]Method "test build dynamic field with options" has a dynamic return type

UnnecessaryDotClass360

[SRC]ObjectDynamicField odf = Mock(ObjectDynamicField.class)

[MSG]ObjectDynamicField.class can be rewritten as ObjectDynamicField

VariableTypeRequired361

[SRC]def fieldDefinition = Mock(DynamicFieldDefinition)

[MSG]The type is not specified for variable "fieldDefinition"

UnnecessaryGString365

[SRC]fieldDefinition.label >> "dynamicField"

[MSG]The String 'dynamicField' can be wrapped in single quotes instead of double quotes

VariableTypeRequired368

[SRC]def dfv = DynamicFieldHelper.buildFromString(input, odf)

[MSG]The type is not specified for variable "dfv"

UnnecessaryBooleanExpression375

[SRC]STRING_SINGLE_SELECTION | '["Option1", "Option2"]' .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString375

[SRC]STRING_SINGLE_SELECTION | '["Option1", "Option2"]' .. || true

[MSG]The String 'Option1' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression376

[SRC]STRING_SINGLE_SELECTION | '["Option1", "Option2"]' .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString376

[SRC]STRING_SINGLE_SELECTION | '["Option1", "Option2"]' .. || true

[MSG]The String 'Option2' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression377

[SRC]STRING_SINGLE_SELECTION | '[1,2,3,4]' .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString377

[SRC]STRING_SINGLE_SELECTION | '[1,2,3,4]' .. || true

[MSG]The String '1' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression378

[SRC]STRING_MULTIPLE_SELECTION | '[1.0,2.0,305,405]' .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString378

[SRC]STRING_MULTIPLE_SELECTION | '[1.0,2.0,305,405]' .. || true

[MSG]The String '[305, 2.0]' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression379

[SRC]STRING_MULTIPLE_SELECTION | '["Option1", "Option2"]' .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression380

[SRC]STRING_MULTIPLE_SELECTION | '["Option1", "Option2"]' ..2"]' || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression381

[SRC]STRING_MULTIPLE_SELECTION | '["Option1", "Option2", "Opt..1"]' || true

[MSG]The expression using || is compared to a constant

MethodReturnTypeRequired385

[SRC]def "test build dynamic field option not valid"() {

[MSG]Method "test build dynamic field option not valid" has a dynamic return type

UnnecessaryDotClass387

[SRC]ObjectDynamicField odf = Mock(ObjectDynamicField.class)

[MSG]ObjectDynamicField.class can be rewritten as ObjectDynamicField

VariableTypeRequired388

[SRC]def fieldDefinition = Mock(DynamicFieldDefinition)

[MSG]The type is not specified for variable "fieldDefinition"

UnnecessaryGString392

[SRC]fieldDefinition.label >> "dynamicField"

[MSG]The String 'dynamicField' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3102

[SRC]STRING_SINGLE_SELECTION | '["Option1", "Option2"]' .. | "Option3"

[MSG]The String 'Option3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3103

[SRC]STRING_SINGLE_SELECTION | '[1,2,3,4]' | "5"

[MSG]The String '5' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3104

[SRC]STRING_MULTIPLE_SELECTION | '[1.0,2.0,305,405]' .."[305, 5.0]"

[MSG]The String '[305, 5.0]' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3111

[SRC]def "test build"() {

[MSG]Method "test build" has a dynamic return type

UnnecessaryDotClass3113

[SRC]ObjectDynamicField odf = Mock(ObjectDynamicField.class)

[MSG]ObjectDynamicField.class can be rewritten as ObjectDynamicField

VariableTypeRequired3114

[SRC]def fieldDefinition = Mock(DynamicFieldDefinition.class)

[MSG]The type is not specified for variable "fieldDefinition"

UnnecessaryDotClass3114

[SRC]def fieldDefinition = Mock(DynamicFieldDefinition.class)

[MSG]DynamicFieldDefinition.class can be rewritten as DynamicFieldDefinition

UnnecessaryGString3117

[SRC]fieldDefinition.label >> "dynamicField"

[MSG]The String 'dynamicField' can be wrapped in single quotes instead of double quotes

VariableTypeRequired3120

[SRC]def result = DynamicFieldHelper.build(odf, strValue, typedValue)

[MSG]The type is not specified for variable "result"

UnnecessaryGString3127

[SRC]BOOLEAN | "T" | true ..alue" | true

[MSG]The String 'T' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3127

[SRC]BOOLEAN | "T" | true ..alue" | true

[MSG]The String 'booleanValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3128

[SRC]DATE | "2020-09-01" | LocalDate.of(2020, 9,..atTime(0, 0)

[MSG]The String '2020-09-01' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3128

[SRC]DATE | "2020-09-01" | LocalDate.of(2020, 9,..atTime(0, 0)

[MSG]The String 'dateValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3129

[SRC]DATETIME | "2020-09-01 00:00:00" | LocalDate.of(2020, 9,..tTime(10, 0)

[MSG]The String '2020-09-01 00:00:00' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3129

[SRC]DATETIME | "2020-09-01 00:00:00" | LocalDate.of(2020, 9,..tTime(10, 0)

[MSG]The String 'dateValue' can be wrapped in single quotes instead of double quotes

UnnecessaryBigDecimalInstantiation3130

[SRC]DECIMAL | "100.5" | new BigDecimal("100.5..mal("100.5")

[MSG]Can be rewritten as 100.5 or 100.5G

UnnecessaryBigDecimalInstantiation3130

[SRC]DECIMAL | "100.5" | new BigDecimal("100.5..mal("100.5")

[MSG]Can be rewritten as 100.5 or 100.5G

UnnecessaryGString3130

[SRC]DECIMAL | "100.5" | new BigDecimal("100.5..mal("100.5")

[MSG]The String '100.5' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3130

[SRC]DECIMAL | "100.5" | new BigDecimal("100.5..mal("100.5")

[MSG]The String '100.5' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3130

[SRC]DECIMAL | "100.5" | new BigDecimal("100.5..mal("100.5")

[MSG]The String 'numericValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3130

[SRC]DECIMAL | "100.5" | new BigDecimal("100.5..mal("100.5")

[MSG]The String '100.5' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3131

[SRC]INTEGER | "25" | new BigDecimal("25") ..ecimal("25")

[MSG]The String '25' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3131

[SRC]INTEGER | "25" | new BigDecimal("25") ..ecimal("25")

[MSG]The String '25' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3131

[SRC]INTEGER | "25" | new BigDecimal("25") ..ecimal("25")

[MSG]The String 'numericValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3131

[SRC]INTEGER | "25" | new BigDecimal("25") ..ecimal("25")

[MSG]The String '25' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3134

[SRC]def "test createDynamicFieldValue"() {

[MSG]Method "test createDynamicFieldValue" has a dynamic return type

VariableTypeRequired3136

[SRC]def domainObject = [id: 1]

[MSG]The type is not specified for variable "domainObject"

VariableTypeRequired3137

[SRC]def odf = Mock(ObjectDynamicField.class)

[MSG]The type is not specified for variable "odf"

UnnecessaryDotClass3137

[SRC]def odf = Mock(ObjectDynamicField.class)

[MSG]ObjectDynamicField.class can be rewritten as ObjectDynamicField

VariableTypeRequired3140

[SRC]def result = DynamicFieldHelper.createDynamicFieldValue(..Object, odf)

[MSG]The type is not specified for variable "result"

MethodReturnTypeRequired3147

[SRC]def "test getDynamicFieldValuesOf"() {

[MSG]Method "test getDynamicFieldValuesOf" has a dynamic return type

UnnecessaryDotClass3149

[SRC]GroovySpy(DynamicFieldValue.class, global: true)

[MSG]DynamicFieldValue.class can be rewritten as DynamicFieldValue

VariableTypeRequired3150

[SRC]def mock = Mock(DynamicFieldValue.class)

[MSG]The type is not specified for variable "mock"

UnnecessaryDotClass3150

[SRC]def mock = Mock(DynamicFieldValue.class)

[MSG]DynamicFieldValue.class can be rewritten as DynamicFieldValue

UnnecessaryDotClass3151

[SRC]DetachedCriteria criteria = Mock(DetachedCriteria.class)

[MSG]DetachedCriteria.class can be rewritten as DetachedCriteria

UnnecessaryReturnKeyword3158

[SRC]return criteria

[MSG]The return keyword is not needed and can be removed

VariableTypeRequired3160

[SRC]def result = DynamicFieldHelper.getDynamicFieldValuesOf(null)

[MSG]The type is not specified for variable "result"

MethodReturnTypeRequired3167

[SRC]def "test getDynamicFieldValueByType"() {

[MSG]Method "test getDynamicFieldValueByType" has a dynamic return type

UnnecessaryDotClass3169

[SRC]GroovySpy(DynamicFieldValue.class, global: true)

[MSG]DynamicFieldValue.class can be rewritten as DynamicFieldValue

VariableTypeRequired3170

[SRC]def mock = Mock(DynamicFieldValue.class)

[MSG]The type is not specified for variable "mock"

UnnecessaryDotClass3170

[SRC]def mock = Mock(DynamicFieldValue.class)

[MSG]DynamicFieldValue.class can be rewritten as DynamicFieldValue

VariableTypeRequired3176

[SRC]def result = DynamicFieldHelper.getDynamicFieldValueByType(null, null)

[MSG]The type is not specified for variable "result"

MethodReturnTypeRequired3183

[SRC]def "test getDomainProperties"() {

[MSG]Method "test getDomainProperties" has a dynamic return type

VariableTypeRequired3186

[SRC]def mock = Mock(DynamicFieldValue.class)

[MSG]The type is not specified for variable "mock"

UnnecessaryDotClass3186

[SRC]def mock = Mock(DynamicFieldValue.class)

[MSG]DynamicFieldValue.class can be rewritten as DynamicFieldValue

VariableTypeRequired3191

[SRC]def odf = Mock(ObjectDynamicField.class)

[MSG]The type is not specified for variable "odf"

UnnecessaryDotClass3191

[SRC]def odf = Mock(ObjectDynamicField.class)

[MSG]ObjectDynamicField.class can be rewritten as ObjectDynamicField

VariableTypeRequired3196

[SRC]def values = List.of(mock)

[MSG]The type is not specified for variable "values"

VariableTypeRequired3197

[SRC]def domainObject = new WithProperty()

[MSG]The type is not specified for variable "domainObject"

UnnecessaryGString3205

[SRC]null | OBJECT | null .. | 10

[MSG]The String 'objectId' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3205

[SRC]null | OBJECT | null .. | 10

[MSG]The String '3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3206

[SRC]null | FILE | null .. | 9

[MSG]The String 'objectId' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3206

[SRC]null | FILE | null .. | 9

[MSG]The String '2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3207

[SRC]null | IMAGE | null .. | 8

[MSG]The String 'objectId' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3207

[SRC]null | IMAGE | null .. | 8

[MSG]The String '1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3208

[SRC]null | INTEGER | null ..314") | 7

[MSG]The String 'numericValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3208

[SRC]null | INTEGER | null ..314") | 7

[MSG]The String '314' can be wrapped in single quotes instead of double quotes

UnnecessaryBigDecimalInstantiation3209

[SRC]null | DECIMAL | null .."3.14")) | 6

[MSG]Can be rewritten as 3.14 or 3.14G

UnnecessaryGString3209

[SRC]null | DECIMAL | null .."3.14")) | 6

[MSG]The String 'numericValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3210

[SRC]null | DATE | null ..w() | 5

[MSG]The String 'dateValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3211

[SRC]null | DATETIME | null ..w() | 4

[MSG]The String 'dateValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3212

[SRC]null | BOOLEAN | null .. | 3

[MSG]The String 'booleanValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3213

[SRC]null | STRING | null .. | 2

[MSG]The String 'stringValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3213

[SRC]null | STRING | null .. | 2

[MSG]The String 'STR_VALUE' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3214

[SRC]STRING_MULTIPLE_SELECTION | STRING | '["A", "B", "C"].. | 1

[MSG]The String 'jsonValue' can be wrapped in single quotes instead of double quotes

➥ FileHelperTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class FileHelperTest extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName211

[SRC]def "test getCSVFilesWithoutSuffix empty"() {

[MSG]Violation in class FileHelperTest. The method name test getCSVFilesWithoutSuffix empty in class tech.muyan.helper.FileHelperTest does not match [a-z]\w*

MethodName223

[SRC]def "test getCSVFilesWithoutSuffix one"() {

[MSG]Violation in class FileHelperTest. The method name test getCSVFilesWithoutSuffix one in class tech.muyan.helper.FileHelperTest does not match [a-z]\w*

MethodName238

[SRC]def "test getCSVFilesWithoutSuffix two"() {

[MSG]Violation in class FileHelperTest. The method name test getCSVFilesWithoutSuffix two in class tech.muyan.helper.FileHelperTest does not match [a-z]\w*

MethodName256

[SRC]def "test getFileContentMd5 empty file should not crash"() {

[MSG]Violation in class FileHelperTest. The method name test getFileContentMd5 empty file should not crash in class tech.muyan.helper.FileHelperTest does not match [a-z]\w*

MethodName268

[SRC]def "test getFileContentMd5 file with content"() {

[MSG]Violation in class FileHelperTest. The method name test getFileContentMd5 file with content in class tech.muyan.helper.FileHelperTest does not match [a-z]\w*

ImportFromSamePackage34

[SRC]import tech.muyan.helper.FileHelper

MethodReturnTypeRequired311

[SRC]def "test getCSVFilesWithoutSuffix empty"() {

[MSG]Method "test getCSVFilesWithoutSuffix empty" has a dynamic return type

UnnecessaryGetter317

[SRC]List<String> csvFileNames = FileHelper.getCSVFilesWithou..olutePath())

[MSG]getAbsolutePath() can probably be rewritten as absolutePath

MethodReturnTypeRequired323

[SRC]def "test getCSVFilesWithoutSuffix one"() {

[MSG]Method "test getCSVFilesWithoutSuffix one" has a dynamic return type

UnnecessaryGString327

[SRC]File.createTempFile("Group", ".csv", file)

[MSG]The String 'Group' can be wrapped in single quotes instead of double quotes

UnnecessaryGString327

[SRC]File.createTempFile("Group", ".csv", file)

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

UnnecessaryGetter330

[SRC]List<String> csvFileNames = FileHelper.getCSVFilesWithou..olutePath())

[MSG]getAbsolutePath() can probably be rewritten as absolutePath

UnnecessaryGString334

[SRC]assert csvFileNames.get(0).contains("Group")

[MSG]The String 'Group' can be wrapped in single quotes instead of double quotes

UnnecessaryGString335

[SRC]assert !csvFileNames.get(0).contains(".csv")

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired338

[SRC]def "test getCSVFilesWithoutSuffix two"() {

[MSG]Method "test getCSVFilesWithoutSuffix two" has a dynamic return type

UnnecessaryGString342

[SRC]File.createTempFile("User", ".csv", file)

[MSG]The String 'User' can be wrapped in single quotes instead of double quotes

UnnecessaryGString342

[SRC]File.createTempFile("User", ".csv", file)

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

UnnecessaryGString343

[SRC]File.createTempFile("Group", ".csv", file)

[MSG]The String 'Group' can be wrapped in single quotes instead of double quotes

UnnecessaryGString343

[SRC]File.createTempFile("Group", ".csv", file)

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

UnnecessaryGetter346

[SRC]List<String> csvFileNames = FileHelper.getCSVFilesWithou..olutePath())

[MSG]getAbsolutePath() can probably be rewritten as absolutePath

UnnecessaryGString350

[SRC]assert csvFileNames.get(0).contains("Group") || csvFileN..ains("User")

[MSG]The String 'Group' can be wrapped in single quotes instead of double quotes

UnnecessaryGString350

[SRC]assert csvFileNames.get(0).contains("Group") || csvFileN..ains("User")

[MSG]The String 'User' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]assert csvFileNames.get(1).contains("Group") || csvFileN..ains("User")

[MSG]The String 'Group' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]assert csvFileNames.get(1).contains("Group") || csvFileN..ains("User")

[MSG]The String 'User' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]assert !csvFileNames.get(0).contains(".csv")

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

UnnecessaryGString353

[SRC]assert !csvFileNames.get(1).contains(".csv")

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired356

[SRC]def "test getFileContentMd5 empty file should not crash"() {

[MSG]Method "test getFileContentMd5 empty file should not crash" has a dynamic return type

UnnecessaryGString358

[SRC]File file = File.createTempFile("Group", ".csv")

[MSG]The String 'Group' can be wrapped in single quotes instead of double quotes

UnnecessaryGString358

[SRC]File file = File.createTempFile("Group", ".csv")

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

UnnecessaryGetter361

[SRC]String md5 = FileHelper.getFileContentMd5(file.getAbsolutePath())

[MSG]getAbsolutePath() can probably be rewritten as absolutePath

UnnecessaryGString365

[SRC]assert md5 == "d41d8cd98f00b204e9800998ecf8427e"

[MSG]The String 'd41d8cd98f00b204e9800998ecf8427e' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired368

[SRC]def "test getFileContentMd5 file with content"() {

[MSG]Method "test getFileContentMd5 file with content" has a dynamic return type

UnnecessaryGString370

[SRC]File file = File.createTempFile("Group", ".csv")

[MSG]The String 'Group' can be wrapped in single quotes instead of double quotes

UnnecessaryGString370

[SRC]File file = File.createTempFile("Group", ".csv")

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

UnnecessaryGString371

[SRC]file.write("Hello World!", "UTF-8")

[MSG]The String 'Hello World!' can be wrapped in single quotes instead of double quotes

UnnecessaryGString371

[SRC]file.write("Hello World!", "UTF-8")

[MSG]The String 'UTF-8' can be wrapped in single quotes instead of double quotes

UnnecessaryGetter374

[SRC]String md5 = FileHelper.getFileContentMd5(file.getAbsolutePath())

[MSG]getAbsolutePath() can probably be rewritten as absolutePath

UnnecessaryGString377

[SRC]assert md5 == "ed076287532e86365e841e92bfc50d8c"

[MSG]The String 'ed076287532e86365e841e92bfc50d8c' can be wrapped in single quotes instead of double quotes

➥ LabelHelperTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]class LabelHelperTest extends GroovyTestCase {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

ImportFromSamePackage36

[SRC]import tech.muyan.helper.LabelHelper

UnnecessaryDotClass314

[SRC]String val = LabelHelper.getLabelField(Organization.class)

[MSG]Organization.class can be rewritten as Organization

UnnecessaryGString315

[SRC]assertEquals("name", val)

[MSG]The String 'name' can be wrapped in single quotes instead of double quotes

UnnecessaryDotClass319

[SRC]String val = LabelHelper.getLabelField(ContractLine.class)

[MSG]ContractLine.class can be rewritten as ContractLine

UnnecessaryGString320

[SRC]assertEquals("id", val)

[MSG]The String 'id' can be wrapped in single quotes instead of double quotes

UnnecessaryDotClass324

[SRC]String val = LabelHelper.getLabelField(DomainClass.class)

[MSG]DomainClass.class can be rewritten as DomainClass

UnnecessaryGString325

[SRC]assertEquals("label", val)

[MSG]The String 'label' can be wrapped in single quotes instead of double quotes

➥ OrganizationHelperSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic217

[SRC]class OrganizationHelperSpec extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod219

[SRC]def setup() {

[MSG]Violation in class OrganizationHelperSpec. The method setup is both empty and not marked with @Override

EmptyMethod222

[SRC]def cleanup() {

[MSG]Violation in class OrganizationHelperSpec. The method cleanup is both empty and not marked with @Override

MethodName225

[SRC]def "test get Organization of user"() {

[MSG]Violation in class OrganizationHelperSpec. The method name test get Organization of user in class tech.muyan.helper.OrganizationHelperSpec does not match [a-z]\w*

MethodName244

[SRC]def "test get menus of organization"() {

[MSG]Violation in class OrganizationHelperSpec. The method name test get menus of organization in class tech.muyan.helper.OrganizationHelperSpec does not match [a-z]\w*

MethodName264

[SRC]def "test getRequestUrlFromDomainClassAndFormType asset fail"() {

[MSG]Violation in class OrganizationHelperSpec. The method name test getRequestUrlFromDomainClassAndFormType asset fail in class tech.muyan.helper.OrganizationHelperSpec does not match [a-z]\w*

MethodName272

[SRC]def "test getRequestUrlFromDomainClassAndFormType"() {

[MSG]Violation in class OrganizationHelperSpec. The method name test getRequestUrlFromDomainClassAndFormType in class tech.muyan.helper.OrganizationHelperSpec does not match [a-z]\w*

MethodName290

[SRC]def "test getHttpMethodFromFormType"() {

[MSG]Violation in class OrganizationHelperSpec. The method name test getHttpMethodFromFormType in class tech.muyan.helper.OrganizationHelperSpec does not match [a-z]\w*

UnnecessarySemicolon31

[SRC]package tech.muyan.helper;

[MSG]Semicolons as line endings can be removed safely

ImportFromSamePackage38

[SRC]import tech.muyan.helper.OrganizationHelper

NoWildcardImports311

[SRC]import tech.muyan.enums.FormType

[MSG]Wildcard (star) import

MisorderedStaticImports313

[SRC]import static tech.muyan.enums.FormType.*

[MSG]Static imports should appear before normal imports

MisorderedStaticImports314

[SRC]import static org.springframework.http.HttpMethod.*

[MSG]Static imports should appear before normal imports

NoWildcardImports314

[SRC]import static org.springframework.http.HttpMethod.*

[MSG]Wildcard (star) import

MethodReturnTypeRequired319

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef319

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired322

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef322

[SRC]def cleanup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired325

[SRC]def "test get Organization of user"() {

[MSG]Method "test get Organization of user" has a dynamic return type

VariableTypeRequired328

[SRC]def auth = Mock(Authentication.class)

[MSG]The type is not specified for variable "auth"

UnnecessaryDotClass328

[SRC]def auth = Mock(Authentication.class)

[MSG]Authentication.class can be rewritten as Authentication

UnnecessaryGetter329

[SRC]auth.getPrincipal() >> [properties: [id: 1L]]

[MSG]getPrincipal() can probably be rewritten as principal

VariableTypeRequired331

[SRC]def user =new User("dummyUser", "password")

[MSG]The type is not specified for variable "user"

UnnecessaryGString331

[SRC]def user =new User("dummyUser", "password")

[MSG]The String 'dummyUser' can be wrapped in single quotes instead of double quotes

UnnecessaryGString331

[SRC]def user =new User("dummyUser", "password")

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

UnnecessaryGString332

[SRC]user.organization = new Organization(name: "dummy")

[MSG]The String 'dummy' can be wrapped in single quotes instead of double quotes

VariableTypeRequired337

[SRC]def orgOfUser = OrganizationHelper.getOrganizationOfUser(auth)

[MSG]The type is not specified for variable "orgOfUser"

UnnecessaryGString340

[SRC]orgOfUser.name == "dummy"

[MSG]The String 'dummy' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired344

[SRC]def "test get menus of organization"() {

[MSG]Method "test get menus of organization" has a dynamic return type

VariableTypeRequired346

[SRC]def param = [sort: "displaySequence"]

[MSG]The type is not specified for variable "param"

UnnecessaryGString346

[SRC]def param = [sort: "displaySequence"]

[MSG]The String 'displaySequence' can be wrapped in single quotes instead of double quotes

VariableTypeRequired347

[SRC]def dm1 = new DynamicMenu()

[MSG]The type is not specified for variable "dm1"

VariableTypeRequired348

[SRC]def dm2 = new DynamicMenu()

[MSG]The type is not specified for variable "dm2"

VariableTypeRequired353

[SRC]def result = OrganizationHelper.getMenusOfOrganization(null, null)

[MSG]The type is not specified for variable "result"

MethodReturnTypeRequired364

[SRC]def "test getRequestUrlFromDomainClassAndFormType asset fail"() {

[MSG]Method "test getRequestUrlFromDomainClassAndFormType asset fail" has a dynamic return type

UnnecessaryPackageReference369

[SRC]thrown(java.lang.AssertionError)

[MSG]Specifying the package name is not necessary for java.lang.AssertionError

MethodReturnTypeRequired372

[SRC]def "test getRequestUrlFromDomainClassAndFormType"() {

[MSG]Method "test getRequestUrlFromDomainClassAndFormType" has a dynamic return type

VariableTypeRequired374

[SRC]def domainClazz = Mock(DomainClass.class)

[MSG]The type is not specified for variable "domainClazz"

UnnecessaryDotClass374

[SRC]def domainClazz = Mock(DomainClass.class)

[MSG]DomainClass.class can be rewritten as DomainClass

VariableTypeRequired376

[SRC]def result = OrganizationHelper.getRequestUrlFromDomainC..z, formType)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression383

[SRC]"User" | FormType.CREATE || "/User"

[MSG]The expression using || is compared to a constant

UnnecessaryGString383

[SRC]"User" | FormType.CREATE || "/User"

[MSG]The String 'User' can be wrapped in single quotes instead of double quotes

UnnecessaryGString383

[SRC]"User" | FormType.CREATE || "/User"

[MSG]The String '/User' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression384

[SRC]"Contract" | FormType.LIST || "/Contract"

[MSG]The expression using || is compared to a constant

UnnecessaryGString384

[SRC]"Contract" | FormType.LIST || "/Contract"

[MSG]The String 'Contract' can be wrapped in single quotes instead of double quotes

UnnecessaryGString384

[SRC]"Contract" | FormType.LIST || "/Contract"

[MSG]The String '/Contract' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression385

[SRC]"Contract" | FormType.UPDATE || "/Contract/**"

[MSG]The expression using || is compared to a constant

UnnecessaryGString385

[SRC]"Contract" | FormType.UPDATE || "/Contract/**"

[MSG]The String 'Contract' can be wrapped in single quotes instead of double quotes

UnnecessaryGString385

[SRC]"Contract" | FormType.UPDATE || "/Contract/**"

[MSG]The String '/Contract/**' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression386

[SRC]"Contract" | FormType.DISPLAY || "UNKNOWN_REQUEST_URL"

[MSG]The expression using || is compared to a constant

UnnecessaryGString386

[SRC]"Contract" | FormType.DISPLAY || "UNKNOWN_REQUEST_URL"

[MSG]The String 'Contract' can be wrapped in single quotes instead of double quotes

UnnecessaryGString386

[SRC]"Contract" | FormType.DISPLAY || "UNKNOWN_REQUEST_URL"

[MSG]The String 'UNKNOWN_REQUEST_URL' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired390

[SRC]def "test getHttpMethodFromFormType"() {

[MSG]Method "test getHttpMethodFromFormType" has a dynamic return type

VariableTypeRequired393

[SRC]def result = OrganizationHelper.getHttpMethodFromFormType(input)

[MSG]The type is not specified for variable "result"

➥ ParamsHelperTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]class ParamsHelperTest extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName226

[SRC]def "param id check"() {

[MSG]Violation in class ParamsHelperTest. The method name param id check in class tech.muyan.helper.ParamsHelperTest does not match [a-z]\w*

ImportFromSamePackage36

[SRC]import tech.muyan.helper.ParamsHelper

FieldTypeRequired315

[SRC]def mock1 = new GrailsParameterMap([id: 1L], null)

[MSG]The type is not specified for field "mock1"

FieldTypeRequired318

[SRC]def mock2 = new GrailsParameterMap([id: null], null)

[MSG]The type is not specified for field "mock2"

FieldTypeRequired321

[SRC]def mock3 = new GrailsParameterMap([id: 1], null)

[MSG]The type is not specified for field "mock3"

FieldTypeRequired324

[SRC]def mock4 = new GrailsParameterMap([id: "1"], null)

[MSG]The type is not specified for field "mock4"

UnnecessaryGString324

[SRC]def mock4 = new GrailsParameterMap([id: "1"], null)

[MSG]The String '1' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired326

[SRC]def "param id check"() {

[MSG]Method "param id check" has a dynamic return type

VariableTypeRequired328

[SRC]def result = ParamsHelper.idParamNotValid(input)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression335

[SRC]Mock(GrailsParameterMap) || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression336

[SRC]mock1 || false

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression337

[SRC]mock2 || true

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression338

[SRC]mock3 || false

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression339

[SRC]mock4 || false

[MSG]The expression using || is compared to a constant

➥ StringHelperTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class StringHelperTest extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName212

[SRC]void "test split camel case"() {

[MSG]Violation in class StringHelperTest. The method name test split camel case in class tech.muyan.helper.StringHelperTest does not match [a-z]\w*

ImportFromSamePackage34

[SRC]import tech.muyan.helper.StringHelper

NoDef314

[SRC]def splitResult = StringHelper.splitCamelCase(input)

[MSG]def for declaration should not be used

VariableTypeRequired314

[SRC]def splitResult = StringHelper.splitCamelCase(input)

[MSG]The type is not specified for variable "splitResult"

UnnecessaryBooleanExpression321

[SRC]"" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString321

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString321

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression322

[SRC]null || null

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression323

[SRC]"hello" || "hello"

[MSG]The expression using || is compared to a constant

UnnecessaryGString323

[SRC]"hello" || "hello"

[MSG]The String 'hello' can be wrapped in single quotes instead of double quotes

UnnecessaryGString323

[SRC]"hello" || "hello"

[MSG]The String 'hello' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression324

[SRC]"thisIsAClass" || "this Is A Class"

[MSG]The expression using || is compared to a constant

UnnecessaryGString324

[SRC]"thisIsAClass" || "this Is A Class"

[MSG]The String 'thisIsAClass' can be wrapped in single quotes instead of double quotes

UnnecessaryGString324

[SRC]"thisIsAClass" || "this Is A Class"

[MSG]The String 'this Is A Class' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression325

[SRC]"thisisloooong" || "thisisloooong"

[MSG]The expression using || is compared to a constant

UnnecessaryGString325

[SRC]"thisisloooong" || "thisisloooong"

[MSG]The String 'thisisloooong' can be wrapped in single quotes instead of double quotes

UnnecessaryGString325

[SRC]"thisisloooong" || "thisisloooong"

[MSG]The String 'thisisloooong' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression326

[SRC]"ContractOrg" || "Contract Org"

[MSG]The expression using || is compared to a constant

UnnecessaryGString326

[SRC]"ContractOrg" || "Contract Org"

[MSG]The String 'ContractOrg' can be wrapped in single quotes instead of double quotes

UnnecessaryGString326

[SRC]"ContractOrg" || "Contract Org"

[MSG]The String 'Contract Org' can be wrapped in single quotes instead of double quotes

NoDef332

[SRC]def result = StringHelper.pathTypeToJavaType(input)

[MSG]def for declaration should not be used

VariableTypeRequired332

[SRC]def result = StringHelper.pathTypeToJavaType(input)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression339

[SRC]"" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString339

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString339

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression340

[SRC]null || null

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression341

[SRC]"tech_muyan_domain_contract" || "tech.muyan.domain.contract"

[MSG]The expression using || is compared to a constant

UnnecessaryGString341

[SRC]"tech_muyan_domain_contract" || "tech.muyan.domain.contract"

[MSG]The String 'tech_muyan_domain_contract' can be wrapped in single quotes instead of double quotes

UnnecessaryGString341

[SRC]"tech_muyan_domain_contract" || "tech.muyan.domain.contract"

[MSG]The String 'tech.muyan.domain.contract' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression342

[SRC]"contract" || "contract"

[MSG]The expression using || is compared to a constant

UnnecessaryGString342

[SRC]"contract" || "contract"

[MSG]The String 'contract' can be wrapped in single quotes instead of double quotes

UnnecessaryGString342

[SRC]"contract" || "contract"

[MSG]The String 'contract' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression343

[SRC]"tech_contract" || "tech.contract"

[MSG]The expression using || is compared to a constant

UnnecessaryGString343

[SRC]"tech_contract" || "tech.contract"

[MSG]The String 'tech_contract' can be wrapped in single quotes instead of double quotes

UnnecessaryGString343

[SRC]"tech_contract" || "tech.contract"

[MSG]The String 'tech.contract' can be wrapped in single quotes instead of double quotes

NoDef349

[SRC]def result = StringHelper.javaTypeToPathType(input)

[MSG]def for declaration should not be used

VariableTypeRequired349

[SRC]def result = StringHelper.javaTypeToPathType(input)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression356

[SRC]"" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString356

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString356

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression357

[SRC]null || null

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression358

[SRC]"tech.muyan.domain.contract" || "tech_muyan_domain_contract"

[MSG]The expression using || is compared to a constant

UnnecessaryGString358

[SRC]"tech.muyan.domain.contract" || "tech_muyan_domain_contract"

[MSG]The String 'tech.muyan.domain.contract' can be wrapped in single quotes instead of double quotes

UnnecessaryGString358

[SRC]"tech.muyan.domain.contract" || "tech_muyan_domain_contract"

[MSG]The String 'tech_muyan_domain_contract' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression359

[SRC]"contract" || "contract"

[MSG]The expression using || is compared to a constant

UnnecessaryGString359

[SRC]"contract" || "contract"

[MSG]The String 'contract' can be wrapped in single quotes instead of double quotes

UnnecessaryGString359

[SRC]"contract" || "contract"

[MSG]The String 'contract' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression360

[SRC]"tech.contract" || "tech_contract"

[MSG]The expression using || is compared to a constant

UnnecessaryGString360

[SRC]"tech.contract" || "tech_contract"

[MSG]The String 'tech.contract' can be wrapped in single quotes instead of double quotes

UnnecessaryGString360

[SRC]"tech.contract" || "tech_contract"

[MSG]The String 'tech_contract' can be wrapped in single quotes instead of double quotes

Package: tech.muyan.importexport

➥ CSVHelperTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]class CSVHelperTest extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName213

[SRC]def "get Instance"() {

[MSG]Violation in class CSVHelperTest. The method name get Instance in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName223

[SRC]def "get CSV Record Content"() {

[MSG]Violation in class CSVHelperTest. The method name get CSV Record Content in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName241

[SRC]def "is object field"() {

[MSG]Violation in class CSVHelperTest. The method name is object field in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName256

[SRC]def "is query field"() {

[MSG]Violation in class CSVHelperTest. The method name is query field in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName273

[SRC]def "replace query sign"() {

[MSG]Violation in class CSVHelperTest. The method name replace query sign in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName292

[SRC]def "get object field query field null"() {

[MSG]Violation in class CSVHelperTest. The method name get object field query field null in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

UnusedVariable294

[SRC]def result = CSVHelper.me().getObjectFieldQueryField(input)

[MSG]The variable [result] in class tech.muyan.importexport.CSVHelperTest is not used

MethodName2104

[SRC]def "get object field query field"() {

[MSG]Violation in class CSVHelperTest. The method name get object field query field in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName2122

[SRC]def "is comment line"() {

[MSG]Violation in class CSVHelperTest. The method name is comment line in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName2149

[SRC]def "get object field name"() {

[MSG]Violation in class CSVHelperTest. The method name get object field name in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName2171

[SRC]def "test getFieldType id"() {

[MSG]Violation in class CSVHelperTest. The method name test getFieldType id in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName2179

[SRC]def "test getFieldType simple"() {

[MSG]Violation in class CSVHelperTest. The method name test getFieldType simple in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName2205

[SRC]def "test getFieldType object"() {

[MSG]Violation in class CSVHelperTest. The method name test getFieldType object in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName2231

[SRC]def "test startsAndEndsWithQuote"() {

[MSG]Violation in class CSVHelperTest. The method name test startsAndEndsWithQuote in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName2248

[SRC]def "test removeStartAndEndQuote"() {

[MSG]Violation in class CSVHelperTest. The method name test removeStartAndEndQuote in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName2265

[SRC]def "test isDynamicFieldColumn"() {

[MSG]Violation in class CSVHelperTest. The method name test isDynamicFieldColumn in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodName2283

[SRC]def "test removeDynamicFieldSign"() {

[MSG]Violation in class CSVHelperTest. The method name test removeDynamicFieldSign in class tech.muyan.importexport.CSVHelperTest does not match [a-z]\w*

MethodReturnTypeRequired313

[SRC]def "get Instance"() {

[MSG]Method "get Instance" has a dynamic return type

VariableTypeRequired316

[SRC]def me = CSVHelper.me()

[MSG]The type is not specified for variable "me"

MethodReturnTypeRequired323

[SRC]def "get CSV Record Content"() {

[MSG]Method "get CSV Record Content" has a dynamic return type

UnnecessaryGString326

[SRC]File file = File.createTempFile("User", ".csv")

[MSG]The String 'User' can be wrapped in single quotes instead of double quotes

UnnecessaryGString326

[SRC]File file = File.createTempFile("User", ".csv")

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

UnnecessaryGString327

[SRC]file.write("id, username, password, passwordExpired\n1, ..123, today")

[MSG]The String 'id, username, password, passwordExpired 1, user, 123, today' can be wrapped in single quotes instead of double quotes

VariableTypeRequired328

[SRC]def fileInputStream = new FileInputStream(file.getPath())

[MSG]The type is not specified for variable "fileInputStream"

UnnecessaryGetter328

[SRC]def fileInputStream = new FileInputStream(file.getPath())

[MSG]getPath() can probably be rewritten as path

VariableTypeRequired329

[SRC]def bomInputStream = new BOMInputStream(fileInputStream)

[MSG]The type is not specified for variable "bomInputStream"

VariableTypeRequired330

[SRC]def reader = new InputStreamReader(bomInputStream, 'UTF-8')

[MSG]The type is not specified for variable "reader"

VariableTypeRequired334

[SRC]def result = CSVHelper.me().getCSVRecordContent(records...or().next())

[MSG]The type is not specified for variable "result"

UnnecessaryGString337

[SRC]assert result == "1, user, 123, today"

[MSG]The String '1, user, 123, today' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired341

[SRC]def "is object field"() {

[MSG]Method "is object field" has a dynamic return type

VariableTypeRequired343

[SRC]def result = CSVHelper.me().isObjectField(input)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression350

[SRC]null || false

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression351

[SRC]"" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString351

[SRC]"" || false

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression352

[SRC]"abc" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString352

[SRC]"abc" || false

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression353

[SRC]"abc.def" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString353

[SRC]"abc.def" || true

[MSG]The String 'abc.def' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired356

[SRC]def "is query field"() {

[MSG]Method "is query field" has a dynamic return type

VariableTypeRequired358

[SRC]def result = CSVHelper.me().isQueryField(input)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression365

[SRC]null || false

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression366

[SRC]"" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString366

[SRC]"" || false

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression367

[SRC]"abc" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString367

[SRC]"abc" || false

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression368

[SRC]"abc(*)" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString368

[SRC]"abc(*)" || true

[MSG]The String 'abc(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression369

[SRC]"abc.def" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString369

[SRC]"abc.def" || false

[MSG]The String 'abc.def' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression370

[SRC]"abc.def(*)" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString370

[SRC]"abc.def(*)" || true

[MSG]The String 'abc.def(*)' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired373

[SRC]def "replace query sign"() {

[MSG]Method "replace query sign" has a dynamic return type

VariableTypeRequired375

[SRC]def result = CSVHelper.me().removeQuerySign(input)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression382

[SRC]null || null

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression383

[SRC]"" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString383

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString383

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression384

[SRC]"abc" || "abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString384

[SRC]"abc" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString384

[SRC]"abc" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression385

[SRC]"abc(*)" || "abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString385

[SRC]"abc(*)" || "abc"

[MSG]The String 'abc(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString385

[SRC]"abc(*)" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression386

[SRC]"abc.def" || "abc.def"

[MSG]The expression using || is compared to a constant

UnnecessaryGString386

[SRC]"abc.def" || "abc.def"

[MSG]The String 'abc.def' can be wrapped in single quotes instead of double quotes

UnnecessaryGString386

[SRC]"abc.def" || "abc.def"

[MSG]The String 'abc.def' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression387

[SRC]"abc.def(*)" || "abc.def"

[MSG]The expression using || is compared to a constant

UnnecessaryGString387

[SRC]"abc.def(*)" || "abc.def"

[MSG]The String 'abc.def(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString387

[SRC]"abc.def(*)" || "abc.def"

[MSG]The String 'abc.def' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression388

[SRC]"Abc" || "Abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString388

[SRC]"Abc" || "Abc"

[MSG]The String 'Abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString388

[SRC]"Abc" || "Abc"

[MSG]The String 'Abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression389

[SRC]"Abc.Def(*)" || "Abc.Def"

[MSG]The expression using || is compared to a constant

UnnecessaryGString389

[SRC]"Abc.Def(*)" || "Abc.Def"

[MSG]The String 'Abc.Def(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString389

[SRC]"Abc.Def(*)" || "Abc.Def"

[MSG]The String 'Abc.Def' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired392

[SRC]def "get object field query field null"() {

[MSG]Method "get object field query field null" has a dynamic return type

VariableTypeRequired394

[SRC]def result = CSVHelper.me().getObjectFieldQueryField(input)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression3101

[SRC]null || java.lang.AssertionError

[MSG]The expression using || is compared to a constant

UnnecessaryPackageReference3101

[SRC]null || java.lang.AssertionError

[MSG]Specifying the package name is not necessary for java.lang.AssertionError

MethodReturnTypeRequired3104

[SRC]def "get object field query field"() {

[MSG]Method "get object field query field" has a dynamic return type

VariableTypeRequired3106

[SRC]def result = CSVHelper.me().getObjectFieldQueryField(input)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression3113

[SRC]"" || null

[MSG]The expression using || is compared to a constant

UnnecessaryGString3113

[SRC]"" || null

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3114

[SRC]"abc" || null

[MSG]The expression using || is compared to a constant

UnnecessaryGString3114

[SRC]"abc" || null

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3115

[SRC]"abc(*)" || null

[MSG]The expression using || is compared to a constant

UnnecessaryGString3115

[SRC]"abc(*)" || null

[MSG]The String 'abc(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3116

[SRC]"abc.def" || "def"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3116

[SRC]"abc.def" || "def"

[MSG]The String 'abc.def' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3116

[SRC]"abc.def" || "def"

[MSG]The String 'def' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3117

[SRC]"abc.def(*)" || "def"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3117

[SRC]"abc.def(*)" || "def"

[MSG]The String 'abc.def(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3117

[SRC]"abc.def(*)" || "def"

[MSG]The String 'def' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3118

[SRC]"Abc" || null

[MSG]The expression using || is compared to a constant

UnnecessaryGString3118

[SRC]"Abc" || null

[MSG]The String 'Abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3119

[SRC]"Abc.Def(*)" || "Def"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3119

[SRC]"Abc.Def(*)" || "Def"

[MSG]The String 'Abc.Def(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3119

[SRC]"Abc.Def(*)" || "Def"

[MSG]The String 'Def' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3122

[SRC]def "is comment line"() {

[MSG]Method "is comment line" has a dynamic return type

UnnecessaryGString3124

[SRC]File file = File.createTempFile("Comment", ".csv")

[MSG]The String 'Comment' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3124

[SRC]File file = File.createTempFile("Comment", ".csv")

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

VariableTypeRequired3126

[SRC]def fileInputStream = new FileInputStream(file.getPath())

[MSG]The type is not specified for variable "fileInputStream"

UnnecessaryGetter3126

[SRC]def fileInputStream = new FileInputStream(file.getPath())

[MSG]getPath() can probably be rewritten as path

VariableTypeRequired3127

[SRC]def bomInputStream = new BOMInputStream(fileInputStream)

[MSG]The type is not specified for variable "bomInputStream"

VariableTypeRequired3128

[SRC]def reader = new InputStreamReader(bomInputStream, 'UTF-8')

[MSG]The type is not specified for variable "reader"

VariableTypeRequired3132

[SRC]def result = CSVHelper.me().isCommentLine(records.iterator().next())

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression3139

[SRC]"" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3139

[SRC]"" || false

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3140

[SRC]"abc" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3140

[SRC]"abc" || false

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3141

[SRC]";abc" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3141

[SRC]";abc" || true

[MSG]The String ';abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3142

[SRC]";" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3142

[SRC]";" || true

[MSG]The String ';' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3143

[SRC]" ;abc" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3143

[SRC]" ;abc" || true

[MSG]The String ' ;abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3144

[SRC]" ;" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3144

[SRC]" ;" || true

[MSG]The String ' ;' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3145

[SRC]" ;abc," || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3145

[SRC]" ;abc," || true

[MSG]The String ' ;abc,' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3146

[SRC]" ;,abc" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3146

[SRC]" ;,abc" || true

[MSG]The String ' ;,abc' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3149

[SRC]def "get object field name"() {

[MSG]Method "get object field name" has a dynamic return type

VariableTypeRequired3151

[SRC]def result = CSVHelper.me().getObjectFieldName(input)

[MSG]The type is not specified for variable "result"

UnnecessaryBooleanExpression3158

[SRC]null || null

[MSG]The expression using || is compared to a constant

UnnecessaryBooleanExpression3159

[SRC]"" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString3159

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3159

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3160

[SRC]"abc" || "abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3160

[SRC]"abc" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3160

[SRC]"abc" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3161

[SRC]"abc(*)" || "abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3161

[SRC]"abc(*)" || "abc"

[MSG]The String 'abc(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3161

[SRC]"abc(*)" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3162

[SRC]"abc(*)(*)" || "abc(*)"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3162

[SRC]"abc(*)(*)" || "abc(*)"

[MSG]The String 'abc(*)(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3162

[SRC]"abc(*)(*)" || "abc(*)"

[MSG]The String 'abc(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3163

[SRC]"abc.def" || "abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3163

[SRC]"abc.def" || "abc"

[MSG]The String 'abc.def' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3163

[SRC]"abc.def" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3164

[SRC]"abc.def(*)" || "abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3164

[SRC]"abc.def(*)" || "abc"

[MSG]The String 'abc.def(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3164

[SRC]"abc.def(*)" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3165

[SRC]"Abc" || "Abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3165

[SRC]"Abc" || "Abc"

[MSG]The String 'Abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3165

[SRC]"Abc" || "Abc"

[MSG]The String 'Abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3166

[SRC]"Abc.Def(*)" || "Abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3166

[SRC]"Abc.Def(*)" || "Abc"

[MSG]The String 'Abc.Def(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3166

[SRC]"Abc.Def(*)" || "Abc"

[MSG]The String 'Abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3167

[SRC]".Def(*)" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString3167

[SRC]".Def(*)" || ""

[MSG]The String '.Def(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3167

[SRC]".Def(*)" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3168

[SRC]"Abc.(*)" || "Abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3168

[SRC]"Abc.(*)" || "Abc"

[MSG]The String 'Abc.(*)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3168

[SRC]"Abc.(*)" || "Abc"

[MSG]The String 'Abc' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3171

[SRC]def "test getFieldType id"() {

[MSG]Method "test getFieldType id" has a dynamic return type

VariableTypeRequired3173

[SRC]def type = CSVHelper.me().getFieldType("id", null)

[MSG]The type is not specified for variable "type"

UnnecessaryGString3173

[SRC]def type = CSVHelper.me().getFieldType("id", null)

[MSG]The String 'id' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3176

[SRC]assert type == "long"

[MSG]The String 'long' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3179

[SRC]def "test getFieldType simple"() {

[MSG]Method "test getFieldType simple" has a dynamic return type

VariableTypeRequired3181

[SRC]def headerName = "quantity"

[MSG]The type is not specified for variable "headerName"

UnnecessaryGString3181

[SRC]def headerName = "quantity"

[MSG]The String 'quantity' can be wrapped in single quotes instead of double quotes

VariableTypeRequired3182

[SRC]def meta =

[MSG]The type is not specified for variable "meta"

UnnecessaryGString3184

[SRC]"title" : "Quantity",

[MSG]The String 'title' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3184

[SRC]"title" : "Quantity",

[MSG]The String 'Quantity' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3185

[SRC]"dataIndex" : "quantity",

[MSG]The String 'dataIndex' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3185

[SRC]"dataIndex" : "quantity",

[MSG]The String 'quantity' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3186

[SRC]"key" : "quantity",

[MSG]The String 'key' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3186

[SRC]"key" : "quantity",

[MSG]The String 'quantity' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3187

[SRC]"editable" : true,

[MSG]The String 'editable' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3188

[SRC]"display" : true,

[MSG]The String 'display' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3189

[SRC]"labelField" : "authority",

[MSG]The String 'labelField' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3189

[SRC]"labelField" : "authority",

[MSG]The String 'authority' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3190

[SRC]"backReferenceField": "",

[MSG]The String 'backReferenceField' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3190

[SRC]"backReferenceField": "",

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3191

[SRC]"type" : "decimal",

[MSG]The String 'type' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3191

[SRC]"type" : "decimal",

[MSG]The String 'decimal' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3192

[SRC]"nullable" : false,

[MSG]The String 'nullable' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3193

[SRC]"validator" : "",

[MSG]The String 'validator' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3193

[SRC]"validator" : "",

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3194

[SRC]"updatable" : true

[MSG]The String 'updatable' can be wrapped in single quotes instead of double quotes

VariableTypeRequired3198

[SRC]def type = CSVHelper.me().getFieldType(headerName, meta)

[MSG]The type is not specified for variable "type"

UnnecessaryGString3201

[SRC]assert type == "decimal"

[MSG]The String 'decimal' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3205

[SRC]def "test getFieldType object"() {

[MSG]Method "test getFieldType object" has a dynamic return type

VariableTypeRequired3207

[SRC]def headerName = "authority.name"

[MSG]The type is not specified for variable "headerName"

UnnecessaryGString3207

[SRC]def headerName = "authority.name"

[MSG]The String 'authority.name' can be wrapped in single quotes instead of double quotes

VariableTypeRequired3208

[SRC]def meta =

[MSG]The type is not specified for variable "meta"

UnnecessaryGString3210

[SRC]"title" : "Authority",

[MSG]The String 'title' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3210

[SRC]"title" : "Authority",

[MSG]The String 'Authority' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3211

[SRC]"dataIndex" : "authority",

[MSG]The String 'dataIndex' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3211

[SRC]"dataIndex" : "authority",

[MSG]The String 'authority' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3212

[SRC]"key" : "authority",

[MSG]The String 'key' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3212

[SRC]"key" : "authority",

[MSG]The String 'authority' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3213

[SRC]"editable" : true,

[MSG]The String 'editable' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3214

[SRC]"display" : true,

[MSG]The String 'display' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3215

[SRC]"labelField" : "authority",

[MSG]The String 'labelField' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3215

[SRC]"labelField" : "authority",

[MSG]The String 'authority' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3216

[SRC]"backReferenceField": "",

[MSG]The String 'backReferenceField' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3216

[SRC]"backReferenceField": "",

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3217

[SRC]"type" : "tech_muyan_security_Role",

[MSG]The String 'type' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3217

[SRC]"type" : "tech_muyan_security_Role",

[MSG]The String 'tech_muyan_security_Role' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3218

[SRC]"nullable" : false,

[MSG]The String 'nullable' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3219

[SRC]"validator" : "",

[MSG]The String 'validator' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3219

[SRC]"validator" : "",

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3220

[SRC]"updatable" : true

[MSG]The String 'updatable' can be wrapped in single quotes instead of double quotes

VariableTypeRequired3224

[SRC]def type = CSVHelper.me().getFieldType(headerName, meta)

[MSG]The type is not specified for variable "type"

UnnecessaryGString3227

[SRC]assert type == "tech.muyan.security.Role"

[MSG]The String 'tech.muyan.security.Role' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3231

[SRC]def "test startsAndEndsWithQuote"() {

[MSG]Method "test startsAndEndsWithQuote" has a dynamic return type

VariableTypeRequired3233

[SRC]def value = CSVHelper.me().startsAndEndsWithQuote(input)

[MSG]The type is not specified for variable "value"

UnnecessaryBooleanExpression3240

[SRC]"\"abc\"" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3240

[SRC]"\"abc\"" || true

[MSG]The String '"abc"' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3241

[SRC]"\"\"" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3241

[SRC]"\"\"" || true

[MSG]The String '""' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3242

[SRC]"abc" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3242

[SRC]"abc" || false

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3243

[SRC]"" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3243

[SRC]"" || false

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3244

[SRC]"\"abc" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3244

[SRC]"\"abc" || false

[MSG]The String '"abc' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3248

[SRC]def "test removeStartAndEndQuote"() {

[MSG]Method "test removeStartAndEndQuote" has a dynamic return type

VariableTypeRequired3250

[SRC]def value = CSVHelper.me().removeStartAndEndQuote(input)

[MSG]The type is not specified for variable "value"

UnnecessaryBooleanExpression3257

[SRC]"\"abc\"" || "abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3257

[SRC]"\"abc\"" || "abc"

[MSG]The String '"abc"' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3257

[SRC]"\"abc\"" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3258

[SRC]"\"\"" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString3258

[SRC]"\"\"" || ""

[MSG]The String '""' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3258

[SRC]"\"\"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3259

[SRC]"abc" || "abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3259

[SRC]"abc" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3259

[SRC]"abc" || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3260

[SRC]"" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString3260

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3260

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3261

[SRC]"\"abc" || "\"abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3261

[SRC]"\"abc" || "\"abc"

[MSG]The String '"abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3261

[SRC]"\"abc" || "\"abc"

[MSG]The String '"abc' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3265

[SRC]def "test isDynamicFieldColumn"() {

[MSG]Method "test isDynamicFieldColumn" has a dynamic return type

VariableTypeRequired3267

[SRC]def value = CSVHelper.me().isDynamicFieldColumn(input)

[MSG]The type is not specified for variable "value"

UnnecessaryBooleanExpression3274

[SRC]"" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3274

[SRC]"" || false

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3275

[SRC]"a(#)" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3275

[SRC]"a(#)" || true

[MSG]The String 'a(#)' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3276

[SRC]"ABC_DEF(#)" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3276

[SRC]"ABC_DEF(#)" || true

[MSG]The String 'ABC_DEF(#)' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3277

[SRC]"ABC_DEF(#)(#)" || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3277

[SRC]"ABC_DEF(#)(#)" || true

[MSG]The String 'ABC_DEF(#)(#)' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3278

[SRC]"a" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3278

[SRC]"a" || false

[MSG]The String 'a' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3279

[SRC]"ABC_DEF" || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3279

[SRC]"ABC_DEF" || false

[MSG]The String 'ABC_DEF' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3283

[SRC]def "test removeDynamicFieldSign"() {

[MSG]Method "test removeDynamicFieldSign" has a dynamic return type

VariableTypeRequired3285

[SRC]def value = CSVHelper.me().removeDynamicFieldSign(input)

[MSG]The type is not specified for variable "value"

UnnecessaryBooleanExpression3292

[SRC]"" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString3292

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3292

[SRC]"" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3293

[SRC]"(#)" || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString3293

[SRC]"(#)" || ""

[MSG]The String '(#)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3293

[SRC]"(#)" || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3294

[SRC]"ABC" || "ABC"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3294

[SRC]"ABC" || "ABC"

[MSG]The String 'ABC' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3294

[SRC]"ABC" || "ABC"

[MSG]The String 'ABC' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3295

[SRC]"ABC(#)" || "ABC"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3295

[SRC]"ABC(#)" || "ABC"

[MSG]The String 'ABC(#)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3295

[SRC]"ABC(#)" || "ABC"

[MSG]The String 'ABC' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3296

[SRC]"ABC(#)(#)" || "ABC(#)"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3296

[SRC]"ABC(#)(#)" || "ABC(#)"

[MSG]The String 'ABC(#)(#)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3296

[SRC]"ABC(#)(#)" || "ABC(#)"

[MSG]The String 'ABC(#)' can be wrapped in single quotes instead of double quotes

➥ ImportRecordSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic27

[SRC]class ImportRecordSpec extends Specification implements ..ortRecord> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod216

[SRC]def cleanup() {

[MSG]Violation in class ImportRecordSpec. The method cleanup is both empty and not marked with @Override

MethodName219

[SRC]void "test domain not null and blank constraints"() {

[MSG]Violation in class ImportRecordSpec. The method name test domain not null and blank constraints in class tech.muyan.importexport.ImportRecordSpec does not match [a-z]\w*

MethodName236

[SRC]void "test domain nullable constraints"() {

[MSG]Violation in class ImportRecordSpec. The method name test domain nullable constraints in class tech.muyan.importexport.ImportRecordSpec does not match [a-z]\w*

MethodReturnTypeRequired312

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef312

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired316

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef316

[SRC]def cleanup() {

[MSG]def for method return type should not be used

UnnecessaryBooleanExpression329

[SRC]"domainClass" | null || "nullable"

[MSG]The expression using || is compared to a constant

UnnecessaryGString329

[SRC]"domainClass" | null || "nullable"

[MSG]The String 'domainClass' can be wrapped in single quotes instead of double quotes

UnnecessaryGString329

[SRC]"domainClass" | null || "nullable"

[MSG]The String 'nullable' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression330

[SRC]"csvFileMD5" | "" || "blank"

[MSG]The expression using || is compared to a constant

UnnecessaryGString330

[SRC]"csvFileMD5" | "" || "blank"

[MSG]The String 'csvFileMD5' can be wrapped in single quotes instead of double quotes

UnnecessaryGString330

[SRC]"csvFileMD5" | "" || "blank"

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString330

[SRC]"csvFileMD5" | "" || "blank"

[MSG]The String 'blank' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression331

[SRC]"csvFileMD5" | null || "nullable"

[MSG]The expression using || is compared to a constant

UnnecessaryGString331

[SRC]"csvFileMD5" | null || "nullable"

[MSG]The String 'csvFileMD5' can be wrapped in single quotes instead of double quotes

UnnecessaryGString331

[SRC]"csvFileMD5" | null || "nullable"

[MSG]The String 'nullable' can be wrapped in single quotes instead of double quotes

UnnecessaryGString332

[SRC]"status" | null | "nullable"

[MSG]The String 'status' can be wrapped in single quotes instead of double quotes

UnnecessaryGString332

[SRC]"status" | null | "nullable"

[MSG]The String 'nullable' can be wrapped in single quotes instead of double quotes

UnnecessaryGString333

[SRC]"startDate" | null | "nullable"

[MSG]The String 'startDate' can be wrapped in single quotes instead of double quotes

UnnecessaryGString333

[SRC]"startDate" | null | "nullable"

[MSG]The String 'nullable' can be wrapped in single quotes instead of double quotes

UnnecessaryGString345

[SRC]"csvFileHeader" | null

[MSG]The String 'csvFileHeader' can be wrapped in single quotes instead of double quotes

UnnecessaryGString346

[SRC]"insertedIds" | null

[MSG]The String 'insertedIds' can be wrapped in single quotes instead of double quotes

UnnecessaryGString347

[SRC]"updatedIds" | null

[MSG]The String 'updatedIds' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]"failedLines" | null

[MSG]The String 'failedLines' can be wrapped in single quotes instead of double quotes

UnnecessaryGString349

[SRC]"skippedLines" | null

[MSG]The String 'skippedLines' can be wrapped in single quotes instead of double quotes

UnnecessaryGString350

[SRC]"logs" | null

[MSG]The String 'logs' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]"insertedIds" | ""

[MSG]The String 'insertedIds' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]"insertedIds" | ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]"updatedIds" | ""

[MSG]The String 'updatedIds' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]"updatedIds" | ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString353

[SRC]"failedLines" | ""

[MSG]The String 'failedLines' can be wrapped in single quotes instead of double quotes

UnnecessaryGString353

[SRC]"failedLines" | ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString354

[SRC]"skippedLines" | ""

[MSG]The String 'skippedLines' can be wrapped in single quotes instead of double quotes

UnnecessaryGString354

[SRC]"skippedLines" | ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString355

[SRC]"logs" | ""

[MSG]The String 'logs' can be wrapped in single quotes instead of double quotes

UnnecessaryGString355

[SRC]"logs" | ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString356

[SRC]"finishDate" | null

[MSG]The String 'finishDate' can be wrapped in single quotes instead of double quotes

Package: tech.muyan.importexport.converter

➥ ConverterFactoryTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic220

[SRC]class ConverterFactoryTest extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName225

[SRC]def "test registerConverter"() {

[MSG]Violation in class ConverterFactoryTest. The method name test registerConverter in class tech.muyan.importexport.converter.ConverterFactoryTest does not match [a-z]\w*

MethodName243

[SRC]def "test no convert found"() {

[MSG]Violation in class ConverterFactoryTest. The method name test no convert found in class tech.muyan.importexport.converter.ConverterFactoryTest does not match [a-z]\w*

MethodName256

[SRC]def "test converts throw exception"() {

[MSG]Violation in class ConverterFactoryTest. The method name test converts throw exception in class tech.muyan.importexport.converter.ConverterFactoryTest does not match [a-z]\w*

MethodName281

[SRC]def "test convert values"() {

[MSG]Violation in class ConverterFactoryTest. The method name test convert values in class tech.muyan.importexport.converter.ConverterFactoryTest does not match [a-z]\w*

FieldTypeRequired323

[SRC]def longValue = Integer.MAX_VALUE + 1

[MSG]The type is not specified for field "longValue"

MethodReturnTypeRequired325

[SRC]def "test registerConverter"() {

[MSG]Method "test registerConverter" has a dynamic return type

UnnecessaryGString330

[SRC]return s.equals("abc")

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryReturnKeyword330

[SRC]return s.equals("abc")

[MSG]The return keyword is not needed and can be removed

UnnecessaryReturnKeyword335

[SRC]return sourceValue

[MSG]The return keyword is not needed and can be removed

UnnecessaryGString340

[SRC]assert ConverterFactory.getConverter("abc") != null

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired343

[SRC]def "test no convert found"() {

[MSG]Method "test no convert found" has a dynamic return type

UnnecessaryBooleanExpression352

[SRC]"a.b.enums.c" || UnRecognizedTypeException

[MSG]The expression using || is compared to a constant

UnnecessaryGString352

[SRC]"a.b.enums.c" || UnRecognizedTypeException

[MSG]The String 'a.b.enums.c' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression353

[SRC]"java.lang.StringUTF16" || UnRecognizedTypeException

[MSG]The expression using || is compared to a constant

UnnecessaryGString353

[SRC]"java.lang.StringUTF16" || UnRecognizedTypeException

[MSG]The String 'java.lang.StringUTF16' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired356

[SRC]def "test converts throw exception"() {

[MSG]Method "test converts throw exception" has a dynamic return type

VariableTypeRequired358

[SRC]def convert = ConverterFactory.getConverter(type)

[MSG]The type is not specified for variable "convert"

UnnecessaryGString364

[SRC]convert.convert(input, type, "fieldName")

[MSG]The String 'fieldName' can be wrapped in single quotes instead of double quotes

UnnecessaryGString371

[SRC]"boolean" | "notBo..lueException

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString371

[SRC]"boolean" | "notBo..lueException

[MSG]The String 'notBoolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString372

[SRC]"date" | "notDa..lueException

[MSG]The String 'date' can be wrapped in single quotes instead of double quotes

UnnecessaryGString372

[SRC]"date" | "notDa..lueException

[MSG]The String 'notDate' can be wrapped in single quotes instead of double quotes

UnnecessaryGString373

[SRC]"decimal" | "notDe..lueException

[MSG]The String 'decimal' can be wrapped in single quotes instead of double quotes

UnnecessaryGString373

[SRC]"decimal" | "notDe..lueException

[MSG]The String 'notDecimal' can be wrapped in single quotes instead of double quotes

UnnecessaryGString374

[SRC]"tech.muyan.enums.LogicType" | "notVa..lueException

[MSG]The String 'tech.muyan.enums.LogicType' can be wrapped in single quotes instead of double quotes

UnnecessaryGString374

[SRC]"tech.muyan.enums.LogicType" | "notVa..lueException

[MSG]The String 'notValidValue' can be wrapped in single quotes instead of double quotes

UnnecessaryGString375

[SRC]"tech.muyan.importexport.converter.EnumForTest" | "opt3"..hodException

[MSG]The String 'tech.muyan.importexport.converter.EnumForTest' can be wrapped in single quotes instead of double quotes

UnnecessaryGString375

[SRC]"tech.muyan.importexport.converter.EnumForTest" | "opt3"..hodException

[MSG]The String 'opt3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString376

[SRC]"httpMethod" | "notVa..lueException

[MSG]The String 'httpMethod' can be wrapped in single quotes instead of double quotes

UnnecessaryGString376

[SRC]"httpMethod" | "notVa..lueException

[MSG]The String 'notValidHttpMethod' can be wrapped in single quotes instead of double quotes

UnnecessaryGString377

[SRC]"integer" | "notVa..lueException

[MSG]The String 'integer' can be wrapped in single quotes instead of double quotes

UnnecessaryGString377

[SRC]"integer" | "notVa..lueException

[MSG]The String 'notValidInteger' can be wrapped in single quotes instead of double quotes

UnnecessaryGString378

[SRC]"long" | "notVa..lueException

[MSG]The String 'long' can be wrapped in single quotes instead of double quotes

UnnecessaryGString378

[SRC]"long" | "notVa..lueException

[MSG]The String 'notValidLong' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired381

[SRC]def "test convert values"() {

[MSG]Method "test convert values" has a dynamic return type

VariableTypeRequired383

[SRC]def convert = ConverterFactory.getConverter(type)

[MSG]The type is not specified for variable "convert"

UnnecessaryGString387

[SRC]assert convert.convert(input, type, "fieldName") == output

[MSG]The String 'fieldName' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression391

[SRC]"boolean" | "Y" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString391

[SRC]"boolean" | "Y" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString391

[SRC]"boolean" | "Y" .. || true

[MSG]The String 'Y' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression392

[SRC]"boolean" | "y" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString392

[SRC]"boolean" | "y" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString392

[SRC]"boolean" | "y" .. || true

[MSG]The String 'y' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression393

[SRC]"boolean" | "Yes" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString393

[SRC]"boolean" | "Yes" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString393

[SRC]"boolean" | "Yes" .. || true

[MSG]The String 'Yes' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression394

[SRC]"boolean" | "YES" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString394

[SRC]"boolean" | "YES" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString394

[SRC]"boolean" | "YES" .. || true

[MSG]The String 'YES' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression395

[SRC]"boolean" | "true" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString395

[SRC]"boolean" | "true" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString395

[SRC]"boolean" | "true" .. || true

[MSG]The String 'true' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression396

[SRC]"boolean" | "TRUE" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString396

[SRC]"boolean" | "TRUE" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString396

[SRC]"boolean" | "TRUE" .. || true

[MSG]The String 'TRUE' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression397

[SRC]"boolean" | "T" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString397

[SRC]"boolean" | "T" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString397

[SRC]"boolean" | "T" .. || true

[MSG]The String 'T' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression398

[SRC]"boolean" | "t" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString398

[SRC]"boolean" | "t" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString398

[SRC]"boolean" | "t" .. || true

[MSG]The String 't' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression399

[SRC]"boolean" | "是" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString399

[SRC]"boolean" | "是" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString399

[SRC]"boolean" | "是" .. || true

[MSG]The String '是' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3100

[SRC]"boolean" | "1" .. || true

[MSG]The expression using || is compared to a constant

UnnecessaryGString3100

[SRC]"boolean" | "1" .. || true

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3100

[SRC]"boolean" | "1" .. || true

[MSG]The String '1' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3101

[SRC]"boolean" | "N" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3101

[SRC]"boolean" | "N" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3101

[SRC]"boolean" | "N" .. || false

[MSG]The String 'N' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3102

[SRC]"boolean" | "n" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3102

[SRC]"boolean" | "n" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3102

[SRC]"boolean" | "n" .. || false

[MSG]The String 'n' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3103

[SRC]"boolean" | "No" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3103

[SRC]"boolean" | "No" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3103

[SRC]"boolean" | "No" .. || false

[MSG]The String 'No' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3104

[SRC]"boolean" | "NO" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3104

[SRC]"boolean" | "NO" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3104

[SRC]"boolean" | "NO" .. || false

[MSG]The String 'NO' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3105

[SRC]"boolean" | "false" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3105

[SRC]"boolean" | "false" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3105

[SRC]"boolean" | "false" .. || false

[MSG]The String 'false' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3106

[SRC]"boolean" | "FALSE" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3106

[SRC]"boolean" | "FALSE" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3106

[SRC]"boolean" | "FALSE" .. || false

[MSG]The String 'FALSE' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3107

[SRC]"boolean" | "F" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3107

[SRC]"boolean" | "F" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3107

[SRC]"boolean" | "F" .. || false

[MSG]The String 'F' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3108

[SRC]"boolean" | "f" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3108

[SRC]"boolean" | "f" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3108

[SRC]"boolean" | "f" .. || false

[MSG]The String 'f' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3109

[SRC]"boolean" | "否" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3109

[SRC]"boolean" | "否" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3109

[SRC]"boolean" | "否" .. || false

[MSG]The String '否' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3110

[SRC]"boolean" | "0" .. || false

[MSG]The expression using || is compared to a constant

UnnecessaryGString3110

[SRC]"boolean" | "0" .. || false

[MSG]The String 'boolean' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3110

[SRC]"boolean" | "0" .. || false

[MSG]The String '0' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3111

[SRC]"integer" | "1" .. || 1

[MSG]The expression using || is compared to a constant

UnnecessaryGString3111

[SRC]"integer" | "1" .. || 1

[MSG]The String 'integer' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3111

[SRC]"integer" | "1" .. || 1

[MSG]The String '1' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3112

[SRC]"integer" | "0" .. || 0

[MSG]The expression using || is compared to a constant

UnnecessaryGString3112

[SRC]"integer" | "0" .. || 0

[MSG]The String 'integer' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3112

[SRC]"integer" | "0" .. || 0

[MSG]The String '0' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3113

[SRC]"integer" | String.valueOf..er.MAX_VALUE

[MSG]The String 'integer' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3114

[SRC]"long" | "1" .. || 1

[MSG]The expression using || is compared to a constant

UnnecessaryGString3114

[SRC]"long" | "1" .. || 1

[MSG]The String 'long' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3114

[SRC]"long" | "1" .. || 1

[MSG]The String '1' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3115

[SRC]"long" | "0" .. || 0

[MSG]The expression using || is compared to a constant

UnnecessaryGString3115

[SRC]"long" | "0" .. || 0

[MSG]The String 'long' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3115

[SRC]"long" | "0" .. || 0

[MSG]The String '0' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3116

[SRC]"long" | "-1" .. || -1

[MSG]The expression using || is compared to a constant

UnnecessaryGString3116

[SRC]"long" | "-1" .. || -1

[MSG]The String 'long' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3116

[SRC]"long" | "-1" .. || -1

[MSG]The String '-1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3117

[SRC]"long" | String.valueOf..|| longValue

[MSG]The String 'long' can be wrapped in single quotes instead of double quotes

UnnecessaryBigDecimalInstantiation3118

[SRC]"decimal" | "1.25" ..imal("1.25")

[MSG]Can be rewritten as 1.25 or 1.25G

UnnecessaryGString3118

[SRC]"decimal" | "1.25" ..imal("1.25")

[MSG]The String 'decimal' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3118

[SRC]"decimal" | "1.25" ..imal("1.25")

[MSG]The String '1.25' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3118

[SRC]"decimal" | "1.25" ..imal("1.25")

[MSG]The String '1.25' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3119

[SRC]"decimal" | "0" ..Decimal("0")

[MSG]The String 'decimal' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3119

[SRC]"decimal" | "0" ..Decimal("0")

[MSG]The String '0' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3119

[SRC]"decimal" | "0" ..Decimal("0")

[MSG]The String '0' can be wrapped in single quotes instead of double quotes

UnnecessaryBigDecimalInstantiation3120

[SRC]"decimal" | "0.15" ..imal("0.15")

[MSG]Can be rewritten as 0.15 or 0.15G

UnnecessaryGString3120

[SRC]"decimal" | "0.15" ..imal("0.15")

[MSG]The String 'decimal' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3120

[SRC]"decimal" | "0.15" ..imal("0.15")

[MSG]The String '0.15' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3120

[SRC]"decimal" | "0.15" ..imal("0.15")

[MSG]The String '0.15' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3121

[SRC]"string" | "" .. || ""

[MSG]The expression using || is compared to a constant

UnnecessaryGString3121

[SRC]"string" | "" .. || ""

[MSG]The String 'string' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3121

[SRC]"string" | "" .. || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3121

[SRC]"string" | "" .. || ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3122

[SRC]"string" | "abc" .. || "abc"

[MSG]The expression using || is compared to a constant

UnnecessaryGString3122

[SRC]"string" | "abc" .. || "abc"

[MSG]The String 'string' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3122

[SRC]"string" | "abc" .. || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3122

[SRC]"string" | "abc" .. || "abc"

[MSG]The String 'abc' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3123

[SRC]"string" | null .. || null

[MSG]The expression using || is compared to a constant

UnnecessaryGString3123

[SRC]"string" | null .. || null

[MSG]The String 'string' can be wrapped in single quotes instead of double quotes

UnnecessaryBooleanExpression3124

[SRC]"string" | "NULL" .. || null

[MSG]The expression using || is compared to a constant

UnnecessaryGString3124

[SRC]"string" | "NULL" .. || null

[MSG]The String 'string' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3124

[SRC]"string" | "NULL" .. || null

[MSG]The String 'NULL' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3125

[SRC]"date" | "2012-11-20" ..012, 11, 20)

[MSG]The String 'date' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3125

[SRC]"date" | "2012-11-20" ..012, 11, 20)

[MSG]The String '2012-11-20' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3126

[SRC]"datetime" | "2012-11-20 11.. 11, 20, 01)

[MSG]The String 'datetime' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3126

[SRC]"datetime" | "2012-11-20 11.. 11, 20, 01)

[MSG]The String '2012-11-20 11:20:01' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3127

[SRC]"date" | "2012/11/20" ..012, 11, 20)

[MSG]The String 'date' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3127

[SRC]"date" | "2012/11/20" ..012, 11, 20)

[MSG]The String '2012/11/20' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3128

[SRC]"datetime" | "2012/11/20 11.. 11, 20, 01)

[MSG]The String 'datetime' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3128

[SRC]"datetime" | "2012/11/20 11.. 11, 20, 01)

[MSG]The String '2012/11/20 11:20:01' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3129

[SRC]"datetime" | "2012-11-20T11.., 108000000)

[MSG]The String 'datetime' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3129

[SRC]"datetime" | "2012-11-20T11.., 108000000)

[MSG]The String '2012-11-20T11:20:01.108Z' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3130

[SRC]"tech.muyan.enums.LogicType" | "Field depende..Type.DECIDES

[MSG]The String 'tech.muyan.enums.LogicType' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3130

[SRC]"tech.muyan.enums.LogicType" | "Field depende..Type.DECIDES

[MSG]The String 'Field dependencies logic' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3131

[SRC]"tech.muyan.enums.DisplayComponentType" | "ABSTRACT_DATE..BSTRACT_DATE

[MSG]The String 'tech.muyan.enums.DisplayComponentType' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3131

[SRC]"tech.muyan.enums.DisplayComponentType" | "ABSTRACT_DATE..BSTRACT_DATE

[MSG]The String 'ABSTRACT_DATE' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3132

[SRC]"httpMethod" | "GET" ..tpMethod.GET

[MSG]The String 'httpMethod' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3132

[SRC]"httpMethod" | "GET" ..tpMethod.GET

[MSG]The String 'GET' can be wrapped in single quotes instead of double quotes

➥ EnumForTest.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic27

[SRC]enum EnumForTest {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

FieldName29

[SRC]Opt1, Opt2

[MSG]The fieldname Opt1 in class tech.muyan.importexport.converter.EnumForTest does not match [A-Z][A-Z0-9_]*

FieldName29

[SRC]Opt1, Opt2

[MSG]The fieldname Opt2 in class tech.muyan.importexport.converter.EnumForTest does not match [A-Z][A-Z0-9_]*

Package: tech.muyan.security

➥ AuthenticationTokenSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic26

[SRC]class AuthenticationTokenSpec extends Specification impl..tionToken> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod28

[SRC]def setup() {

[MSG]Violation in class AuthenticationTokenSpec. The method setup is both empty and not marked with @Override

EmptyMethod211

[SRC]def cleanup() {

[MSG]Violation in class AuthenticationTokenSpec. The method cleanup is both empty and not marked with @Override

MethodName214

[SRC]void "test something"() {

[MSG]Violation in class AuthenticationTokenSpec. The method name test something in class tech.muyan.security.AuthenticationTokenSpec does not match [a-z]\w*

ComparisonOfTwoConstants216

[SRC]true == true

[MSG]Comparing two constants or constant literals is useless and may indicate a bug: (true == true)

MethodReturnTypeRequired38

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef38

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired311

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef311

[SRC]def cleanup() {

[MSG]def for method return type should not be used

UnnecessaryGString315

[SRC]expect: "fix me"

[MSG]The String 'fix me' can be wrapped in single quotes instead of double quotes

InvertedCondition316

[SRC]true == true

[MSG]true is a constant expression on the left side of a compare equals operation

➥ AuthorityHelperSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]class AuthorityHelperSpec extends Specification {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod214

[SRC]def setup() {

[MSG]Violation in class AuthorityHelperSpec. The method setup is both empty and not marked with @Override

EmptyMethod217

[SRC]def cleanup() {

[MSG]Violation in class AuthorityHelperSpec. The method cleanup is both empty and not marked with @Override

MethodName220

[SRC]def "check Authority"() {

[MSG]Violation in class AuthorityHelperSpec. The method name check Authority in class tech.muyan.security.AuthorityHelperSpec does not match [a-z]\w*

MethodName231

[SRC]def "get object operate roles"() {

[MSG]Violation in class AuthorityHelperSpec. The method name get object operate roles in class tech.muyan.security.AuthorityHelperSpec does not match [a-z]\w*

UnusedVariable236

[SRC]def first = [configAttribute: firstReturn]

[MSG]The variable [first] in class tech.muyan.security.AuthorityHelperSpec is not used

UnusedVariable237

[SRC]def second = [configAttribute: secondReturn]

[MSG]The variable [second] in class tech.muyan.security.AuthorityHelperSpec is not used

UnnecessarySemicolon31

[SRC]package tech.muyan.security;

[MSG]Semicolons as line endings can be removed safely

UnnecessaryGroovyImport35

[SRC]import java.util.Collections

UnusedImport35

[SRC]import java.util.Collections

[MSG]The [java.util.Collections] import is never referenced

ImportFromSamePackage39

[SRC]import tech.muyan.security.User

MethodReturnTypeRequired314

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef314

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired317

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef317

[SRC]def cleanup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired320

[SRC]def "check Authority"() {

[MSG]Method "check Authority" has a dynamic return type

VariableTypeRequired322

[SRC]def auth = Mock(Authentication.class)

[MSG]The type is not specified for variable "auth"

UnnecessaryDotClass322

[SRC]def auth = Mock(Authentication.class)

[MSG]Authentication.class can be rewritten as Authentication

VariableTypeRequired323

[SRC]def roles = ""

[MSG]The type is not specified for variable "roles"

UnnecessaryGString323

[SRC]def roles = ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

VariableTypeRequired324

[SRC]def result = AuthorityHelper.checkAuthority(auth, roles)

[MSG]The type is not specified for variable "result"

MethodReturnTypeRequired331

[SRC]def "get object operate roles"() {

[MSG]Method "get object operate roles" has a dynamic return type

VariableTypeRequired334

[SRC]def userClazzName = User.getClass().getName()

[MSG]The type is not specified for variable "userClazzName"

UnnecessaryGetter334

[SRC]def userClazzName = User.getClass().getName()

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

VariableTypeRequired335

[SRC]def userClazzSimpleName = User.getClass().getSimpleName()

[MSG]The type is not specified for variable "userClazzSimpleName"

UnnecessaryGetter335

[SRC]def userClazzSimpleName = User.getClass().getSimpleName()

[MSG]getSimpleName() can probably be rewritten as simpleName

VariableTypeRequired336

[SRC]def first = [configAttribute: firstReturn]

[MSG]The type is not specified for variable "first"

VariableTypeRequired337

[SRC]def second = [configAttribute: secondReturn]

[MSG]The type is not specified for variable "second"

VariableTypeRequired340

[SRC]def result = AuthorityHelper.getObjectOperateRoles(User...T, wildcard)

[MSG]The type is not specified for variable "result"

UnnecessaryGString347

[SRC]"" | false | [configAttribute: "role1,role2"] | [..role1,role3"

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString347

[SRC]"" | false | [configAttribute: "role1,role2"] | [..role1,role3"

[MSG]The String 'role1,role2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString347

[SRC]"" | false | [configAttribute: "role1,role2"] | [..role1,role3"

[MSG]The String 'role1,role3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString347

[SRC]"" | false | [configAttribute: "role1,role2"] | [..role1,role3"

[MSG]The String 'role1,role2,role1,role3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]"/**" | true | [configAttribute: "role1,role2"] | [..role1,role3"

[MSG]The String '/**' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]"/**" | true | [configAttribute: "role1,role2"] | [..role1,role3"

[MSG]The String 'role1,role2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]"/**" | true | [configAttribute: "role1,role2"] | [..role1,role3"

[MSG]The String 'role1,role3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]"/**" | true | [configAttribute: "role1,role2"] | [..role1,role3"

[MSG]The String 'role1,role2,role1,role3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString349

[SRC]"" | false | null | [configAttribute: "r..role1,role3"

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString349

[SRC]"" | false | null | [configAttribute: "r..role1,role3"

[MSG]The String 'role1,role3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString349

[SRC]"" | false | null | [configAttribute: "r..role1,role3"

[MSG]The String 'role1,role3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString350

[SRC]"" | false | [configAttribute: null]| [configAttr..role1,role3"

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString350

[SRC]"" | false | [configAttribute: null]| [configAttr..role1,role3"

[MSG]The String 'role1,role3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString350

[SRC]"" | false | [configAttribute: null]| [configAttr..role1,role3"

[MSG]The String 'role1,role3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]"" | false | null | null | ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]"" | false | null | null | ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]"" | false | [configAttribute: "role1,role2"] | n..role1,role2"

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]"" | false | [configAttribute: "role1,role2"] | n..role1,role2"

[MSG]The String 'role1,role2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]"" | false | [configAttribute: "role1,role2"] | n..role1,role2"

[MSG]The String 'role1,role2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString353

[SRC]"" | false | [configAttribute: "role1,role2"] | [..role1,role2"

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString353

[SRC]"" | false | [configAttribute: "role1,role2"] | [..role1,role2"

[MSG]The String 'role1,role2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString353

[SRC]"" | false | [configAttribute: "role1,role2"] | [..role1,role2"

[MSG]The String 'role1,role2' can be wrapped in single quotes instead of double quotes

➥ GroupRoleSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic26

[SRC]class GroupRoleSpec extends Specification implements Dom..GroupRole> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod28

[SRC]def setup() {

[MSG]Violation in class GroupRoleSpec. The method setup is both empty and not marked with @Override

EmptyMethod211

[SRC]def cleanup() {

[MSG]Violation in class GroupRoleSpec. The method cleanup is both empty and not marked with @Override

MethodName214

[SRC]void "test equals"() {

[MSG]Violation in class GroupRoleSpec. The method name test equals in class tech.muyan.security.GroupRoleSpec does not match [a-z]\w*

ComparisonWithSelf226

[SRC]gr1.equals(gr1) == true

[MSG]Comparing an object to itself is useless and may indicate a bug: gr1.equals(gr1)

MethodName232

[SRC]void "test create group role and remove"() {

[MSG]Violation in class GroupRoleSpec. The method name test create group role and remove in class tech.muyan.security.GroupRoleSpec does not match [a-z]\w*

MethodName253

[SRC]void "test remove all by group"() {

[MSG]Violation in class GroupRoleSpec. The method name test remove all by group in class tech.muyan.security.GroupRoleSpec does not match [a-z]\w*

MethodName277

[SRC]void "test remove all by role"() {

[MSG]Violation in class GroupRoleSpec. The method name test remove all by role in class tech.muyan.security.GroupRoleSpec does not match [a-z]\w*

MethodName2101

[SRC]void "test getAuthorities"() {

[MSG]Violation in class GroupRoleSpec. The method name test getAuthorities in class tech.muyan.security.GroupRoleSpec does not match [a-z]\w*

MethodReturnTypeRequired38

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef38

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired311

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef311

[SRC]def cleanup() {

[MSG]def for method return type should not be used

NoDef316

[SRC]def r1 = new Role(id: 1, authority: "role1")

[MSG]def for declaration should not be used

VariableTypeRequired316

[SRC]def r1 = new Role(id: 1, authority: "role1")

[MSG]The type is not specified for variable "r1"

UnnecessaryGString316

[SRC]def r1 = new Role(id: 1, authority: "role1")

[MSG]The String 'role1' can be wrapped in single quotes instead of double quotes

NoDef318

[SRC]def r2 = new Role(id: 1, authority: "role2")

[MSG]def for declaration should not be used

VariableTypeRequired318

[SRC]def r2 = new Role(id: 1, authority: "role2")

[MSG]The type is not specified for variable "r2"

UnnecessaryGString318

[SRC]def r2 = new Role(id: 1, authority: "role2")

[MSG]The String 'role2' can be wrapped in single quotes instead of double quotes

NoDef320

[SRC]def g1 = new Group(id: 1, name: "group1")

[MSG]def for declaration should not be used

VariableTypeRequired320

[SRC]def g1 = new Group(id: 1, name: "group1")

[MSG]The type is not specified for variable "g1"

UnnecessaryGString320

[SRC]def g1 = new Group(id: 1, name: "group1")

[MSG]The String 'group1' can be wrapped in single quotes instead of double quotes

NoDef322

[SRC]def gr1 = new GroupRole(role: r1, group: g1)

[MSG]def for declaration should not be used

VariableTypeRequired322

[SRC]def gr1 = new GroupRole(role: r1, group: g1)

[MSG]The type is not specified for variable "gr1"

NoDef323

[SRC]def gr2 = new GroupRole(role: r2, group: g1)

[MSG]def for declaration should not be used

VariableTypeRequired323

[SRC]def gr2 = new GroupRole(role: r2, group: g1)

[MSG]The type is not specified for variable "gr2"

UnnecessaryGString329

[SRC]gr1.equals("") == false

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NoDef334

[SRC]def role = new Role(authority: "Role1")

[MSG]def for declaration should not be used

VariableTypeRequired334

[SRC]def role = new Role(authority: "Role1")

[MSG]The type is not specified for variable "role"

UnnecessaryGString334

[SRC]def role = new Role(authority: "Role1")

[MSG]The String 'Role1' can be wrapped in single quotes instead of double quotes

NoDef336

[SRC]def group = new Group(name: "Group1")

[MSG]def for declaration should not be used

VariableTypeRequired336

[SRC]def group = new Group(name: "Group1")

[MSG]The type is not specified for variable "group"

UnnecessaryGString336

[SRC]def group = new Group(name: "Group1")

[MSG]The String 'Group1' can be wrapped in single quotes instead of double quotes

NoDef345

[SRC]def success = GroupRole.remove(group, role)

[MSG]def for declaration should not be used

VariableTypeRequired345

[SRC]def success = GroupRole.remove(group, role)

[MSG]The type is not specified for variable "success"

NoDef355

[SRC]def role1 = new Role(authority: "Role1")

[MSG]def for declaration should not be used

VariableTypeRequired355

[SRC]def role1 = new Role(authority: "Role1")

[MSG]The type is not specified for variable "role1"

UnnecessaryGString355

[SRC]def role1 = new Role(authority: "Role1")

[MSG]The String 'Role1' can be wrapped in single quotes instead of double quotes

NoDef357

[SRC]def role2 = new Role(authority: "Role1")

[MSG]def for declaration should not be used

VariableTypeRequired357

[SRC]def role2 = new Role(authority: "Role1")

[MSG]The type is not specified for variable "role2"

UnnecessaryGString357

[SRC]def role2 = new Role(authority: "Role1")

[MSG]The String 'Role1' can be wrapped in single quotes instead of double quotes

NoDef360

[SRC]def group = new Group(name: "Group1")

[MSG]def for declaration should not be used

VariableTypeRequired360

[SRC]def group = new Group(name: "Group1")

[MSG]The type is not specified for variable "group"

UnnecessaryGString360

[SRC]def group = new Group(name: "Group1")

[MSG]The String 'Group1' can be wrapped in single quotes instead of double quotes

NoDef370

[SRC]def removed = GroupRole.removeAll(group)

[MSG]def for declaration should not be used

VariableTypeRequired370

[SRC]def removed = GroupRole.removeAll(group)

[MSG]The type is not specified for variable "removed"

NoDef379

[SRC]def role = new Role(authority: "Role1")

[MSG]def for declaration should not be used

VariableTypeRequired379

[SRC]def role = new Role(authority: "Role1")

[MSG]The type is not specified for variable "role"

UnnecessaryGString379

[SRC]def role = new Role(authority: "Role1")

[MSG]The String 'Role1' can be wrapped in single quotes instead of double quotes

NoDef382

[SRC]def group1 = new Group(name: "Group1")

[MSG]def for declaration should not be used

VariableTypeRequired382

[SRC]def group1 = new Group(name: "Group1")

[MSG]The type is not specified for variable "group1"

UnnecessaryGString382

[SRC]def group1 = new Group(name: "Group1")

[MSG]The String 'Group1' can be wrapped in single quotes instead of double quotes

NoDef384

[SRC]def group2 = new Group(name: "Group2")

[MSG]def for declaration should not be used

VariableTypeRequired384

[SRC]def group2 = new Group(name: "Group2")

[MSG]The type is not specified for variable "group2"

UnnecessaryGString384

[SRC]def group2 = new Group(name: "Group2")

[MSG]The String 'Group2' can be wrapped in single quotes instead of double quotes

NoDef394

[SRC]def removed = GroupRole.removeAll(role)

[MSG]def for declaration should not be used

VariableTypeRequired394

[SRC]def removed = GroupRole.removeAll(role)

[MSG]The type is not specified for variable "removed"

NoDef3103

[SRC]def g1 = new Group(name: "group")

[MSG]def for declaration should not be used

VariableTypeRequired3103

[SRC]def g1 = new Group(name: "group")

[MSG]The type is not specified for variable "g1"

UnnecessaryGString3103

[SRC]def g1 = new Group(name: "group")

[MSG]The String 'group' can be wrapped in single quotes instead of double quotes

NoDef3106

[SRC]def r1 = new Role(authority: "role1")

[MSG]def for declaration should not be used

VariableTypeRequired3106

[SRC]def r1 = new Role(authority: "role1")

[MSG]The type is not specified for variable "r1"

UnnecessaryGString3106

[SRC]def r1 = new Role(authority: "role1")

[MSG]The String 'role1' can be wrapped in single quotes instead of double quotes

NoDef3107

[SRC]def r2 = new Role(authority: "role2")

[MSG]def for declaration should not be used

VariableTypeRequired3107

[SRC]def r2 = new Role(authority: "role2")

[MSG]The type is not specified for variable "r2"

UnnecessaryGString3107

[SRC]def r2 = new Role(authority: "role2")

[MSG]The String 'role2' can be wrapped in single quotes instead of double quotes

NoDef3108

[SRC]def r3 = new Role(authority: "role3")

[MSG]def for declaration should not be used

VariableTypeRequired3108

[SRC]def r3 = new Role(authority: "role3")

[MSG]The type is not specified for variable "r3"

UnnecessaryGString3108

[SRC]def r3 = new Role(authority: "role3")

[MSG]The String 'role3' can be wrapped in single quotes instead of double quotes

NoDef3113

[SRC]def gr1 = new GroupRole(group: g1, role: r1)

[MSG]def for declaration should not be used

VariableTypeRequired3113

[SRC]def gr1 = new GroupRole(group: g1, role: r1)

[MSG]The type is not specified for variable "gr1"

NoDef3114

[SRC]def gr2 = new GroupRole(group: g1, role: r2)

[MSG]def for declaration should not be used

VariableTypeRequired3114

[SRC]def gr2 = new GroupRole(group: g1, role: r2)

[MSG]The type is not specified for variable "gr2"

NoDef3115

[SRC]def gr3 = new GroupRole(group: g1, role: r3)

[MSG]def for declaration should not be used

VariableTypeRequired3115

[SRC]def gr3 = new GroupRole(group: g1, role: r3)

[MSG]The type is not specified for variable "gr3"

NoDef3122

[SRC]def roles = Group.findByName("group").getAuthorities()

[MSG]def for declaration should not be used

VariableTypeRequired3122

[SRC]def roles = Group.findByName("group").getAuthorities()

[MSG]The type is not specified for variable "roles"

UnnecessaryGetter3122

[SRC]def roles = Group.findByName("group").getAuthorities()

[MSG]getAuthorities() can probably be rewritten as authorities

UnnecessaryGString3122

[SRC]def roles = Group.findByName("group").getAuthorities()

[MSG]The String 'group' can be wrapped in single quotes instead of double quotes

➥ RequestMapSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class RequestMapSpec extends Specification implements Do..equestMap> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod212

[SRC]def setup() {

[MSG]Violation in class RequestMapSpec. The method setup is both empty and not marked with @Override

EmptyMethod215

[SRC]def cleanup() {

[MSG]Violation in class RequestMapSpec. The method cleanup is both empty and not marked with @Override

MethodName218

[SRC]def "test render"(){

[MSG]Violation in class RequestMapSpec. The method name test render in class tech.muyan.security.RequestMapSpec does not match [a-z]\w*

UnusedVariable221

[SRC]Role r1 = Mock(Role.class)

[MSG]The variable [r1] in class tech.muyan.security.RequestMapSpec is not used

MethodName238

[SRC]def "test after create/update hook"() {

[MSG]Violation in class RequestMapSpec. The method name test after create/update hook in class tech.muyan.security.RequestMapSpec does not match [a-z]\w*

UnnecessarySemicolon31

[SRC]package tech.muyan.security;

[MSG]Semicolons as line endings can be removed safely

MethodReturnTypeRequired312

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef312

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired315

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef315

[SRC]def cleanup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired318

[SRC]def "test render"(){

[MSG]Method "test render" has a dynamic return type

UnnecessaryDotClass321

[SRC]Role r1 = Mock(Role.class)

[MSG]Role.class can be rewritten as Role

UnnecessaryGString322

[SRC]1 * Role.findByAuthority("role1") >> [id: 2]

[MSG]The String 'role1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString323

[SRC]RequestMap rm = new RequestMap(configAttribute: "role1",.. url: "url")

[MSG]The String 'role1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString323

[SRC]RequestMap rm = new RequestMap(configAttribute: "role1",.. url: "url")

[MSG]The String 'url' can be wrapped in single quotes instead of double quotes

VariableTypeRequired327

[SRC]def result = rm.render()

[MSG]The type is not specified for variable "result"

UnnecessaryGString331

[SRC]result.url == "url"

[MSG]The String 'url' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired338

[SRC]def "test after create/update hook"() {

[MSG]Method "test after create/update hook" has a dynamic return type

VariableTypeRequired340

[SRC]def sss = Mock(SpringSecurityService.class)

[MSG]The type is not specified for variable "sss"

UnnecessaryDotClass340

[SRC]def sss = Mock(SpringSecurityService.class)

[MSG]SpringSecurityService.class can be rewritten as SpringSecurityService

UnnecessaryGString341

[SRC]RequestMap rm = new RequestMap(configAttribute: "role1",.. url: "url")

[MSG]The String 'role1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString341

[SRC]RequestMap rm = new RequestMap(configAttribute: "role1",.. url: "url")

[MSG]The String 'url' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]rm.configAttribute = "role1,role2"

[MSG]The String 'role1,role2' can be wrapped in single quotes instead of double quotes

➥ RoleSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic26

[SRC]class RoleSpec extends Specification implements DomainUnitTest<Role> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

MethodName28

[SRC]void "test create new Role"() {

[MSG]Violation in class RoleSpec. The method name test create new Role in class tech.muyan.security.RoleSpec does not match [a-z]\w*

NoDef310

[SRC]def r1 = new Role(authority: "role1")

[MSG]def for declaration should not be used

VariableTypeRequired310

[SRC]def r1 = new Role(authority: "role1")

[MSG]The type is not specified for variable "r1"

UnnecessaryGString310

[SRC]def r1 = new Role(authority: "role1")

[MSG]The String 'role1' can be wrapped in single quotes instead of double quotes

NoDef314

[SRC]def role = Role.findByAuthority("role1")

[MSG]def for declaration should not be used

VariableTypeRequired314

[SRC]def role = Role.findByAuthority("role1")

[MSG]The type is not specified for variable "role"

UnnecessaryGString314

[SRC]def role = Role.findByAuthority("role1")

[MSG]The String 'role1' can be wrapped in single quotes instead of double quotes

➥ UserGroupSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class UserGroupSpec extends Specification implements Dom..UserGroup> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod212

[SRC]def setup() {

[MSG]Violation in class UserGroupSpec. The method setup is both empty and not marked with @Override

MethodName222

[SRC]void "test equals"() {

[MSG]Violation in class UserGroupSpec. The method name test equals in class tech.muyan.security.UserGroupSpec does not match [a-z]\w*

ComparisonWithSelf244

[SRC]ug1.equals(ug1) == true

[MSG]Comparing an object to itself is useless and may indicate a bug: ug1.equals(ug1)

MethodName250

[SRC]void "test create user group and remove"() {

[MSG]Violation in class UserGroupSpec. The method name test create user group and remove in class tech.muyan.security.UserGroupSpec does not match [a-z]\w*

MethodName281

[SRC]void "test remove all by user"() {

[MSG]Violation in class UserGroupSpec. The method name test remove all by user in class tech.muyan.security.UserGroupSpec does not match [a-z]\w*

MethodName2112

[SRC]void "test remove all by group"() {

[MSG]Violation in class UserGroupSpec. The method name test remove all by group in class tech.muyan.security.UserGroupSpec does not match [a-z]\w*

ImportFromSamePackage36

[SRC]import tech.muyan.security.User

ImportFromSamePackage37

[SRC]import tech.muyan.security.Group

ImportFromSamePackage38

[SRC]import tech.muyan.security.UserGroup

MethodReturnTypeRequired312

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef312

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired315

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef315

[SRC]def cleanup() {

[MSG]def for method return type should not be used

UnnecessaryGetter316

[SRC]UserGroup.deleteAll(UserGroup.getAll())

[MSG]getAll() can probably be rewritten as all

UnnecessaryGetter317

[SRC]Group.deleteAll(Group.getAll())

[MSG]getAll() can probably be rewritten as all

UnnecessaryGetter318

[SRC]User.deleteAll(User.getAll())

[MSG]getAll() can probably be rewritten as all

UnnecessaryGetter319

[SRC]Organization.deleteAll(Organization.getAll())

[MSG]getAll() can probably be rewritten as all

NoDef324

[SRC]def g1 = new Group(name: "group1")

[MSG]def for declaration should not be used

VariableTypeRequired324

[SRC]def g1 = new Group(name: "group1")

[MSG]The type is not specified for variable "g1"

UnnecessaryGString324

[SRC]def g1 = new Group(name: "group1")

[MSG]The String 'group1' can be wrapped in single quotes instead of double quotes

NoDef327

[SRC]def g2 = new Group(name: "group2")

[MSG]def for declaration should not be used

VariableTypeRequired327

[SRC]def g2 = new Group(name: "group2")

[MSG]The type is not specified for variable "g2"

UnnecessaryGString327

[SRC]def g2 = new Group(name: "group2")

[MSG]The String 'group2' can be wrapped in single quotes instead of double quotes

NoDef330

[SRC]def org = new Organization(name: "Test Organization")

[MSG]def for declaration should not be used

VariableTypeRequired330

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The type is not specified for variable "org"

UnnecessaryGString330

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The String 'Test Organization' can be wrapped in single quotes instead of double quotes

NoDef333

[SRC]def u1 = new User(

[MSG]def for declaration should not be used

VariableTypeRequired333

[SRC]def u1 = new User(

[MSG]The type is not specified for variable "u1"

UnnecessaryGString334

[SRC]username: "user1", password: "password",

[MSG]The String 'user1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString334

[SRC]username: "user1", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef340

[SRC]def ug1 = new UserGroup(group: g1, user: u1)

[MSG]def for declaration should not be used

VariableTypeRequired340

[SRC]def ug1 = new UserGroup(group: g1, user: u1)

[MSG]The type is not specified for variable "ug1"

NoDef341

[SRC]def ug2 = new UserGroup(group: g2, user: u1)

[MSG]def for declaration should not be used

VariableTypeRequired341

[SRC]def ug2 = new UserGroup(group: g2, user: u1)

[MSG]The type is not specified for variable "ug2"

UnnecessaryGString347

[SRC]ug1.equals("") == false

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NoDef353

[SRC]def group = new Group(name: "Group1")

[MSG]def for declaration should not be used

VariableTypeRequired353

[SRC]def group = new Group(name: "Group1")

[MSG]The type is not specified for variable "group"

UnnecessaryGString353

[SRC]def group = new Group(name: "Group1")

[MSG]The String 'Group1' can be wrapped in single quotes instead of double quotes

NoDef356

[SRC]def org = new Organization(name: "Test Organization")

[MSG]def for declaration should not be used

VariableTypeRequired356

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The type is not specified for variable "org"

UnnecessaryGString356

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The String 'Test Organization' can be wrapped in single quotes instead of double quotes

NoDef359

[SRC]def user = new User(

[MSG]def for declaration should not be used

VariableTypeRequired359

[SRC]def user = new User(

[MSG]The type is not specified for variable "user"

UnnecessaryGString360

[SRC]username: "user2", password: "password",

[MSG]The String 'user2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString360

[SRC]username: "user2", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef373

[SRC]def success = UserGroup.remove(user, group)

[MSG]def for declaration should not be used

VariableTypeRequired373

[SRC]def success = UserGroup.remove(user, group)

[MSG]The type is not specified for variable "success"

NoDef383

[SRC]def org = new Organization(name: "Test Organization")

[MSG]def for declaration should not be used

VariableTypeRequired383

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The type is not specified for variable "org"

UnnecessaryGString383

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The String 'Test Organization' can be wrapped in single quotes instead of double quotes

NoDef386

[SRC]def group1 = new Group(name: "Group1")

[MSG]def for declaration should not be used

VariableTypeRequired386

[SRC]def group1 = new Group(name: "Group1")

[MSG]The type is not specified for variable "group1"

UnnecessaryGString386

[SRC]def group1 = new Group(name: "Group1")

[MSG]The String 'Group1' can be wrapped in single quotes instead of double quotes

NoDef388

[SRC]def group2 = new Group(name: "Group2")

[MSG]def for declaration should not be used

VariableTypeRequired388

[SRC]def group2 = new Group(name: "Group2")

[MSG]The type is not specified for variable "group2"

UnnecessaryGString388

[SRC]def group2 = new Group(name: "Group2")

[MSG]The String 'Group2' can be wrapped in single quotes instead of double quotes

NoDef391

[SRC]def user = new User(

[MSG]def for declaration should not be used

VariableTypeRequired391

[SRC]def user = new User(

[MSG]The type is not specified for variable "user"

UnnecessaryGString392

[SRC]username: "user3", password: "password",

[MSG]The String 'user3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString392

[SRC]username: "user3", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef3105

[SRC]def removed = UserGroup.removeAll(user)

[MSG]def for declaration should not be used

VariableTypeRequired3105

[SRC]def removed = UserGroup.removeAll(user)

[MSG]The type is not specified for variable "removed"

NoDef3114

[SRC]def org = new Organization(name: "Test Organization")

[MSG]def for declaration should not be used

VariableTypeRequired3114

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The type is not specified for variable "org"

UnnecessaryGString3114

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The String 'Test Organization' can be wrapped in single quotes instead of double quotes

NoDef3117

[SRC]def group = new Group(name: "Group1")

[MSG]def for declaration should not be used

VariableTypeRequired3117

[SRC]def group = new Group(name: "Group1")

[MSG]The type is not specified for variable "group"

UnnecessaryGString3117

[SRC]def group = new Group(name: "Group1")

[MSG]The String 'Group1' can be wrapped in single quotes instead of double quotes

NoDef3120

[SRC]def user1 = new User(

[MSG]def for declaration should not be used

VariableTypeRequired3120

[SRC]def user1 = new User(

[MSG]The type is not specified for variable "user1"

UnnecessaryGString3121

[SRC]username: "user4", password: "password",

[MSG]The String 'user4' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3121

[SRC]username: "user4", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef3127

[SRC]def user2 = new User(

[MSG]def for declaration should not be used

VariableTypeRequired3127

[SRC]def user2 = new User(

[MSG]The type is not specified for variable "user2"

UnnecessaryGString3128

[SRC]username: "user5", password: "password",

[MSG]The String 'user5' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3128

[SRC]username: "user5", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef3141

[SRC]def removed = UserGroup.removeAll(group)

[MSG]def for declaration should not be used

VariableTypeRequired3141

[SRC]def removed = UserGroup.removeAll(group)

[MSG]The type is not specified for variable "removed"

➥ UserRoleSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic27

[SRC]class UserRoleSpec extends Specification implements Doma..<UserRole> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod29

[SRC]def setup() {

[MSG]Violation in class UserRoleSpec. The method setup is both empty and not marked with @Override

MethodName219

[SRC]void "test equals"() {

[MSG]Violation in class UserRoleSpec. The method name test equals in class tech.muyan.security.UserRoleSpec does not match [a-z]\w*

ComparisonWithSelf241

[SRC]ur1.equals(ur1) == true

[MSG]Comparing an object to itself is useless and may indicate a bug: ur1.equals(ur1)

MethodName247

[SRC]void "test create user role and remove"() {

[MSG]Violation in class UserRoleSpec. The method name test create user role and remove in class tech.muyan.security.UserRoleSpec does not match [a-z]\w*

MethodName278

[SRC]void "test remove all by user"() {

[MSG]Violation in class UserRoleSpec. The method name test remove all by user in class tech.muyan.security.UserRoleSpec does not match [a-z]\w*

MethodName2109

[SRC]void "test remove all by role"() {

[MSG]Violation in class UserRoleSpec. The method name test remove all by role in class tech.muyan.security.UserRoleSpec does not match [a-z]\w*

MethodReturnTypeRequired39

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef39

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired312

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef312

[SRC]def cleanup() {

[MSG]def for method return type should not be used

UnnecessaryGetter313

[SRC]UserRole.deleteAll(UserRole.getAll())

[MSG]getAll() can probably be rewritten as all

UnnecessaryGetter314

[SRC]Role.deleteAll(Role.getAll())

[MSG]getAll() can probably be rewritten as all

UnnecessaryGetter315

[SRC]User.deleteAll(User.getAll())

[MSG]getAll() can probably be rewritten as all

UnnecessaryGetter316

[SRC]Organization.deleteAll(Organization.getAll())

[MSG]getAll() can probably be rewritten as all

NoDef321

[SRC]def r1 = new Role(authority: "role1")

[MSG]def for declaration should not be used

VariableTypeRequired321

[SRC]def r1 = new Role(authority: "role1")

[MSG]The type is not specified for variable "r1"

UnnecessaryGString321

[SRC]def r1 = new Role(authority: "role1")

[MSG]The String 'role1' can be wrapped in single quotes instead of double quotes

NoDef324

[SRC]def r2 = new Role(authority: "role2")

[MSG]def for declaration should not be used

VariableTypeRequired324

[SRC]def r2 = new Role(authority: "role2")

[MSG]The type is not specified for variable "r2"

UnnecessaryGString324

[SRC]def r2 = new Role(authority: "role2")

[MSG]The String 'role2' can be wrapped in single quotes instead of double quotes

NoDef327

[SRC]def org = new Organization(name: "Test Organization")

[MSG]def for declaration should not be used

VariableTypeRequired327

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The type is not specified for variable "org"

UnnecessaryGString327

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The String 'Test Organization' can be wrapped in single quotes instead of double quotes

NoDef330

[SRC]def u1 = new User(

[MSG]def for declaration should not be used

VariableTypeRequired330

[SRC]def u1 = new User(

[MSG]The type is not specified for variable "u1"

UnnecessaryGString331

[SRC]username: "user1", password: "password",

[MSG]The String 'user1' can be wrapped in single quotes instead of double quotes

UnnecessaryGString331

[SRC]username: "user1", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef337

[SRC]def ur1 = new UserRole(role: r1, user: u1)

[MSG]def for declaration should not be used

VariableTypeRequired337

[SRC]def ur1 = new UserRole(role: r1, user: u1)

[MSG]The type is not specified for variable "ur1"

NoDef338

[SRC]def ur2 = new UserRole(role: r2, user: u1)

[MSG]def for declaration should not be used

VariableTypeRequired338

[SRC]def ur2 = new UserRole(role: r2, user: u1)

[MSG]The type is not specified for variable "ur2"

UnnecessaryGString344

[SRC]ur1.equals("") == false

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NoDef350

[SRC]def role = new Role(authority: "Role1")

[MSG]def for declaration should not be used

VariableTypeRequired350

[SRC]def role = new Role(authority: "Role1")

[MSG]The type is not specified for variable "role"

UnnecessaryGString350

[SRC]def role = new Role(authority: "Role1")

[MSG]The String 'Role1' can be wrapped in single quotes instead of double quotes

NoDef353

[SRC]def org = new Organization(name: "Test Organization")

[MSG]def for declaration should not be used

VariableTypeRequired353

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The type is not specified for variable "org"

UnnecessaryGString353

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The String 'Test Organization' can be wrapped in single quotes instead of double quotes

NoDef356

[SRC]def user = new User(

[MSG]def for declaration should not be used

VariableTypeRequired356

[SRC]def user = new User(

[MSG]The type is not specified for variable "user"

UnnecessaryGString357

[SRC]username: "user2", password: "password",

[MSG]The String 'user2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString357

[SRC]username: "user2", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef370

[SRC]def success = UserRole.remove(user, role)

[MSG]def for declaration should not be used

VariableTypeRequired370

[SRC]def success = UserRole.remove(user, role)

[MSG]The type is not specified for variable "success"

NoDef380

[SRC]def org = new Organization(name: "Test Organization")

[MSG]def for declaration should not be used

VariableTypeRequired380

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The type is not specified for variable "org"

UnnecessaryGString380

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The String 'Test Organization' can be wrapped in single quotes instead of double quotes

NoDef383

[SRC]def role1 = new Role(authority: "Role1")

[MSG]def for declaration should not be used

VariableTypeRequired383

[SRC]def role1 = new Role(authority: "Role1")

[MSG]The type is not specified for variable "role1"

UnnecessaryGString383

[SRC]def role1 = new Role(authority: "Role1")

[MSG]The String 'Role1' can be wrapped in single quotes instead of double quotes

NoDef385

[SRC]def role2 = new Role(authority: "Role2")

[MSG]def for declaration should not be used

VariableTypeRequired385

[SRC]def role2 = new Role(authority: "Role2")

[MSG]The type is not specified for variable "role2"

UnnecessaryGString385

[SRC]def role2 = new Role(authority: "Role2")

[MSG]The String 'Role2' can be wrapped in single quotes instead of double quotes

NoDef388

[SRC]def user = new User(

[MSG]def for declaration should not be used

VariableTypeRequired388

[SRC]def user = new User(

[MSG]The type is not specified for variable "user"

UnnecessaryGString389

[SRC]username: "user3", password: "password",

[MSG]The String 'user3' can be wrapped in single quotes instead of double quotes

UnnecessaryGString389

[SRC]username: "user3", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef3102

[SRC]def removed = UserRole.removeAll(user)

[MSG]def for declaration should not be used

VariableTypeRequired3102

[SRC]def removed = UserRole.removeAll(user)

[MSG]The type is not specified for variable "removed"

NoDef3111

[SRC]def org = new Organization(name: "Test Organization")

[MSG]def for declaration should not be used

VariableTypeRequired3111

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The type is not specified for variable "org"

UnnecessaryGString3111

[SRC]def org = new Organization(name: "Test Organization")

[MSG]The String 'Test Organization' can be wrapped in single quotes instead of double quotes

NoDef3114

[SRC]def role = new Role(authority: "Role1")

[MSG]def for declaration should not be used

VariableTypeRequired3114

[SRC]def role = new Role(authority: "Role1")

[MSG]The type is not specified for variable "role"

UnnecessaryGString3114

[SRC]def role = new Role(authority: "Role1")

[MSG]The String 'Role1' can be wrapped in single quotes instead of double quotes

NoDef3117

[SRC]def user1 = new User(

[MSG]def for declaration should not be used

VariableTypeRequired3117

[SRC]def user1 = new User(

[MSG]The type is not specified for variable "user1"

UnnecessaryGString3118

[SRC]username: "user4", password: "password",

[MSG]The String 'user4' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3118

[SRC]username: "user4", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef3124

[SRC]def user2 = new User(

[MSG]def for declaration should not be used

VariableTypeRequired3124

[SRC]def user2 = new User(

[MSG]The type is not specified for variable "user2"

UnnecessaryGString3125

[SRC]username: "user5", password: "password",

[MSG]The String 'user5' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3125

[SRC]username: "user5", password: "password",

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

NoDef3138

[SRC]def removed = UserRole.removeAll(role)

[MSG]def for declaration should not be used

VariableTypeRequired3138

[SRC]def removed = UserRole.removeAll(role)

[MSG]The type is not specified for variable "removed"

➥ UserSpec.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic211

[SRC]class UserSpec extends Specification implements DomainUn..UserGroup> {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

EmptyMethod213

[SRC]def setup() {

[MSG]Violation in class UserSpec. The method setup is both empty and not marked with @Override

EmptyMethod216

[SRC]def cleanup() {

[MSG]Violation in class UserSpec. The method cleanup is both empty and not marked with @Override

FactoryMethodName219

[SRC]def "create user with username and password"() {

[MSG]Violation in class UserSpec. The method 'create user with username and password' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/

MethodName219

[SRC]def "create user with username and password"() {

[MSG]Violation in class UserSpec. The method name create user with username and password in class tech.muyan.security.UserSpec does not match [a-z]\w*

MethodName228

[SRC]def "test before insert"() {

[MSG]Violation in class UserSpec. The method name test before insert in class tech.muyan.security.UserSpec does not match [a-z]\w*

MethodName249

[SRC]def "test render user"() {

[MSG]Violation in class UserSpec. The method name test render user in class tech.muyan.security.UserSpec does not match [a-z]\w*

UnnecessarySemicolon31

[SRC]package tech.muyan.security;

[MSG]Semicolons as line endings can be removed safely

UnnecessaryGroovyImport36

[SRC]import java.util.Arrays;

UnusedImport36

[SRC]import java.util.Arrays;

[MSG]The [java.util.Arrays] import is never referenced

UnnecessarySemicolon36

[SRC]import java.util.Arrays;

[MSG]Semicolons as line endings can be removed safely

MethodReturnTypeRequired313

[SRC]def setup() {

[MSG]Method "setup" has a dynamic return type

NoDef313

[SRC]def setup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired316

[SRC]def cleanup() {

[MSG]Method "cleanup" has a dynamic return type

NoDef316

[SRC]def cleanup() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired319

[SRC]def "create user with username and password"() {

[MSG]Method "create user with username and password" has a dynamic return type

UnnecessaryGString321

[SRC]User u = new User("username", "password")

[MSG]The String 'username' can be wrapped in single quotes instead of double quotes

UnnecessaryGString321

[SRC]User u = new User("username", "password")

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

UnnecessaryGString324

[SRC]u.username == "username"

[MSG]The String 'username' can be wrapped in single quotes instead of double quotes

UnnecessaryGString325

[SRC]u.password == "password"

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired328

[SRC]def "test before insert"() {

[MSG]Method "test before insert" has a dynamic return type

UnnecessaryGString330

[SRC]User u = new User("username", "password")

[MSG]The String 'username' can be wrapped in single quotes instead of double quotes

UnnecessaryGString330

[SRC]User u = new User("username", "password")

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

UnnecessaryGString334

[SRC]u.username == "username"

[MSG]The String 'username' can be wrapped in single quotes instead of double quotes

UnnecessaryGString335

[SRC]u.password == "password"

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

UnnecessaryGString340

[SRC]User u2 = new User("username2", "password")

[MSG]The String 'username2' can be wrapped in single quotes instead of double quotes

UnnecessaryGString340

[SRC]User u2 = new User("username2", "password")

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

VariableTypeRequired342

[SRC]def userGroups = u2.getAuthorities()

[MSG]The type is not specified for variable "userGroups"

UnnecessaryGetter342

[SRC]def userGroups = u2.getAuthorities()

[MSG]getAuthorities() can probably be rewritten as authorities

MethodReturnTypeRequired349

[SRC]def "test render user"() {

[MSG]Method "test render user" has a dynamic return type

UnnecessaryGString351

[SRC]User u = new User("username_render", "password")

[MSG]The String 'username_render' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]User u = new User("username_render", "password")

[MSG]The String 'password' can be wrapped in single quotes instead of double quotes

VariableTypeRequired353

[SRC]def result = u.render()

[MSG]The type is not specified for variable "result"

UnnecessaryGString362

[SRC]result.username == "username_render"

[MSG]The String 'username_render' can be wrapped in single quotes instead of double quotes

UnnecessaryObjectReferences362

[SRC]result.username == "username_render"

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

UnnecessaryGString363

[SRC]result.password == ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryObjectReferences363

[SRC]result.password == ""

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

Rule Descriptions

#Rule NameDescription
1AbstractClassNameVerifies that the name of an abstract class matches a regular expression specified in the regex property. If that property is null or empty, then this rule is not applied (i.e., it does nothing). It defaults to null, so this rule must be explicitly configured to be active. This rule ignores interfaces.
2AbstractClassWithPublicConstructorChecks for abstract classes that define a public constructor, which is useless and confusing.
3AbstractClassWithoutAbstractMethodThe abstract class does not contain any abstract methods. An abstract class suggests an incomplete implementation, which is to be completed by subclasses implementing the abstract methods. If the class is intended to be used as a base class only (not to be instantiated direcly) a protected constructor can be provided prevent direct instantiation.
4AddEmptyStringFinds empty string literals which are being added. This is an inefficient way to convert any type to a String.
5AssertWithinFinallyBlockChecks for assert statements within a finally block. An assert can throw an exception, hiding the original exception, if there is one.
6AssignmentInConditionalAn assignment operator (=) was used in a conditional test. This is usually a typo, and the comparison operator (==) was intended.
7AssignmentToStaticFieldFromInstanceMethodChecks for assignment to a static field from an instance method.
8BigDecimalInstantiationChecks for calls to the BigDecimal constructors that take a double parameter, which may result in an unexpected BigDecimal value.
9BitwiseOperatorInConditionalChecks for bitwise operations in conditionals, if you need to do a bitwise operation then it is best practice to extract a temp variable.
10BooleanGetBooleanThis 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'].
11BooleanMethodReturnsNullMethod 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.
12BrokenNullCheckLooks for faulty checks for null that can cause a NullPointerException.
13BrokenOddnessCheckThe 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.
14BuilderMethodWithSideEffectsA builder method is defined as one that creates objects. As such, they should never be of void return type. If a method is named build, create, or make, then it should always return a value.
15CatchArrayIndexOutOfBoundsExceptionCheck the size of the array before accessing an array element rather than catching ArrayIndexOutOfBoundsException.
16CatchErrorCatching Error is dangerous; it can catch exceptions such as ThreadDeath and OutOfMemoryError.
17CatchExceptionCatching Exception is often too broad or general. It should usually be restricted to framework or infrastructure code, rather than application code.
18CatchIllegalMonitorStateExceptionDubious catching of IllegalMonitorStateException. IllegalMonitorStateException is generally only thrown in case of a design flaw in your code (calling wait or notify on an object you do not hold a lock on).
19CatchIndexOutOfBoundsExceptionCheck that an index is valid before accessing an indexed element rather than catching IndexOutOfBoundsException.
20CatchNullPointerExceptionCatching NullPointerException is never appropriate. It should be avoided in the first place with proper null checking, and it can mask underlying errors.
21CatchRuntimeExceptionCatching RuntimeException is often too broad or general. It should usually be restricted to framework or infrastructure code, rather than application code.
22CatchThrowableCatching Throwable is dangerous; it can catch exceptions such as ThreadDeath and OutOfMemoryError.
23ClassForNameUsing Class.forName(...) is a common way to add dynamic behavior to a system. However, using this method can cause resource leaks because the classes can be pinned in memory for long periods of time.
24ClassNameVerifies that the name of a class matches a regular expression. By default it checks that the class name starts with an uppercase letter and is followed by zero or more word characters (letters, numbers or underscores). The regex property specifies the regular expression used to validate the class name.
25ClassNameSameAsFilenameReports files containing only one top level class / enum / interface which is named differently than the file.
26ClassNameSameAsSuperclassChecks for any class that has an identical name to its superclass, other than the package. This can be very confusing.
27CloneableWithoutCloneA class that implements java.lang.Cloneable should define a clone() method.
28CloseWithoutCloseableIf a class defines a "void close()" then that class should implement java.io.Closeable or java.lang.AutoCloseable.
29CompareToWithoutComparableIf 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.
30ComparisonOfTwoConstantsChecks for expressions where a comparison operator or equals() or compareTo() is used to compare two constants to each other or two literals that contain only constant values., e.g.: 23 == 67, Boolean.FALSE != false, 0.17 <= 0.99, "abc" > "ddd", [a:1] <=> [a:2], [1,2].equals([3,4]) or [a:false, b:true].compareTo(['a':34.5, b:Boolean.TRUE].
31ComparisonWithSelfChecks for expressions where a comparison operator or equals() or compareTo() is used to compare a variable to itself, e.g.: x == x, x != x, x <=> x, x < x, x =>= x, x.equals(x) or x.compareTo(x), where x is a variable.
32CompileStaticCheck that classes are explicitely annotated with either @GrailsCompileStatic, @CompileStatic or @CompileDynamic
33ConfusingClassNamedExceptionThis class is not derived from another exception, but ends with 'Exception'. This will be confusing to users of this class.
34ConfusingMethodNameChecks for confusing method names. The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other.
35ConfusingTernaryIn 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?".
36ConsecutiveLiteralAppendsViolations occur when method calls to append(Object) are chained together with literals as parameters. The chained calls can be joined into one invocation.
37ConsecutiveStringConcatenationCatches concatenation of two string literals on the same line. These can safely by joined.
38ConstantAssertExpressionChecks for assert statements where the assert boolean condition expression is a constant or literal value.
39ConstantIfExpressionChecks for if statements with a constant value for the if expression, such as true, false, null, or a literal constant value.
40ConstantTernaryExpressionChecks for ternary expressions with a constant value for the boolean expression, such as true, false, null, or a literal constant value.
41ConstantsOnlyInterfaceAn interface should be used only to model a behaviour of a class: using an interface as a container of constants is a poor usage pattern.
42CouldBeElvisCatch an if block that could be written as an elvis expression.
43CouldBeSwitchStatementChecks for multiple if statements that could be converted to a switch
44DeadCodeDead 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.
45DoubleNegativeThere 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.
46DuplicateCaseStatementCheck for duplicate case statements in a switch block, such as two equal integers or strings.
47DuplicateImportDuplicate import statements are unnecessary.
48DuplicateListLiteralCode containing duplicate List literals can usually be improved by declaring the List as a constant field.
49DuplicateMapKeyA map literal is created with duplicated key. The map entry will be overwritten.
50DuplicateMapLiteralCode containing duplicate Map literals can usually be improved by declaring the Map as a constant field.
51DuplicateNumberLiteralCode containing number String literals can usually be improved by declaring the number as a constant field. The ignoreNumbers property (0,1) can optionally specify a comma-separated list of numbers to ignore.
52DuplicateSetValueA Set literal is created with duplicate constant value. A set cannot contain two elements with the same value.
53DuplicateStringLiteralCode containing duplicate String literals can usually be improved by declaring the String as a constant field. The ignoreStrings property () can optionally specify a comma-separated list of Strings to ignore.
54ElseBlockBracesUse braces for else blocks, even for a single statement. By default, braces are not required for an else if it is followed immediately by an if. Set the bracesRequiredForElseIf property to true to require braces is that situation as well.
55EmptyCatchBlockIn most cases, exceptions should not be caught and ignored (swallowed).
56EmptyClassReports classes without methods, fields or properties. Why would you need a class like this?
57EmptyElseBlockEmpty else blocks are confusing and serve no purpose.
58EmptyFinallyBlockEmpty finally blocks are confusing and serve no purpose.
59EmptyForStatementEmpty for statements are confusing and serve no purpose.
60EmptyIfStatementEmpty if statements are confusing and serve no purpose.
61EmptyInstanceInitializerAn empty class instance initializer was found. It is safe to remove it.
62EmptyMethodA method was found without an implementation. If the method is overriding or implementing a parent method, then mark it with the @Override annotation.
63EmptyMethodInAbstractClassAn empty method in an abstract class should be abstract instead, as developer may rely on this empty implementation rather than code the appropriate one.
64EmptyStaticInitializerAn empty static initializer was found. It is safe to remove it.
65EmptySwitchStatementEmpty switch statements are confusing and serve no purpose.
66EmptySynchronizedStatementEmpty synchronized statements are confusing and serve no purpose.
67EmptyTryBlockEmpty try blocks are confusing and serve no purpose.
68EmptyWhileStatementEmpty while statements are confusing and serve no purpose.
69EqualsAndHashCodeIf either the boolean equals(Object) or the int hashCode() methods are overridden within a class, then both must be overridden.
70EqualsOverloadedThe class has an equals method, but the parameter of the method is not of type Object. It is not overriding equals but instead overloading it.
71ExceptionExtendsErrorErrors are system exceptions. Do not extend them.
72ExceptionExtendsThrowableChecks for classes that extend java.lang.Throwable. Custom exception classes should subclass java.lang.Exception or one of its descendants.
73ExceptionNotThrownChecks for an exception constructor call without a throw as the last statement within a catch block.
74ExplicitGarbageCollectionCalls 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.
75FactoryMethodNameA factory method is a method that creates objects, and they are typically named either buildFoo(), makeFoo(), or createFoo(). This rule enforces that only one naming convention is used. It defaults to makeFoo(), but that can be changed using the property 'regex'.
76FieldNameVerifies that the name of each field matches a regular expression. By default it checks that non-'final' field names start with a lowercase letter and contains only letters or numbers, and 'final' field names start with an uppercase letter and contain only uppercase letters, numbers and underscores. The regex property specifies the default regular expression used to validate field names. The finalRegex property specifies the regular expression to validate 'final' field names. The staticRegex property specifies the regular expression to validate 'static' field names. The staticFinalRegex property specifies the regular expression to validate 'static final' field names. The ignoreFieldNames property (serialVersionUID)can specify field names that should be ignored, optionally containing wildcard characters ('*' or '?').
77FieldTypeRequiredChecks that field types are explicitly specified (and not using def).
78FinalClassWithProtectedMemberThis rule finds classes marked final that contain protected methods. If a class is final then it may not be subclassed, and there is therefore no point in having a method with protected visibility. Either the class should not be final or the method should be private or protected.
79ForLoopShouldBeWhileLoopA for loop without an init and update statement can be simplified to a while loop.
80ForStatementBracesUse braces for for statements, even for a single statement.
81GrailsDomainGormMethodsDatabase operation should be performed by Data Services instead of calling GORM static or instance methods.
82GrailsDomainHasEqualsChecks that Grails domain classes redefine equals().
83GrailsDomainHasToStringChecks that Grails domain classes redefine toString()
84GrailsDomainReservedSqlKeywordNameForbids usage of SQL reserved keywords as class or field names in Grails domain classes. Naming a domain class (or its field) with such a keyword causes SQL schema creation errors and/or redundant table/column name mappings.
85GrailsDomainStringPropertyMaxSizeString properties in Grails domain classes have to define maximum size otherwise the property is mapped to VARCHAR(255) causing runtime exceptions to occur
86GrailsDomainWithServiceReferenceChecks that Grails domain classes do not have service classes injected.
87GrailsDuplicateConstraintCheck for duplicate entry in domain class constraints
88GrailsDuplicateMappingCheck for duplicate name in a domain class mapping
89GrailsMassAssignmentUntrusted input should not be allowed to set arbitrary object fields without restriction.
90GrailsServletContextReferenceChecks for references to the servletContext object from within Grails controller and taglib classes.
91GrailsStatelessServiceChecks for fields on Grails service classes. Grails service classes are singletons, by default, and so they should be reentrant and typically stateless. The ignoreFieldNames property (dataSource,scope,sessionFactory,transactional,*Service,grailsApplication) specifies one or more field names that should be ignored. The ignoreFieldTypes property (null) specifies one or more field type names that should be ignored. Both can optionally contain wildcard characters ('*' or '?').
92HardCodedWindowsFileSeparatorThis rule finds usages of a Windows file separator within the constructor call of a File object. It is better to use the Unix file separator or use the File.separator constant.
93HardCodedWindowsRootDirectoryThis rule find cases where a File object is constructed with a windows-based path. This is not portable, and using the File.listRoots() method is a better alternative.
94HashtableIsObsoleteThe java.util.Hashtable class is effectively obsolete. Use the Java Collections Framework classes instead, including HashMap or ConcurrentHashMap. See the JDK javadoc.
95IfStatementBracesUse braces for if statements, even for a single statement.
96IfStatementCouldBeTernaryChecks for if statements where both the if and else blocks contain only a single return statement with a constant or literal value
97IllegalClassMemberChecks for classes containing fields/properties/methods matching configured illegal member modifiers or not matching any of the configured allowed member modifiers.
98IllegalClassReferenceChecks for reference to any of the classes configured in classNames.
99IllegalPackageReferenceChecks for reference to any of the packages configured in packageNames.
100IllegalRegexChecks for a specified illegal regular expression within the source code. The regex property specifies the regular expression to check for. It is required and cannot be null or empty.
101IllegalStringChecks for a specified illegal string within the source code.
102IllegalSubclassChecks for classes that extend one of the specified set of illegal superclasses configured in superclassNames.
103ImplementationAsTypeChecks for use of a predefined set of concrete classes (e.g. ArrayList, Hashtable, ConcurrentHashMap) when specifying the type of a method parameter, closure parameter, constructor parameter, method return type or field type. The associated interfaces should be used to specify the type instead.
104ImplicitClosureParameterChecks that the implicit it closure parameter is not used and that parameters are declared explicitly instead.
105ImplicitReturnStatementCheck for a non-void method that is missing an explicit return statement.
106ImportFromSamePackageAn import of a class that is within the same package is unnecessary.
107ImportFromSunPackagesAvoid importing anything from the 'sun.*' packages. These packages are not portable and are likely to change.
108InstanceofChecks for use of the instanceof operator. Use the ignoreTypeNames property to configure ignored type names.
109IntegerGetIntegerThis 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'].
110InterfaceNameVerifies that the name of an interface matches a regular expression specified in the regex property. If that property is null or empty, then this rule is not applied (i.e., it does nothing). It defaults to null, so this rule must be explicitly configured to be active.
111InterfaceNameSameAsSuperInterfaceChecks for any interface that has an identical name to its super-interface, other than the package. This can be very confusing.
112InvertedConditionAn inverted condition is one where a constant expression is used on the left hand side of the equals comparision. Such conditions can be confusing especially when used in assertions where the expected value is by convention placed on the right hand side of the comparision.
113InvertedIfElseAn 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.
114LocaleSetDefaultChecks for calls to Locale.setDefault(), which sets the Locale across the entire JVM.
115LongLiteralWithLowerCaseLIn Java and Groovy, you can specify long literals with the L or l character, for instance 55L or 24l. It is best practice to always use an uppercase L and never a lowercase l. This is because 11l rendered in some fonts may look like 111 instead of 11L.
116MethodNameVerifies that the name of each method matches a regular expression. By default it checks that the method name starts with a lowercase letter. The regex property specifies the regular expression to check the method name against. The ignoreMethodNames property (null) can specify method names that should be ignored, optionally containing wildcard characters ('*' or '?').
117MethodParameterTypeRequiredChecks that method parameters are not dynamically typed, that is they are explicitly stated and different than def.
118MethodReturnTypeRequiredChecks that method return types are not dynamic, that is they are explicitly stated and different than def.
119MisorderedStaticImportsStatic imports should never be declared after nonstatic imports.
120MissingNewInThrowStatementA common Groovy mistake when throwing exceptions is to forget the new keyword. For instance, "throw RuntimeException()" instead of "throw new RuntimeException()". If the error path is not unit tested then the production system will throw a Method Missing exception and hide the root cause. This rule finds constructs like "throw RuntimeException()" that look like a new keyword was meant to be used but forgotten.
121MultipleUnaryOperatorsChecks for multiple consecutive unary operators. These are confusing, and are likely typos and bugs.
122NestedForLoopReports classes with nested for loops.
123NoDefdef should not be used. You should replace it with concrete type.
124NoDoubleChecks for use of the double or Double types, in fields, variables, method parameters and method return types.
125NoFloatChecks for use of the float or Float types, in fields, variables, method parameters and method return types.
126NoJavaUtilDateDo not use java.util.Date. Prefer the classes in the java.time.* packages.
127NoTabCharacterChecks that all source files do not contain the tab character
128NoWildcardImportsWildcard imports, static or otherwise, should not be used.
129ObjectOverrideMisspelledMethodNameVerifies that the names of the most commonly overridden methods of Object: equals, hashCode and toString, are correct.
130PackageNameVerifies that the package name for a class matches a regular expression. By default it checks that the package name consists of only lowercase letters, separated by periods. The regex property specifies the regular expression used to validate the package name. The packageNameRequired property indicates whether a package name declaration is required for all classes.
131PackageNameMatchesFilePathA package source file's path should match the package itself. To find the package-relevant subpath in the file path the groupId needs to be configured. It is expected in every package declaration.
132ParameterNameVerifies that the name of each parameter matches a regular expression. This rule applies to method parameters, constructor parameters and closure parameters. By default it checks that parameter names start with a lowercase letter and contains only letters or numbers. The regex property specifies the default regular expression used to validate the parameter name. The ignoreParameterNames property (null) can specify parameter names that should be ignored, optionally containing wildcard characters ('*' or '?').
133ParameterReassignmentChecks for a method or closure parameter being reassigned to a new value within the body of the method/closure, which is a confusing and questionable practice. Use a temporary variable instead.
134PrivateFieldCouldBeFinalChecks for private fields that are only set within a constructor or field initializer. Such fields can safely be made final.
135PropertyNameVerifies that the name of each property matches a regular expression. By default it checks that property names other than 'static final' start with a lowercase letter and contains only letters or numbers, and 'static final' property names start with an uppercase letter and contain only uppercase letters, numbers and underscores. The regex property specifies the default regular expression used to validate property names. The finalRegex property specifies the regular expression to validate 'final' property names. The staticRegex property specifies the regular expression to validate 'static' property names. The staticFinalRegex property specifies the regular expression to validate 'static final' property names. The ignorePropertyNames property (null) can specify property names that should be ignored, optionally containing wildcard characters ('*' or '?').
136PublicInstanceFieldUsing public fields is considered to be a bad design. Use properties instead.
137PublicMethodsBeforeNonPublicMethodsEnforce that all public methods are above protected and private methods.
138RandomDoubleCoercedToZeroThe Math.random() method returns a double result greater than or equal to 0.0 and less than 1.0. If you coerce this result into an Integer or int, then it is coerced to zero. Casting the result to int, or assigning it to an int field is probably a bug.
139RemoveAllOnSelfDon'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.
140RequiredRegexChecks for a specified regular expression that must exist within the source code. The regex property specifies the regular expression to check for. It is required and cannot be null or empty.
141RequiredStringChecks for a specified text string that must exist within the source code. The string property specifies the String to check for. It is required and cannot be null or empty.
142ReturnFromFinallyBlockReturning from a finally block is confusing and can hide the original exception.
143ReturnNullFromCatchBlockReturning null from a catch block often masks errors and requires the client to handle error codes. In some coding styles this is discouraged.
144ReturnsNullInsteadOfEmptyArrayConsider 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.
145ReturnsNullInsteadOfEmptyCollectionConsider 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.
146SimpleDateFormatMissingLocaleBe 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.
147StatelessClassChecks for fields on classes that should remain "stateless" and reentrant. The ignoreFieldNames property (null) specifies one or more field names that should be ignored. The ignoreFieldTypes property specifies one or more field type names that should be ignored. Both can optionally contain wildcard characters ('*' or '?').
148StatelessSingletonThere is no point in creating a stateless Singleton because there is nothing within the class that needs guarding and no side effects to calling the constructor. Just create new instances of the object or write a Utility class with static methods.
149StaticFieldsBeforeInstanceFieldsEnforce that all static fields are above all instance fields within a class
150StaticMethodsBeforeInstanceMethodsEnforce that all static methods are above all instance methods within a class
151SwallowThreadDeathChecks for code that catches ThreadDeath without re-throwing it.
152TernaryCouldBeElvisChecks for ternary expressions where the boolean and true expressions are the same. These can be simplified to an Elvis expression.
153ThrowErrorChecks for throwing an instance of java.lang.Error.
154ThrowExceptionChecks for throwing an instance of java.lang.Exception.
155ThrowExceptionFromFinallyBlockThrowing an exception from a finally block is confusing and can hide the original exception.
156ThrowNullPointerExceptionChecks for throwing an instance of java.lang.NullPointerException.
157ThrowRuntimeExceptionChecks for throwing an instance of java.lang.RuntimeException.
158ThrowThrowableChecks for throwing an instance of java.lang.Throwable.
159ToStringReturnsNullChecks for toString() methods that return null.
160TrailingCommaCheck whether list and map literals contain optional trailing comma.
161UnnecessaryBigDecimalInstantiationIt 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.
162UnnecessaryBigIntegerInstantiationIt is unnecessary to instantiate BigInteger objects. Instead just use the literal with the 'G' identifier to force the type, such as 8G or 42G.
163UnnecessaryBooleanExpressionChecks 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.
164UnnecessaryBooleanInstantiationUse 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).
165UnnecessaryCallForLastElementThis 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.
166UnnecessaryCallToSubstringCalling String.substring(0) always returns the original string. This code is meaningless.
167UnnecessaryCastChecks for unnecessary cast operations
168UnnecessaryCatchBlockViolations 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.
169UnnecessaryCollectCallSome 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). Warning: if a collection is null, collect will return an empty list, while *. will return null.
170UnnecessaryCollectionCallUseless 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.
171UnnecessaryConstructorThis 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.
172UnnecessaryDefInFieldDeclarationIf a field has a visibility modifier or a type declaration, then the def keyword is unneeded. For instance, 'static def constraints = {}' is redundant and can be simplified to 'static constraints = {}.
173UnnecessaryDefInMethodDeclarationIf a method has a visibility modifier or a type declaration, then the def keyword is unneeded. For instance 'def private method() {}' is redundant and can be simplified to 'private method() {}'.
174UnnecessaryDefInVariableDeclarationIf a variable has a visibility modifier or a type declaration, then the def keyword is unneeded. For instance 'def private n = 2' is redundant and can be simplified to 'private n = 2'.
175UnnecessaryDotClassTo make a reference to a class, it is unnecessary to specify the '.class' identifier. For instance String.class can be shortened to String.
176UnnecessaryDoubleInstantiationIt 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.
177UnnecessaryElseStatementWhen an if statement block ends with a return statement the else is unnecessary. The logic in the else branch can be run without being in a new scope.
178UnnecessaryFinalOnPrivateMethodA private method is marked final. Private methods cannot be overridden, so marking it final is unnecessary.
179UnnecessaryFloatInstantiationIt 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.
180UnnecessaryGStringString objects should be created with single quotes, and GString objects created with double quotes. Creating normal String objects with double quotes is confusing to readers.
181UnnecessaryGetterChecks 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. The ignoreMethodNames property (null) can specify method names that should be ignored, optionally containing wildcard characters ('*' or '?').
182UnnecessaryGroovyImportA 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.
183UnnecessaryIfStatementChecks for if statements where the if and else blocks (or subsequent fall-through to a return) are merely returning true and false constants. These cases can be replaced by a simple return statement.
184UnnecessaryInstanceOfCheckThis rule finds instanceof checks that cannot possibly evaluate to true. For instance, checking that (!variable instanceof String) will never be true because the result of a not expression is always a boolean.
185UnnecessaryInstantiationToGetClassAvoid instantiating an object just to call getClass() on it; use the .class public member instead.
186UnnecessaryIntegerInstantiationIt is unnecessary to instantiate Integer objects. Instead just use the literal with the 'I' identifier to force the type, such as 8I or 42i.
187UnnecessaryLongInstantiationIt is unnecessary to instantiate Long objects. Instead just use the literal with the 'L' identifier to force the type, such as 8L or 42L.
188UnnecessaryModOneAny 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).
189UnnecessaryNullCheckGroovy contains the safe dereference operator, which can be used in boolean conditional statements to safely replace explicit "x == null" tests.
190UnnecessaryNullCheckBeforeInstanceOfThere is no need to check for null before an instanceof; the instanceof keyword returns false when given a null argument.
191UnnecessaryObjectReferencesViolations 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.
192UnnecessaryOverridingMethodThe overriding method merely calls the same method defined in a superclass
193UnnecessaryPackageReferenceChecks for explicit package reference for classes that Groovy imports by default, such as java.lang.String, java.util.Map and groovy.lang.Closure.
194UnnecessaryParenthesesForMethodCallWithClosureIf a method is called and the only parameter to that method is an inline closure then the parentheses of the method call can be omitted.
195UnnecessaryPublicModifierThe 'public' modifier is not required on methods or classes.
196UnnecessaryReturnKeywordIn Groovy, the return keyword is often optional. If a statement is the last line in a method or closure then you do not need to have the return keyword.
197UnnecessarySafeNavigationOperatorCheck for the safe navigation operator (?.) applied to constants and literals, which can never be null.
198UnnecessarySelfAssignmentMethod contains a pointless self-assignment to a variable or property.
199UnnecessarySemicolonSemicolons as line terminators are not required in Groovy: remove them. Do not use a semicolon as a replacement for empty braces on for and while loops; this is a confusing practice.
200UnnecessarySetterChecks for explicit calls to setter methods which can, for the most part, be replaced by assignment to property. A setter is defined as a method call that matches set[A-Z] but not set[A-Z][A-Z] such as setURL(). Setters take one method argument.
201UnnecessaryStringInstantiationUse a String literal (e.g., "...") instead of calling the corresponding String constructor (new String("..")) directly.
202UnnecessarySubstringThis rule finds usages of String.substring(int) and String.substring(int, int) that can be replaced by use of the subscript operator. For instance, var.substring(5) can be replaced with var[5..-1].
203UnnecessaryTernaryExpressionChecks 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.
204UnnecessaryToStringChecks for unnecessary calls to toString().
205UnnecessaryTransientModifierThe field is marked as transient, but the class isn't Serializable, so marking it as transient has no effect.
206UnusedArrayChecks for array allocations that are not assigned or used, unless it is the last statement within a block.
207UnusedImportImports for a class that is never referenced within the source file is unnecessary.
208UnusedMethodParameterThis rule finds instances of method parameters not being used. It does not analyze private methods (that is done by the UnusedPrivateMethodParameter rule) or methods marked @Override.
209UnusedObjectChecks for object allocations that are not assigned or used, unless it is the last statement within a block
210UnusedPrivateFieldChecks for private fields that are not referenced within the same class.
211UnusedPrivateMethodChecks for private methods that are not referenced within the same class.
212UnusedPrivateMethodParameterChecks for parameters to private methods that are not referenced within the method body.
213UnusedVariableChecks for variables that are never referenced. The ignoreVariableNames property (null) specifies one or more variable names that should be ignored, optionally containing wildcard characters ('*' or '?').
214VariableNameVerifies that the name of each method matches a regular expression. By default it checks that non-'final' variable names start with a lowercase letter and contains only letters or numbers, and 'final' variable names start with an uppercase letter and contain only uppercase letters, numbers and underscores. The regex property specifies the default regular expression used to validate a non-'final' variable name. The finalRegex property specifies the regular expression used to validate 'final' variable names. The ignoreVariableNames property (null) can specify variable names that should be ignored, optionally containing wildcard characters ('*' or '?').
215VariableTypeRequiredChecks that variable types are explicitly specified in declarations (and not using def)
216VectorIsObsoleteThe java.util.Vector class is effectively obsolete. Use the Java Collections Framework classes instead, including ArrayList or Collections.synchronizedList(). See the JDK javadoc.
217WhileStatementBracesUse braces for while statements, even for a single statement.