CodeNarc Report

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

Summary

PackageTotal FilesFiles with ViolationsPriority 1Priority 2Priority 3
All Packages6665-3541522
tech/muyan2322-142672
tech/muyan/customise11-15
tech/muyan/dynamic11-613
tech/muyan/dynamic/field33-2872
tech/muyan/dynamic/form33-1757
tech/muyan/enums1111-45127
tech/muyan/helper66-33267
tech/muyan/importexport55-33113
tech/muyan/importexport/converter22-414
tech/muyan/security1111-45182

Package: tech.muyan

➥ ActionMetaController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic214

[SRC]class ActionMetaController {

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

DuplicateStringLiteral242

[SRC]updateRoles, 'update', 'PUT', "/${domainName}/**",

[MSG]Duplicate String Literal: update

DuplicateStringLiteral246

[SRC]result = buildErrorMsg(deleteRoles, 'delete', 'DELETE', ..inName}/**",

[MSG]Duplicate String Literal: delete

DuplicateStringLiteral250

[SRC]result.put("update", canUpdateFromRole)

[MSG]Duplicate String Literal: update

DuplicateStringLiteral251

[SRC]result.put("delete", canDeleteFromRole)

[MSG]Duplicate String Literal: delete

DuplicateNumberLiteral268

[SRC]Map<String, Object> params = new HashMap<>(8)

[MSG]Duplicate Number Literal: 8

DuplicateStringLiteral269

[SRC]params.put("objectType", clazz)

[MSG]Duplicate String Literal: objectType

DuplicateStringLiteral270

[SRC]params.put("userContext", auth)

[MSG]Duplicate String Literal: userContext

DuplicateStringLiteral271

[SRC]params.put("application", grailsApplication)

[MSG]Duplicate String Literal: application

DuplicateStringLiteral275

[SRC]createRoles, 'create', 'POST', "/${domainName}",

[MSG]Duplicate String Literal: create

DuplicateStringLiteral279

[SRC]result.put("create", canCreateBasedOnRole)

[MSG]Duplicate String Literal: create

FactoryMethodName284

[SRC]static Map<String, Object> buildErrorMsg(

[MSG]Violation in class ActionMetaController. The method 'buildErrorMsg' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/

FieldTypeRequired315

[SRC]static responseFormats = ['json', 'xml']

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

MethodReturnTypeRequired320

[SRC]def canUpdateAndDelete(String domainName, Long id) {

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

NoDef320

[SRC]def canUpdateAndDelete(String domainName, Long id) {

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

NoDef321

[SRC]def auth = springSecurityService.authentication

[MSG]def for declaration should not be used

VariableTypeRequired321

[SRC]def auth = springSecurityService.authentication

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

NoDef322

[SRC]def clazz = DomainHelper.getClazzFromDomainName(domainName)

[MSG]def for declaration should not be used

VariableTypeRequired322

[SRC]def clazz = DomainHelper.getClazzFromDomainName(domainName)

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

NoDef323

[SRC]def clazzName = clazz.getName()

[MSG]def for declaration should not be used

VariableTypeRequired323

[SRC]def clazzName = clazz.getName()

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

UnnecessaryGetter323

[SRC]def clazzName = clazz.getName()

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

NoDef324

[SRC]def actionLogic = DynamicLogic.where {

[MSG]def for declaration should not be used

VariableTypeRequired324

[SRC]def actionLogic = DynamicLogic.where {

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

NoDef330

[SRC]def canUpdateFromRole = AuthorityHelper.checkAuthority(a..updateRoles)

[MSG]def for declaration should not be used

VariableTypeRequired330

[SRC]def canUpdateFromRole = AuthorityHelper.checkAuthority(a..updateRoles)

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

NoDef331

[SRC]def canDeleteFromRole = AuthorityHelper.checkAuthority(a..deleteRoles)

[MSG]def for declaration should not be used

VariableTypeRequired331

[SRC]def canDeleteFromRole = AuthorityHelper.checkAuthority(a..deleteRoles)

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

NoDef334

[SRC]def object = clazz.get(id)

[MSG]def for declaration should not be used

VariableTypeRequired334

[SRC]def object = clazz.get(id)

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

UnnecessaryGString335

[SRC]params.put("objectType", clazz)

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

UnnecessaryGString336

[SRC]params.put("objectValue", object)

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

UnnecessaryGString337

[SRC]params.put("userContext", auth)

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

UnnecessaryGString338

[SRC]params.put("application", grailsApplication)

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

UnnecessaryGString340

[SRC]if (result.get("update") == true && !canUpdateFromRole) {

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

UnnecessaryGString345

[SRC]if (result.get("delete") == true && !canDeleteFromRole) {

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

UnnecessaryGString350

[SRC]result.put("update", canUpdateFromRole)

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

UnnecessaryGString351

[SRC]result.put("delete", canDeleteFromRole)

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

MethodReturnTypeRequired357

[SRC]def canCreate(String domainName) {

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

NoDef357

[SRC]def canCreate(String domainName) {

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

NoDef358

[SRC]def auth = springSecurityService.authentication

[MSG]def for declaration should not be used

VariableTypeRequired358

[SRC]def auth = springSecurityService.authentication

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

NoDef359

[SRC]def clazz = DomainHelper.getClazzFromDomainName(domainName)

[MSG]def for declaration should not be used

VariableTypeRequired359

[SRC]def clazz = DomainHelper.getClazzFromDomainName(domainName)

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

NoDef360

[SRC]def clazzName = clazz.getName()

[MSG]def for declaration should not be used

VariableTypeRequired360

[SRC]def clazzName = clazz.getName()

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

UnnecessaryGetter360

[SRC]def clazzName = clazz.getName()

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

NoDef361

[SRC]def actionLogic = DynamicLogic.where {

[MSG]def for declaration should not be used

VariableTypeRequired361

[SRC]def actionLogic = DynamicLogic.where {

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

NoDef364

[SRC]def result = [:]

[MSG]def for declaration should not be used

VariableTypeRequired364

[SRC]def result = [:]

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

NoDef366

[SRC]def canCreateBasedOnRole = AuthorityHelper.checkAuthorit..createRoles)

[MSG]def for declaration should not be used

VariableTypeRequired366

[SRC]def canCreateBasedOnRole = AuthorityHelper.checkAuthorit..createRoles)

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

UnnecessaryGString369

[SRC]params.put("objectType", clazz)

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

UnnecessaryGString370

[SRC]params.put("userContext", auth)

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

UnnecessaryGString371

[SRC]params.put("application", grailsApplication)

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

UnnecessaryGString373

[SRC]if (result.get("create") == true && !canCreateBasedOnRole) {

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

UnnecessaryGString379

[SRC]result.put("create", canCreateBasedOnRole)

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

StaticMethodsBeforeInstanceMethods384

[SRC]static Map<String, Object> buildErrorMsg(

[MSG]The public static method buildErrorMsg in class tech.muyan.ActionMetaController is declared after a public instance method

UnnecessaryGString398

[SRC]result.put("error", 1)

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

UnnecessaryReturnKeyword3100

[SRC]return result

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

➥ ApplicationController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic26

[SRC]class ApplicationController implements PluginManagerAware {

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

NoWildcardImports34

[SRC]import grails.plugins.*

[MSG]Wildcard (star) import

MethodReturnTypeRequired311

[SRC]def index() {

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

NoDef311

[SRC]def index() {

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

➥ BootStrap.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic214

[SRC]class BootStrap {

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

ImplementationAsType225

[SRC]HashMap<String, Collection<Map<String, Object>>> metas =..Application)

EmptyIfStatement254

[SRC]if (environment == Environment.DEVELOPMENT || environmen..ment.TEST) {

[MSG]The if statement is empty

UnnecessaryGString318

[SRC]public static final String DEFAULT_SEED_DATA_FOLDER = "/app/data"

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

MethodReturnTypeRequired323

[SRC]def importSeedDataFromCsv(File directory) {

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

NoDef323

[SRC]def importSeedDataFromCsv(File directory) {

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

UnnecessaryGString328

[SRC]log.info("To import csv files(sorted): [\n${sortedFiles...("\n")}\n]")

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

FieldTypeRequired334

[SRC]def init = { servletContext ->

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

NoDef343

[SRC]def environment = Environment.getCurrent()

[MSG]def for declaration should not be used

NoDef343

[SRC]def environment = Environment.getCurrent()

[MSG]def for declaration should not be used

VariableTypeRequired343

[SRC]def environment = Environment.getCurrent()

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

VariableTypeRequired343

[SRC]def environment = Environment.getCurrent()

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

UnnecessaryGetter343

[SRC]def environment = Environment.getCurrent()

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

UnnecessaryGetter346

[SRC]String seedDataFolder = grailsApplication.getConfig().ge..DATA_FOLDER)

[MSG]getConfig() can probably be rewritten as config

UnnecessaryGetter347

[SRC]File directory = new File(seedDataFolder + File.separato..t.getName())

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

InvertedIfElse348

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

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

InvertedIfElse348

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

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

MethodReturnTypeRequired359

[SRC]def changeMenuInFormToNullable() {

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

NoDef359

[SRC]def changeMenuInFormToNullable() {

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

NoDef360

[SRC]def sql = new Sql(dataSource)

[MSG]def for declaration should not be used

VariableTypeRequired360

[SRC]def sql = new Sql(dataSource)

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

FieldTypeRequired365

[SRC]def destroy = {

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

➥ ColumnMetaController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic215

[SRC]class ColumnMetaController {

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

FieldTypeRequired316

[SRC]static responseFormats = ['json', 'html']

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

MethodReturnTypeRequired320

[SRC]def refresh(String domainName, String sourceColumn, Stri..estColumn) {

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

NoDef320

[SRC]def refresh(String domainName, String sourceColumn, Stri..estColumn) {

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

NoDef321

[SRC]def clazz = DomainHelper.getClazzFromDomainName(domainName)

[MSG]def for declaration should not be used

VariableTypeRequired321

[SRC]def clazz = DomainHelper.getClazzFromDomainName(domainName)

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

NoDef322

[SRC]def clazzName = clazz.getName()

[MSG]def for declaration should not be used

VariableTypeRequired322

[SRC]def clazzName = clazz.getName()

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

UnnecessaryGetter322

[SRC]def clazzName = clazz.getName()

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

NoDef323

[SRC]def decideLogics = DynamicLogic.where {

[MSG]def for declaration should not be used

VariableTypeRequired323

[SRC]def decideLogics = DynamicLogic.where {

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

NoDef330

[SRC]def object = request.getJSON()

[MSG]def for declaration should not be used

VariableTypeRequired330

[SRC]def object = request.getJSON()

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

UnnecessaryGetter330

[SRC]def object = request.getJSON()

[MSG]getJSON() can probably be rewritten as JSON

NoDef331

[SRC]def sourceColumnValue = object.get(sourceColumn)

[MSG]def for declaration should not be used

VariableTypeRequired331

[SRC]def sourceColumnValue = object.get(sourceColumn)

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

UnnecessaryGString332

[SRC]params.put("domainName", domainName)

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

UnnecessaryGString333

[SRC]params.put("sourceColumn", sourceColumn)

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

UnnecessaryGString334

[SRC]params.put("destColumn", destColumn)

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

UnnecessaryGString335

[SRC]params.put("sourceColumnValue", sourceColumnValue)

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

UnnecessaryGString336

[SRC]params.put("object", object)

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

UnnecessaryGString337

[SRC]params.put("application", grailsApplication)

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

UnnecessaryObjectReferences337

[SRC]params.put("application", grailsApplication)

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

NoDef338

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

[MSG]def for declaration should not be used

VariableTypeRequired338

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

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

➥ Contract.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class Contract extends WithDynamicFields<Contract> {

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

GrailsDomainHasEquals210

[SRC]class Contract extends WithDynamicFields<Contract> {

[MSG]The domain class tech.muyan.Contract should define an equals(Object) method

GrailsDomainHasToString210

[SRC]class Contract extends WithDynamicFields<Contract> {

[MSG]The domain class tech.muyan.Contract should define a toString() method

GrailsDomainStringPropertyMaxSize216

[SRC]String name

[MSG]There is no constraint on the size of String property 'name' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize219

[SRC]String title

[MSG]There is no constraint on the size of String property 'title' which will result in applying database defaults

DuplicateNumberLiteral255

[SRC]title boost: 1.0

[MSG]Duplicate Number Literal: 1.0

DuplicateStringLiteral256

[SRC]except = ['effectiveDate', 'lines', 'contractStatus']

[MSG]Duplicate String Literal: effectiveDate

FieldTypeRequired331

[SRC]static belongsTo = [ownerOrganization: Organization]

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

StaticFieldsBeforeInstanceFields331

[SRC]static belongsTo = [ownerOrganization: Organization]

[MSG]The static field belongsTo in class tech.muyan.Contract is declared after an instance field

FieldTypeRequired334

[SRC]static hasMany = [lines: ContractLine]

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

StaticFieldsBeforeInstanceFields334

[SRC]static hasMany = [lines: ContractLine]

[MSG]The static field hasMany in class tech.muyan.Contract is declared after an instance field

FieldTypeRequired337

[SRC]static labelField = "title"

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

StaticFieldsBeforeInstanceFields337

[SRC]static labelField = "title"

[MSG]The static field labelField in class tech.muyan.Contract is declared after an instance field

UnnecessaryGString337

[SRC]static labelField = "title"

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

FieldTypeRequired339

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields339

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.Contract is declared after an instance field

DuplicateMapLiteral344

[SRC]total nullable: true

[MSG]Map [nullable:true] is duplicated.

FieldTypeRequired347

[SRC]static mapping = {

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

StaticFieldsBeforeInstanceFields347

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.Contract is declared after an instance field

FieldTypeRequired353

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields353

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.Contract is declared after an instance field

DuplicateMapLiteral355

[SRC]title boost: 1.0

[MSG]Map [boost:1.0] is duplicated.

➥ ContractLine.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic26

[SRC]class ContractLine extends WithDynamicFields<ContractLine> {

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

GrailsDomainHasEquals26

[SRC]class ContractLine extends WithDynamicFields<ContractLine> {

[MSG]The domain class tech.muyan.ContractLine should define an equals(Object) method

GrailsDomainHasToString26

[SRC]class ContractLine extends WithDynamicFields<ContractLine> {

[MSG]The domain class tech.muyan.ContractLine should define a toString() method

FieldTypeRequired314

[SRC]static belongsTo = [contract: Contract, lineType: ContractLineType]

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

StaticFieldsBeforeInstanceFields314

[SRC]static belongsTo = [contract: Contract, lineType: ContractLineType]

[MSG]The static field belongsTo in class tech.muyan.ContractLine is declared after an instance field

FieldTypeRequired316

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields316

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.ContractLine is declared after an instance field

➥ ContractLineType.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic24

[SRC]class ContractLineType {

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

GrailsDomainHasEquals24

[SRC]class ContractLineType {

[MSG]The domain class tech.muyan.ContractLineType should define an equals(Object) method

GrailsDomainHasToString24

[SRC]class ContractLineType {

[MSG]The domain class tech.muyan.ContractLineType should define a toString() method

GrailsDomainStringPropertyMaxSize27

[SRC]String name

[MSG]There is no constraint on the size of String property 'name' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize210

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldTypeRequired312

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields312

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.ContractLineType is declared after an instance field

FieldTypeRequired317

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields317

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.ContractLineType is declared after an instance field

➥ DataLoadController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic215

[SRC]class DataLoadController {

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

ImplementationAsType241

[SRC]HashMap<String, Collection<Map<String, Object>>> metas =..Application)

FieldTypeRequired316

[SRC]static responseFormats = ['json', 'html']

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

StaticFieldsBeforeInstanceFields321

[SRC]public static final String SEED_DATA_FOLDER = 'seedData.folder'

[MSG]The static field SEED_DATA_FOLDER in class tech.muyan.DataLoadController is declared after an instance field

StaticFieldsBeforeInstanceFields322

[SRC]public static final String DEFAULT_SEED_DATA_FOLDER = "/app/data"

[MSG]The static field DEFAULT_SEED_DATA_FOLDER in class tech.muyan.DataLoadController is declared after an instance field

UnnecessaryGString322

[SRC]public static final String DEFAULT_SEED_DATA_FOLDER = "/app/data"

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

MethodReturnTypeRequired325

[SRC]def reload() {

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

NoDef325

[SRC]def reload() {

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

UnnecessaryGString326

[SRC]log.info("Reload called")

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

NoDef327

[SRC]def environment = Environment.getCurrent()

[MSG]def for declaration should not be used

VariableTypeRequired327

[SRC]def environment = Environment.getCurrent()

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

UnnecessaryGetter327

[SRC]def environment = Environment.getCurrent()

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

UnnecessaryGetter328

[SRC]String seedDataFolder = grailsApplication.getConfig().ge..DATA_FOLDER)

[MSG]getConfig() can probably be rewritten as config

UnnecessaryGetter329

[SRC]File directory = new File(seedDataFolder + File.separato..t.getName())

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

InvertedIfElse330

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

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

NoDef335

[SRC]def result = [status: "success"]

[MSG]def for declaration should not be used

VariableTypeRequired335

[SRC]def result = [status: "success"]

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

UnnecessaryGString335

[SRC]def result = [status: "success"]

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

MethodReturnTypeRequired339

[SRC]private static def importSeedDataFromCsv(File directory,..plication) {

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

NoDef339

[SRC]private static def importSeedDataFromCsv(File directory,..plication) {

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

UnnecessaryDefInMethodDeclaration339

[SRC]private static def importSeedDataFromCsv(File directory,..plication) {

[MSG]Violation in class tech.muyan.DataLoadController. The def keyword is unneeded when a method is marked private

➥ DomainClass.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic211

[SRC]class DomainClass {

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

GrailsDomainHasEquals211

[SRC]class DomainClass {

[MSG]The domain class tech.muyan.DomainClass should define an equals(Object) method

GrailsDomainHasToString211

[SRC]class DomainClass {

[MSG]The domain class tech.muyan.DomainClass should define a toString() method

GrailsDomainStringPropertyMaxSize214

[SRC]String fullName

[MSG]There is no constraint on the size of String property 'fullName' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize217

[SRC]String shortName

[MSG]There is no constraint on the size of String property 'shortName' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize220

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

DuplicateNumberLiteral234

[SRC]label boost: 2.0

[MSG]Duplicate Number Literal: 2.0

StaticFieldsBeforeInstanceFields323

[SRC]static List<DomainClass> cachedObjects

[MSG]The static field cachedObjects in class tech.muyan.DomainClass is declared after an instance field

FieldTypeRequired325

[SRC]static hasMany = [dynamicFields: ObjectDynamicField, dyn..ynamicLogic]

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

StaticFieldsBeforeInstanceFields325

[SRC]static hasMany = [dynamicFields: ObjectDynamicField, dyn..ynamicLogic]

[MSG]The static field hasMany in class tech.muyan.DomainClass is declared after an instance field

FieldTypeRequired327

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields327

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.DomainClass is declared after an instance field

DuplicateMapLiteral329

[SRC]shortName updateable: false, editable: false, unique: true

[MSG]Map [updateable:false, editable:false, unique:true] is duplicated.

FieldTypeRequired332

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields332

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.DomainClass is declared after an instance field

DuplicateMapLiteral334

[SRC]label boost: 2.0

[MSG]Map [boost:2.0] is duplicated.

UnnecessaryReturnKeyword343

[SRC]return cachedObjects

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

➥ DomainDataController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic218

[SRC]class DomainDataController extends RestfulController<DummyDomain> {

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

NoWildcardImports34

[SRC]import grails.gorm.transactions.*

[MSG]Wildcard (star) import

MisorderedStaticImports311

[SRC]import static tech.muyan.helper.DynamicFieldHelper.hasDynamicFields

[MSG]Static imports should appear before normal imports

FieldTypeRequired338

[SRC]static scope = "prototype"

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

StaticFieldsBeforeInstanceFields338

[SRC]static scope = "prototype"

[MSG]The static field scope in class tech.muyan.DomainDataController is declared after an instance field

UnnecessaryGString338

[SRC]static scope = "prototype"

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

FieldTypeRequired340

[SRC]static responseFormats = ['json', 'html']

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

StaticFieldsBeforeInstanceFields340

[SRC]static responseFormats = ['json', 'html']

[MSG]The static field responseFormats in class tech.muyan.DomainDataController is declared after an instance field

MethodReturnTypeRequired353

[SRC]def update(String domainName) {

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

NoDef353

[SRC]def update(String domainName) {

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

UnnecessarySetter357

[SRC]setResourceByDomainName(domainName)

[MSG]setResourceByDomainName(..) can probably be rewritten as resourceByDomainName = ..

NoDef358

[SRC]def domainObj = getResource().get(params.id)

[MSG]def for declaration should not be used

VariableTypeRequired358

[SRC]def domainObj = getResource().get(params.id)

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

UnnecessaryGetter358

[SRC]def domainObj = getResource().get(params.id)

[MSG]getResource() can probably be rewritten as resource

InvertedCondition359

[SRC]if (null == domainObj) {

[MSG]null is a constant expression on the left side of a compare equals operation

NoDef364

[SRC]def jsonObj = request.JSON

[MSG]def for declaration should not be used

VariableTypeRequired364

[SRC]def jsonObj = request.JSON

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

NoDef366

[SRC]def dynamicFieldValues = DynamicFieldHelper.parseDynamic..bj, jsonObj,

[MSG]def for declaration should not be used

VariableTypeRequired366

[SRC]def dynamicFieldValues = DynamicFieldHelper.parseDynamic..bj, jsonObj,

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

UnnecessaryGetter370

[SRC]domainObj.properties = getObjectToBind()

[MSG]getObjectToBind() can probably be rewritten as objectToBind

MethodReturnTypeRequired383

[SRC]def show(String domainName) {

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

NoDef383

[SRC]def show(String domainName) {

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

UnnecessarySetter387

[SRC]setResourceByDomainName(domainName)

[MSG]setResourceByDomainName(..) can probably be rewritten as resourceByDomainName = ..

NoDef388

[SRC]def resource = queryForResource(params.id)

[MSG]def for declaration should not be used

VariableTypeRequired388

[SRC]def resource = queryForResource(params.id)

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

MethodReturnTypeRequired3104

[SRC]def showMultiple(String domainName) {

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

NoDef3104

[SRC]def showMultiple(String domainName) {

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

UnnecessarySetter3105

[SRC]setResourceByDomainName(domainName)

[MSG]setResourceByDomainName(..) can probably be rewritten as resourceByDomainName = ..

UnnecessaryGString3106

[SRC]List ids = params.ids.split(",")

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

NoDef3110

[SRC]def resource = queryForResource(id)

[MSG]def for declaration should not be used

VariableTypeRequired3110

[SRC]def resource = queryForResource(id)

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

NoDef3111

[SRC]def withDfs = DomainHelper.getDomainObjectWithDynamicField(resource)

[MSG]def for declaration should not be used

VariableTypeRequired3111

[SRC]def withDfs = DomainHelper.getDomainObjectWithDynamicField(resource)

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

MethodReturnTypeRequired3125

[SRC]save(String domainName) {

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

NoDef3125

[SRC]save(String domainName) {

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

UnnecessarySetter3126

[SRC]setResourceByDomainName(domainName)

[MSG]setResourceByDomainName(..) can probably be rewritten as resourceByDomainName = ..

NoDef3127

[SRC]def jsonObj = request.JSON

[MSG]def for declaration should not be used

VariableTypeRequired3127

[SRC]def jsonObj = request.JSON

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

NoDef3128

[SRC]def domainObj = super.createResource()

[MSG]def for declaration should not be used

VariableTypeRequired3128

[SRC]def domainObj = super.createResource()

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

NoDef3136

[SRC]def dynamicFieldValues = DynamicFieldHelper.parseDynamic..bj, jsonObj,

[MSG]def for declaration should not be used

VariableTypeRequired3136

[SRC]def dynamicFieldValues = DynamicFieldHelper.parseDynamic..bj, jsonObj,

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

UnnecessaryGString3142

[SRC]log.error("Failed to save object with value: {}", jsonObj)

[MSG]The String 'Failed to save object with value: {}' can be wrapped in single quotes instead of double quotes

MethodReturnTypeRequired3148

[SRC]def delete(String domainName) {

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

NoDef3148

[SRC]def delete(String domainName) {

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

UnnecessarySetter3149

[SRC]setResourceByDomainName(domainName)

[MSG]setResourceByDomainName(..) can probably be rewritten as resourceByDomainName = ..

NoDef3154

[SRC]def obj = queryForResource(params.id)

[MSG]def for declaration should not be used

VariableTypeRequired3154

[SRC]def obj = queryForResource(params.id)

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

DuplicateMapLiteral3161

[SRC]obj.delete flush: true

[MSG]Map [flush:true] is duplicated.

UnnecessaryGString3162

[SRC]respond "success"

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

MethodReturnTypeRequired3169

[SRC]def index(String domainName, Integer max) {

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

NoDef3169

[SRC]def index(String domainName, Integer max) {

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

UnnecessarySetter3170

[SRC]setResourceByDomainName(domainName)

[MSG]setResourceByDomainName(..) can probably be rewritten as resourceByDomainName = ..

UnnecessaryGString3173

[SRC]params.sort = "id"

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

NoDef3174

[SRC]def resources = getResource().listOrderById(max: params...der: "desc")

[MSG]def for declaration should not be used

VariableTypeRequired3174

[SRC]def resources = getResource().listOrderById(max: params...der: "desc")

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

UnnecessaryGetter3174

[SRC]def resources = getResource().listOrderById(max: params...der: "desc")

[MSG]getResource() can probably be rewritten as resource

UnnecessaryGString3174

[SRC]def resources = getResource().listOrderById(max: params...der: "desc")

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

NoDef3176

[SRC]def count = getResource().count()

[MSG]def for declaration should not be used

VariableTypeRequired3176

[SRC]def count = getResource().count()

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

UnnecessaryGetter3176

[SRC]def count = getResource().count()

[MSG]getResource() can probably be rewritten as resource

NoDef3177

[SRC]def data = [

[MSG]def for declaration should not be used

VariableTypeRequired3177

[SRC]def data = [

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

UnnecessarySetter3186

[SRC]setResource(clazz)

[MSG]setResource(..) can probably be rewritten as resource = ..

➥ DomainMetaConfig.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class DomainMetaConfig {

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

FieldName215

[SRC]public static ConstraintTypeToDisplayMap = [

[MSG]The fieldname ConstraintTypeToDisplayMap in class tech.muyan.DomainMetaConfig does not match [a-z][a-zA-Z0-9]*

FieldName229

[SRC]public static AttributeTypeToClientTypeMap = [

[MSG]The fieldname AttributeTypeToClientTypeMap in class tech.muyan.DomainMetaConfig does not match [a-z][a-zA-Z0-9]*

DuplicateStringLiteral231

[SRC]"java.lang.Double" : "decimal",

[MSG]Duplicate String Literal: decimal

DuplicateStringLiteral233

[SRC]"java.lang.Long" : "integer",

[MSG]Duplicate String Literal: integer

DuplicateStringLiteral237

[SRC]"java.math.BigDecimal" : "decimal",

[MSG]Duplicate String Literal: decimal

FieldName246

[SRC]public static FieldNameToSpecialClientTypeMap = [

[MSG]The fieldname FieldNameToSpecialClientTypeMap in class tech.muyan.DomainMetaConfig does not match [a-z][a-zA-Z0-9]*

DuplicateStringLiteral252

[SRC]"tech.muyan.dynamic.DynamicLogic.targetField": "staticField",

[MSG]Duplicate String Literal: staticField

FieldName262

[SRC]public static DisplayComponentToTypeMapping = [:]

[MSG]The fieldname DisplayComponentToTypeMapping in class tech.muyan.DomainMetaConfig does not match [a-z][a-zA-Z0-9]*

DuplicateStringLiteral270

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.A..ATE, "date")

[MSG]Duplicate String Literal: date

DuplicateStringLiteral271

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.A.. "datetime")

[MSG]Duplicate String Literal: datetime

DuplicateStringLiteral272

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.., "decimal")

[MSG]Duplicate String Literal: decimal

DuplicateStringLiteral273

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.., "integer")

[MSG]Duplicate String Literal: integer

DuplicateStringLiteral280

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I..f_multiple")

[MSG]Duplicate String Literal: df_multiple

DuplicateStringLiteral281

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.., "df_tags")

[MSG]Duplicate String Literal: df_tags

DuplicateStringLiteral282

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.."df_single")

[MSG]Duplicate String Literal: df_single

DuplicateStringLiteral284

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F..f_multiple")

[MSG]Duplicate String Literal: df_multiple

DuplicateStringLiteral285

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.., "df_tags")

[MSG]Duplicate String Literal: df_tags

DuplicateStringLiteral286

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.."df_single")

[MSG]Duplicate String Literal: df_single

DuplicateStringLiteral291

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S..f_checkbox")

[MSG]Duplicate String Literal: df_checkbox

DuplicateStringLiteral292

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S.. "df_radio")

[MSG]Duplicate String Literal: df_radio

DuplicateStringLiteral294

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I..f_checkbox")

[MSG]Duplicate String Literal: df_checkbox

DuplicateStringLiteral295

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.. "df_radio")

[MSG]Duplicate String Literal: df_radio

FieldName2106

[SRC]public static MultipleSelectionTypes = [

[MSG]The fieldname MultipleSelectionTypes in class tech.muyan.DomainMetaConfig does not match [a-z][a-zA-Z0-9]*

FieldName2125

[SRC]public static SingleSelectionTypes = [

[MSG]The fieldname SingleSelectionTypes in class tech.muyan.DomainMetaConfig does not match [a-z][a-zA-Z0-9]*

FieldName2144

[SRC]public static IdFieldMetaData = [

[MSG]The fieldname IdFieldMetaData in class tech.muyan.DomainMetaConfig does not match [a-z][a-zA-Z0-9]*

DuplicateStringLiteral2146

[SRC]dataIndex: "id",

[MSG]Duplicate String Literal: id

DuplicateStringLiteral2147

[SRC]key : "id",

[MSG]Duplicate String Literal: id

DuplicateStringLiteral2151

[SRC]type : "integer"

[MSG]Duplicate String Literal: integer

FieldName2157

[SRC]public static HideDomain = [

[MSG]The fieldname HideDomain in class tech.muyan.DomainMetaConfig does not match [a-z][a-zA-Z0-9]*

FieldName2169

[SRC]public static String DynamicFieldKeyPrefix = "df_"

[MSG]The fieldname DynamicFieldKeyPrefix in class tech.muyan.DomainMetaConfig does not match [a-z][a-zA-Z0-9]*

FieldName2174

[SRC]public static final String DynamicPropertiesMapKey = "dynamic"

[MSG]The fieldname DynamicPropertiesMapKey in class tech.muyan.DomainMetaConfig does not match [A-Z][A-Z0-9_]*

FieldTypeRequired315

[SRC]public static ConstraintTypeToDisplayMap = [

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

UnnecessaryGString316

[SRC]"org.grails.datastore.gorm.validation.constraints.BlankC.. : "blank",

[MSG]The String 'org.grails.datastore.gorm.validation.constraints.BlankConstraint' can be wrapped in single quotes instead of double quotes

UnnecessaryGString316

[SRC]"org.grails.datastore.gorm.validation.constraints.BlankC.. : "blank",

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

UnnecessaryGString317

[SRC]"org.grails.datastore.gorm.validation.constraints.Nullab.. "nullable",

[MSG]The String 'org.grails.datastore.gorm.validation.constraints.NullableConstraint' can be wrapped in single quotes instead of double quotes

UnnecessaryGString317

[SRC]"org.grails.datastore.gorm.validation.constraints.Nullab.. "nullable",

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

UnnecessaryGString318

[SRC]"org.grails.datastore.gorm.validation.constraints.builti..": "unique",

[MSG]The String 'org.grails.datastore.gorm.validation.constraints.builtin.UniqueConstraint' can be wrapped in single quotes instead of double quotes

UnnecessaryGString318

[SRC]"org.grails.datastore.gorm.validation.constraints.builti..": "unique",

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

UnnecessaryGString319

[SRC]"org.grails.datastore.gorm.validation.constraints.Valida.."validator",

[MSG]The String 'org.grails.datastore.gorm.validation.constraints.ValidatorConstraint' can be wrapped in single quotes instead of double quotes

UnnecessaryGString319

[SRC]"org.grails.datastore.gorm.validation.constraints.Valida.."validator",

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

FieldTypeRequired329

[SRC]public static AttributeTypeToClientTypeMap = [

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

UnnecessaryGString330

[SRC]"java.lang.Float" : "decimal",

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

UnnecessaryGString330

[SRC]"java.lang.Float" : "decimal",

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

UnnecessaryGString331

[SRC]"java.lang.Double" : "decimal",

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

UnnecessaryGString331

[SRC]"java.lang.Double" : "decimal",

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

UnnecessaryGString332

[SRC]"java.lang.Integer" : "integer",

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

UnnecessaryGString332

[SRC]"java.lang.Integer" : "integer",

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

UnnecessaryGString333

[SRC]"java.lang.Long" : "integer",

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

UnnecessaryGString333

[SRC]"java.lang.Long" : "integer",

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

UnnecessaryGString334

[SRC]"java.time.LocalDateTime": "datetime",

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

UnnecessaryGString334

[SRC]"java.time.LocalDateTime": "datetime",

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

UnnecessaryGString335

[SRC]"java.time.LocalDate" : "date",

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

UnnecessaryGString335

[SRC]"java.time.LocalDate" : "date",

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

UnnecessaryGString336

[SRC]"java.lang.String" : "string",

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

UnnecessaryGString336

[SRC]"java.lang.String" : "string",

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

UnnecessaryGString337

[SRC]"java.math.BigDecimal" : "decimal",

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

UnnecessaryGString337

[SRC]"java.math.BigDecimal" : "decimal",

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

UnnecessaryGString338

[SRC]"java.lang.Boolean" : "boolean",

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

UnnecessaryGString338

[SRC]"java.lang.Boolean" : "boolean",

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

UnnecessaryGString339

[SRC]"java.util.Set" : "array",

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

UnnecessaryGString339

[SRC]"java.util.Set" : "array",

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

FieldTypeRequired346

[SRC]public static FieldNameToSpecialClientTypeMap = [

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

TrailingComma346

[SRC]public static FieldNameToSpecialClientTypeMap = [

[MSG]Map should contain trailing comma.

UnnecessaryGString348

[SRC]"tech.muyan.dynamic.field.DynamicFieldDefinition.options..n" : "tags",

[MSG]The String 'tech.muyan.dynamic.field.DynamicFieldDefinition.optionsJson' can be wrapped in single quotes instead of double quotes

UnnecessaryGString348

[SRC]"tech.muyan.dynamic.field.DynamicFieldDefinition.options..n" : "tags",

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

UnnecessaryGString350

[SRC]"tech.muyan.dynamic.DynamicLogic.code" : "code",

[MSG]The String 'tech.muyan.dynamic.DynamicLogic.code' can be wrapped in single quotes instead of double quotes

UnnecessaryGString350

[SRC]"tech.muyan.dynamic.DynamicLogic.code" : "code",

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

UnnecessaryGString351

[SRC]"tech.muyan.dynamic.DynamicLogic.triggerField": "staticField",

[MSG]The String 'tech.muyan.dynamic.DynamicLogic.triggerField' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]"tech.muyan.dynamic.DynamicLogic.triggerField": "staticField",

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

UnnecessaryGString352

[SRC]"tech.muyan.dynamic.DynamicLogic.targetField": "staticField",

[MSG]The String 'tech.muyan.dynamic.DynamicLogic.targetField' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]"tech.muyan.dynamic.DynamicLogic.targetField": "staticField",

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

UnnecessaryGString354

[SRC]"tech.muyan.security.RequestMap.httpMethod" : "httpMethod",

[MSG]The String 'tech.muyan.security.RequestMap.httpMethod' can be wrapped in single quotes instead of double quotes

UnnecessaryGString354

[SRC]"tech.muyan.security.RequestMap.httpMethod" : "httpMethod",

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

UnnecessaryGString356

[SRC]"tech.muyan.security.RequestMap.configAttribute": "roles"

[MSG]The String 'tech.muyan.security.RequestMap.configAttribute' can be wrapped in single quotes instead of double quotes

UnnecessaryGString356

[SRC]"tech.muyan.security.RequestMap.configAttribute": "roles"

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

FieldTypeRequired362

[SRC]public static DisplayComponentToTypeMapping = [:]

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

UnnecessaryGString369

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.T..REA, "text")

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

UnnecessaryGString370

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.A..ATE, "date")

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

UnnecessaryGString371

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.A.. "datetime")

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

UnnecessaryGString372

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.., "decimal")

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

UnnecessaryGString373

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.., "integer")

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

UnnecessaryGString374

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.P..percentage")

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

UnnecessaryObjectReferences374

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.P..percentage")

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

UnnecessaryGString375

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.C.. "currency")

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

UnnecessaryObjectReferences375

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.C.. "currency")

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

UnnecessaryGString376

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S..f_multiple")

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

UnnecessaryObjectReferences376

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S..f_multiple")

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

UnnecessaryGString377

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S.., "df_tags")

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

UnnecessaryObjectReferences377

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S.., "df_tags")

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

UnnecessaryGString378

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S.."df_single")

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

UnnecessaryObjectReferences378

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S.."df_single")

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

UnnecessaryGString380

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I..f_multiple")

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

UnnecessaryObjectReferences380

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I..f_multiple")

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

UnnecessaryGString381

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.., "df_tags")

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

UnnecessaryObjectReferences381

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.., "df_tags")

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

UnnecessaryGString382

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.."df_single")

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

UnnecessaryObjectReferences382

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.."df_single")

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

UnnecessaryGString384

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F..f_multiple")

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

UnnecessaryObjectReferences384

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F..f_multiple")

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

UnnecessaryGString385

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.., "df_tags")

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

UnnecessaryObjectReferences385

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.., "df_tags")

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

UnnecessaryGString386

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.."df_single")

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

UnnecessaryObjectReferences386

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.."df_single")

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

UnnecessaryGString388

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F..f_checkbox")

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

UnnecessaryObjectReferences388

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F..f_checkbox")

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

UnnecessaryGString389

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.. "df_radio")

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

UnnecessaryObjectReferences389

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.F.. "df_radio")

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

UnnecessaryGString391

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S..f_checkbox")

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

UnnecessaryObjectReferences391

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S..f_checkbox")

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

UnnecessaryGString392

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S.. "df_radio")

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

UnnecessaryObjectReferences392

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.S.. "df_radio")

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

UnnecessaryGString394

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I..f_checkbox")

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

UnnecessaryObjectReferences394

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I..f_checkbox")

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

UnnecessaryGString395

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.. "df_radio")

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

UnnecessaryObjectReferences395

[SRC]DisplayComponentToTypeMapping.put(DisplayComponentType.I.. "df_radio")

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

FieldTypeRequired3106

[SRC]public static MultipleSelectionTypes = [

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

FieldTypeRequired3125

[SRC]public static SingleSelectionTypes = [

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

FieldTypeRequired3144

[SRC]public static IdFieldMetaData = [

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

TrailingComma3144

[SRC]public static IdFieldMetaData = [

[MSG]Map should contain trailing comma.

UnnecessaryGString3145

[SRC]title : "id",

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

UnnecessaryGString3146

[SRC]dataIndex: "id",

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

UnnecessaryGString3147

[SRC]key : "id",

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

UnnecessaryGString3151

[SRC]type : "integer"

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

FieldTypeRequired3157

[SRC]public static HideDomain = [

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

UnnecessaryGString3158

[SRC]"DummyDomain",

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

UnnecessaryGString3159

[SRC]"DomainClass",

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

UnnecessaryGString3160

[SRC]"ContractLine",

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

UnnecessaryGString3161

[SRC]"DynamicFieldValue",

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

UnnecessaryGString3162

[SRC]"AuthenticationToken",

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

UnnecessaryGString3163

[SRC]"UserRole",

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

UnnecessaryGString3169

[SRC]public static String DynamicFieldKeyPrefix = "df_"

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

UnnecessaryGString3174

[SRC]public static final String DynamicPropertiesMapKey = "dynamic"

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

➥ DomainMetaController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic221

[SRC]class DomainMetaController {

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

DuplicateNumberLiteral264

[SRC]if (requestMap.getConfigAttribute().indexOf("permitAll") > -1) {

[MSG]Duplicate Number Literal: -1

DuplicateNumberLiteral286

[SRC]if (requestMap != null && requestMap.getConfigAttribute(..ll") > -1) {

[MSG]Duplicate Number Literal: -1

DuplicateStringLiteral286

[SRC]if (requestMap != null && requestMap.getConfigAttribute(..ll") > -1) {

[MSG]Duplicate String Literal: permitAll

DuplicateStringLiteral297

[SRC]meta.put('form', [

[MSG]Duplicate String Literal: form

DuplicateNumberLiteral2138

[SRC]if (requestMap.getConfigAttribute().indexOf("permitAll") > -1) {

[MSG]Duplicate Number Literal: -1

DuplicateStringLiteral2138

[SRC]if (requestMap.getConfigAttribute().indexOf("permitAll") > -1) {

[MSG]Duplicate String Literal: permitAll

Instanceof2144

[SRC]if (it instanceof SimpleGrantedAuthority) {

[MSG]The instanceof operator is used in class tech.muyan.DomainMetaController

DuplicateNumberLiteral2147

[SRC]if (!"".equals(authority) && attribute.indexOf(authority) > -1) {

[MSG]Duplicate Number Literal: -1

VariableName2176

[SRC]final fieldsMap = [:]

[MSG]Variable named fieldsMap in class tech.muyan.DomainMetaController does not match the pattern [A-Z][A-Z0-9_]*

NoWildcardImports34

[SRC]import grails.gorm.transactions.*

[MSG]Wildcard (star) import

MisorderedStaticImports317

[SRC]import static tech.muyan.DomainMetaConfig.*

[MSG]Static imports should appear before normal imports

NoWildcardImports317

[SRC]import static tech.muyan.DomainMetaConfig.*

[MSG]Wildcard (star) import

MisorderedStaticImports318

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

[MSG]Static imports should appear before normal imports

NoWildcardImports318

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

[MSG]Wildcard (star) import

FieldTypeRequired322

[SRC]static responseFormats = ['json', 'html']

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

MethodReturnTypeRequired328

[SRC]def subMenus(long menuId) {

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

NoDef328

[SRC]def subMenus(long menuId) {

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

MethodReturnTypeRequired334

[SRC]def topMenus() {

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

NoDef334

[SRC]def topMenus() {

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

MethodParameterTypeRequired339

[SRC]List getSubMenuOfParent(parentMenu) {

[MSG]"parentMenu" parameter of "getSubMenuOfParent" method is dynamically typed

NoDef339

[SRC]List getSubMenuOfParent(parentMenu) {

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

NoDef341

[SRC]def auth = springSecurityService.authentication

[MSG]def for declaration should not be used

VariableTypeRequired341

[SRC]def auth = springSecurityService.authentication

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

NoDef342

[SRC]def authorities = auth.getAuthorities()

[MSG]def for declaration should not be used

VariableTypeRequired342

[SRC]def authorities = auth.getAuthorities()

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

UnnecessaryGetter342

[SRC]def authorities = auth.getAuthorities()

[MSG]getAuthorities() can probably be rewritten as authorities

NoDef343

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

[MSG]def for declaration should not be used

VariableTypeRequired343

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

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

TrailingComma346

[SRC]Map<String, Object> meta = [

[MSG]Map should contain trailing comma.

NoDef354

[SRC]def linkUrl = menu.link

[MSG]def for declaration should not be used

VariableTypeRequired354

[SRC]def linkUrl = menu.link

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

NoDef355

[SRC]def indexOfQuestionMark = linkUrl.indexOf("?")

[MSG]def for declaration should not be used

VariableTypeRequired355

[SRC]def indexOfQuestionMark = linkUrl.indexOf("?")

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

UnnecessaryGString355

[SRC]def indexOfQuestionMark = linkUrl.indexOf("?")

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

NoDef356

[SRC]def linkUrlWithoutParameters = (indexOfQuestionMark > -1)?

[MSG]def for declaration should not be used

VariableTypeRequired356

[SRC]def linkUrlWithoutParameters = (indexOfQuestionMark > -1)?

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

UnnecessarySubstring357

[SRC]linkUrl?.substring(0, indexOfQuestionMark) : linkUrl

[MSG]Violation in class tech.muyan.DomainMetaController. The String.substring(int, int) method can be replaced with the subscript operator

UnnecessarySemicolon361

[SRC]boolean hasPermission = false;

[MSG]Semicolons as line endings can be removed safely

NoDef363

[SRC]def requestMap = requestMaps.get(0)

[MSG]def for declaration should not be used

VariableTypeRequired363

[SRC]def requestMap = requestMaps.get(0)

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

UnnecessaryGetter364

[SRC]if (requestMap.getConfigAttribute().indexOf("permitAll") > -1) {

[MSG]getConfigAttribute() can probably be rewritten as configAttribute

UnnecessaryGString364

[SRC]if (requestMap.getConfigAttribute().indexOf("permitAll") > -1) {

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

UnnecessarySemicolon365

[SRC]hasPermission = true;

[MSG]Semicolons as line endings can be removed safely

NoDef367

[SRC]def attribute = requestMap.getConfigAttribute()

[MSG]def for declaration should not be used

VariableTypeRequired367

[SRC]def attribute = requestMap.getConfigAttribute()

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

UnnecessaryGetter367

[SRC]def attribute = requestMap.getConfigAttribute()

[MSG]getConfigAttribute() can probably be rewritten as configAttribute

UnnecessarySemicolon385

[SRC]boolean hasPermission = false;

[MSG]Semicolons as line endings can be removed safely

UnnecessaryGetter386

[SRC]if (requestMap != null && requestMap.getConfigAttribute(..ll") > -1) {

[MSG]getConfigAttribute() can probably be rewritten as configAttribute

UnnecessaryGString386

[SRC]if (requestMap != null && requestMap.getConfigAttribute(..ll") > -1) {

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

TrailingComma388

[SRC]meta.put('form', [

[MSG]Map should contain trailing comma.

NoDef394

[SRC]def attribute = requestMap.getConfigAttribute()

[MSG]def for declaration should not be used

VariableTypeRequired394

[SRC]def attribute = requestMap.getConfigAttribute()

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

UnnecessaryGetter394

[SRC]def attribute = requestMap.getConfigAttribute()

[MSG]getConfigAttribute() can probably be rewritten as configAttribute

TrailingComma397

[SRC]meta.put('form', [

[MSG]Map should contain trailing comma.

UnnecessaryGString3108

[SRC]log.warn("domain class associate to menu [{}/{}] is empt.. menu.label)

[MSG]The String 'domain class associate to menu [{}/{}] is empty' can be wrapped in single quotes instead of double quotes

UnnecessaryReturnKeyword3118

[SRC]return result

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

MethodReturnTypeRequired3129

[SRC]def list() {

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

NoDef3129

[SRC]def list() {

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

NoDef3130

[SRC]def list = new HashSet()

[MSG]def for declaration should not be used

VariableTypeRequired3130

[SRC]def list = new HashSet()

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

NoDef3131

[SRC]def auth = springSecurityService.authentication

[MSG]def for declaration should not be used

VariableTypeRequired3131

[SRC]def auth = springSecurityService.authentication

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

NoDef3132

[SRC]def authorities = auth.getAuthorities()

[MSG]def for declaration should not be used

VariableTypeRequired3132

[SRC]def authorities = auth.getAuthorities()

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

UnnecessaryGetter3132

[SRC]def authorities = auth.getAuthorities()

[MSG]getAuthorities() can probably be rewritten as authorities

UnnecessaryGetter3133

[SRC]DomainClass.getAll().each { domainClazz ->

[MSG]getAll() can probably be rewritten as all

NoDef3134

[SRC]def sn = domainClazz.shortName

[MSG]def for declaration should not be used

VariableTypeRequired3134

[SRC]def sn = domainClazz.shortName

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

NoDef3136

[SRC]def requestMap = RequestMap.findByUrlAndHttpMethod("/${s..pMethod.GET)

[MSG]def for declaration should not be used

VariableTypeRequired3136

[SRC]def requestMap = RequestMap.findByUrlAndHttpMethod("/${s..pMethod.GET)

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

UnnecessaryGetter3138

[SRC]if (requestMap.getConfigAttribute().indexOf("permitAll") > -1) {

[MSG]getConfigAttribute() can probably be rewritten as configAttribute

UnnecessaryGString3138

[SRC]if (requestMap.getConfigAttribute().indexOf("permitAll") > -1) {

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

NoDef3141

[SRC]def attribute = requestMap.getConfigAttribute()

[MSG]def for declaration should not be used

VariableTypeRequired3141

[SRC]def attribute = requestMap.getConfigAttribute()

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

UnnecessaryGetter3141

[SRC]def attribute = requestMap.getConfigAttribute()

[MSG]getConfigAttribute() can probably be rewritten as configAttribute

UnnecessaryGString3143

[SRC]String authority = ""

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

ImplicitClosureParameter3144

[SRC]if (it instanceof SimpleGrantedAuthority) {

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

ImplicitClosureParameter3145

[SRC]authority = ((SimpleGrantedAuthority) it).authority

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

UnnecessaryGString3147

[SRC]if (!"".equals(authority) && attribute.indexOf(authority) > -1) {

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

MethodReturnTypeRequired3164

[SRC]def get(String domainName, String formId) {

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

NoDef3164

[SRC]def get(String domainName, String formId) {

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

NoDef3168

[SRC]def result = []

[MSG]def for declaration should not be used

VariableTypeRequired3168

[SRC]def result = []

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

UnnecessaryGetter3171

[SRC]if (null != form && form.getFields().size() > 0) {

[MSG]getFields() can probably be rewritten as fields

UnnecessaryGetter3174

[SRC]List<DynamicFormField> fields = new ArrayList(form.getFields())

[MSG]getFields() can probably be rewritten as fields

NoDef3176

[SRC]final fieldsMap = [:]

[MSG]def for declaration should not be used

VariableTypeRequired3176

[SRC]final fieldsMap = [:]

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

ImplicitClosureParameter3177

[SRC]allFields.forEach { it ->

[MSG]By convention "it" should not be used as a closure parameter name.

NoDef3181

[SRC]def meta = fieldsMap.get(field.fieldName)

[MSG]def for declaration should not be used

VariableTypeRequired3181

[SRC]def meta = fieldsMap.get(field.fieldName)

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

MethodReturnTypeRequired3196

[SRC]def getForm(String domainName, String formType) {

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

NoDef3196

[SRC]def getForm(String domainName, String formType) {

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

NoDef3199

[SRC]def result = [id: (form == null)? -1 : form.id]

[MSG]def for declaration should not be used

VariableTypeRequired3199

[SRC]def result = [id: (form == null)? -1 : form.id]

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

➥ DummyDomain.groovy

Rule NamePriorityLine #Source Line / Message
EmptyClass28

[SRC]class DummyDomain {

[MSG]Class 'DummyDomain' is empty (has no methods, fields or properties). Why would you need a class like this?

CompileStatic28

[SRC]class DummyDomain {

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

GrailsDomainHasEquals28

[SRC]class DummyDomain {

[MSG]The domain class tech.muyan.DummyDomain should define an equals(Object) method

GrailsDomainHasToString28

[SRC]class DummyDomain {

[MSG]The domain class tech.muyan.DummyDomain should define a toString() method

➥ EnumController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]class EnumController {

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

ClassForName222

[SRC]Class obj = Class.forName(type)

[MSG]Violation in class tech.muyan.EnumController. Methods calls to Class.forName(...) can create resource leaks and should almost always be replaced with calls to ClassLoader.loadClass(...)

MethodReturnTypeRequired320

[SRC]def get(String enumType) {

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

NoDef320

[SRC]def get(String enumType) {

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

NoDef323

[SRC]def options = obj.getEnumConstants()

[MSG]def for declaration should not be used

VariableTypeRequired323

[SRC]def options = obj.getEnumConstants()

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

UnnecessaryGetter323

[SRC]def options = obj.getEnumConstants()

[MSG]getEnumConstants() can probably be rewritten as enumConstants

NoDef324

[SRC]def optionKeys = []

[MSG]def for declaration should not be used

VariableTypeRequired324

[SRC]def optionKeys = []

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

NoDef326

[SRC]def key = opt.toString()

[MSG]def for declaration should not be used

VariableTypeRequired326

[SRC]def key = opt.toString()

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

NoDef327

[SRC]def label = opt.hasProperty("label") ? opt.getLabel() : key

[MSG]def for declaration should not be used

VariableTypeRequired327

[SRC]def label = opt.hasProperty("label") ? opt.getLabel() : key

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

UnnecessaryGetter327

[SRC]def label = opt.hasProperty("label") ? opt.getLabel() : key

[MSG]getLabel() can probably be rewritten as label

UnnecessaryGString327

[SRC]def label = opt.hasProperty("label") ? opt.getLabel() : key

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

TrailingComma328

[SRC]optionKeys.add([

[MSG]Map should contain trailing comma.

➥ OptionsController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic214

[SRC]class OptionsController {

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

MisorderedStaticImports36

[SRC]import static tech.muyan.DomainMetaConfig.DynamicFieldKeyPrefix

[MSG]Static imports should appear before normal imports

MethodReturnTypeRequired316

[SRC]def get(String objectDynamicFieldId) {

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

NoDef316

[SRC]def get(String objectDynamicFieldId) {

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

NoDef317

[SRC]def key = objectDynamicFieldId.substring(DynamicFieldKey..ix.length())

[MSG]def for declaration should not be used

VariableTypeRequired317

[SRC]def key = objectDynamicFieldId.substring(DynamicFieldKey..ix.length())

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

UnnecessarySubstring317

[SRC]def key = objectDynamicFieldId.substring(DynamicFieldKey..ix.length())

[MSG]Violation in class tech.muyan.OptionsController. The String.substring(int) method can be replaced with the subscript operator

NoDef318

[SRC]def odf = ObjectDynamicField.get(Long.parseLong(key))

[MSG]def for declaration should not be used

VariableTypeRequired318

[SRC]def odf = ObjectDynamicField.get(Long.parseLong(key))

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

➥ Organization.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic25

[SRC]class Organization extends WithDynamicFields<Organization> {

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

GrailsDomainHasEquals25

[SRC]class Organization extends WithDynamicFields<Organization> {

[MSG]The domain class tech.muyan.Organization should define an equals(Object) method

GrailsDomainHasToString25

[SRC]class Organization extends WithDynamicFields<Organization> {

[MSG]The domain class tech.muyan.Organization should define a toString() method

GrailsDomainStringPropertyMaxSize211

[SRC]String name

[MSG]There is no constraint on the size of String property 'name' which will result in applying database defaults

FieldTypeRequired37

[SRC]static hasMany = [contracts: Contract, children: Organiz..users: User]

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

FieldTypeRequired313

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields313

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.Organization is declared after an instance field

FieldTypeRequired318

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields318

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.Organization is declared after an instance field

UnnecessaryGString320

[SRC]only = ["name"]

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

FieldTypeRequired323

[SRC]static labelField = "name"

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

StaticFieldsBeforeInstanceFields323

[SRC]static labelField = "name"

[MSG]The static field labelField in class tech.muyan.Organization is declared after an instance field

UnnecessaryGString323

[SRC]static labelField = "name"

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

➥ RelateDataController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic26

[SRC]class RelateDataController extends RestfulController {

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

Instanceof235

[SRC]if (properties instanceof Set || properties instanceof List) {

[MSG]The instanceof operator is used in class tech.muyan.RelateDataController

Instanceof235

[SRC]if (properties instanceof Set || properties instanceof List) {

[MSG]The instanceof operator is used in class tech.muyan.RelateDataController

NoWildcardImports33

[SRC]import grails.rest.*

[MSG]Wildcard (star) import

FieldTypeRequired313

[SRC]static scope = "prototype"

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

UnnecessaryGString313

[SRC]static scope = "prototype"

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

FieldTypeRequired315

[SRC]static responseFormats = ['json', 'xml']

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

UnnecessaryDotClass318

[SRC]super(DummyDomain.class)

[MSG]DummyDomain.class can be rewritten as DummyDomain

MethodReturnTypeRequired328

[SRC]def get(String domainName, long id, String columnName) {

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

NoDef328

[SRC]def get(String domainName, long id, String columnName) {

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

NoDef329

[SRC]def clazz = DomainHelper.getClazzFromDomainName(domainName)

[MSG]def for declaration should not be used

VariableTypeRequired329

[SRC]def clazz = DomainHelper.getClazzFromDomainName(domainName)

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

UnnecessarySemicolon330

[SRC]setResource(clazz);

[MSG]Semicolons as line endings can be removed safely

UnnecessarySetter330

[SRC]setResource(clazz);

[MSG]setResource(..) can probably be rewritten as resource = ..

NoDef331

[SRC]def domain = getResource().get(id)

[MSG]def for declaration should not be used

VariableTypeRequired331

[SRC]def domain = getResource().get(id)

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

UnnecessaryGetter331

[SRC]def domain = getResource().get(id)

[MSG]getResource() can probably be rewritten as resource

NoDef333

[SRC]def properties = domain.getProperty(columnName)

[MSG]def for declaration should not be used

VariableTypeRequired333

[SRC]def properties = domain.getProperty(columnName)

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

NoDef334

[SRC]def result = []

[MSG]def for declaration should not be used

VariableTypeRequired334

[SRC]def result = []

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

NoDef336

[SRC]def offset = Integer.valueOf(params.offset ? params.offset : 0) ?: 0

[MSG]def for declaration should not be used

VariableTypeRequired336

[SRC]def offset = Integer.valueOf(params.offset ? params.offset : 0) ?: 0

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

NoDef337

[SRC]def maxParam = Integer.valueOf(params.max ? params.max : 10) ?: 10

[MSG]def for declaration should not be used

VariableTypeRequired337

[SRC]def maxParam = Integer.valueOf(params.max ? params.max : 10) ?: 10

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

NoDef338

[SRC]def actualMax = properties.size() > maxParam ? maxParam ..rties.size()

[MSG]def for declaration should not be used

VariableTypeRequired338

[SRC]def actualMax = properties.size() > maxParam ? maxParam ..rties.size()

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

NoDef344

[SRC]def isDomainObject = DomainHelper.isDomainClass(p.getCla..).getName())

[MSG]def for declaration should not be used

VariableTypeRequired344

[SRC]def isDomainObject = DomainHelper.isDomainClass(p.getCla..).getName())

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

UnnecessaryGetter344

[SRC]def isDomainObject = DomainHelper.isDomainClass(p.getCla..).getName())

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

NoDef351

[SRC]def data = [

[MSG]def for declaration should not be used

VariableTypeRequired351

[SRC]def data = [

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

➥ SearchController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic234

[SRC]class SearchController {

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

ClassForName254

[SRC]def clazz = Class.forName(javaType, true, getClass().classLoader)

[MSG]Violation in class tech.muyan.SearchController. Methods calls to Class.forName(...) can create resource leaks and should almost always be replaced with calls to ClassLoader.loadClass(...)

DuplicateStringLiteral2115

[SRC]Object value = (obj.has("value"))? obj.get("value") : null

[MSG]Duplicate String Literal: value

DuplicateStringLiteral2115

[SRC]Object value = (obj.has("value"))? obj.get("value") : null

[MSG]Duplicate String Literal: value

Instanceof2129

[SRC]def isObjectConverter = converter instanceof ObjectConverter

[MSG]The instanceof operator is used in class tech.muyan.SearchController

Instanceof2133

[SRC]Object convertedValue = (value instanceof List)?

[MSG]The instanceof operator is used in class tech.muyan.SearchController

Instanceof2138

[SRC]if (convertedValue instanceof List) {

[MSG]The instanceof operator is used in class tech.muyan.SearchController

Instanceof2148

[SRC]if (convertedValue instanceof List) {

[MSG]The instanceof operator is used in class tech.muyan.SearchController

EmptyIfStatement2176

[SRC]} else if (matchMode == "between") {

[MSG]The if statement is empty

FieldTypeRequired335

[SRC]static responseFormats = ['json', 'xml']

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

MethodReturnTypeRequired351

[SRC]def search(String domainName, String fieldName, String fieldType) {

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

NoDef351

[SRC]def search(String domainName, String fieldName, String fieldType) {

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

NoDef352

[SRC]def q = params.q

[MSG]def for declaration should not be used

VariableTypeRequired352

[SRC]def q = params.q

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

NoDef353

[SRC]def javaType = StringHelper.pathTypeToJavaType(fieldType)

[MSG]def for declaration should not be used

VariableTypeRequired353

[SRC]def javaType = StringHelper.pathTypeToJavaType(fieldType)

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

NoDef354

[SRC]def clazz = Class.forName(javaType, true, getClass().classLoader)

[MSG]def for declaration should not be used

VariableTypeRequired354

[SRC]def clazz = Class.forName(javaType, true, getClass().classLoader)

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

NoDef357

[SRC]def searchLogics = DynamicLogic.where {

[MSG]def for declaration should not be used

VariableTypeRequired357

[SRC]def searchLogics = DynamicLogic.where {

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

UnnecessaryGetter358

[SRC]targetField == fieldName && objectType.fullName == owner..cType.SEARCH

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

NoDef362

[SRC]def auth = springSecurityService.authentication

[MSG]def for declaration should not be used

VariableTypeRequired362

[SRC]def auth = springSecurityService.authentication

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

UnnecessaryGString364

[SRC]params.put("ownerClass", ownerClass)

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

UnnecessaryGString365

[SRC]params.put("fieldName", fieldName)

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

UnnecessaryGString366

[SRC]params.put("fieldClass", clazz)

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

UnnecessaryGString367

[SRC]params.put("keyword", q)

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

UnnecessaryGString368

[SRC]params.put("userContext", auth)

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

UnnecessaryGString370

[SRC]respond resultFromCustomLogic.get("result")

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

NoDef372

[SRC]def result = []

[MSG]def for declaration should not be used

VariableTypeRequired372

[SRC]def result = []

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

UnnecessaryGetter374

[SRC]if (esResult.getTotal().value > 0) {

[MSG]getTotal() can probably be rewritten as total

NoDef375

[SRC]def searchResults = esResult.searchResults

[MSG]def for declaration should not be used

VariableTypeRequired375

[SRC]def searchResults = esResult.searchResults

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

TrailingComma378

[SRC]result.add([

[MSG]Map should contain trailing comma.

MethodReturnTypeRequired398

[SRC]def searchObjectList(String domainName) {

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

NoDef398

[SRC]def searchObjectList(String domainName) {

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

NoDef399

[SRC]def conditions = request.JSON

[MSG]def for declaration should not be used

VariableTypeRequired399

[SRC]def conditions = request.JSON

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

NoDef3100

[SRC]def ownerClass = params.ownerClass

[MSG]def for declaration should not be used

VariableTypeRequired3100

[SRC]def ownerClass = params.ownerClass

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

NoDef3101

[SRC]def ownerId = params.ownerId

[MSG]def for declaration should not be used

VariableTypeRequired3101

[SRC]def ownerId = params.ownerId

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

NoDef3102

[SRC]def ownerClassColumnName = params.ownerClassColumnName

[MSG]def for declaration should not be used

VariableTypeRequired3102

[SRC]def ownerClassColumnName = params.ownerClassColumnName

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

NoDef3103

[SRC]def max = params.max

[MSG]def for declaration should not be used

VariableTypeRequired3103

[SRC]def max = params.max

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

NoDef3104

[SRC]def offset = params.offset

[MSG]def for declaration should not be used

VariableTypeRequired3104

[SRC]def offset = params.offset

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

NoDef3107

[SRC]def searchResult = domainClazz.createCriteria().list(max..t: offset) {

[MSG]def for declaration should not be used

VariableTypeRequired3107

[SRC]def searchResult = domainClazz.createCriteria().list(max..t: offset) {

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

NoDef3110

[SRC]def owner = ownerClazz.get(ownerId)

[MSG]def for declaration should not be used

VariableTypeRequired3110

[SRC]def owner = ownerClazz.get(ownerId)

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

UnnecessaryGString3114

[SRC]JSONObject obj = queryInfo.getAt("value") as JSONObject

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

UnnecessaryGString3115

[SRC]Object value = (obj.has("value"))? obj.get("value") : null

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

UnnecessaryGString3115

[SRC]Object value = (obj.has("value"))? obj.get("value") : null

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

UnnecessaryGString3116

[SRC]String columnKey = obj.get("columnKey")

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

UnnecessaryGString3117

[SRC]String matchMode = obj.get("matchMode")

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

CouldBeSwitchStatement3118

[SRC]if (matchMode == "isEmpty") {

[MSG]Code could use switch statement

UnnecessaryGString3118

[SRC]if (matchMode == "isEmpty") {

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

UnnecessaryGString3120

[SRC]} else if (matchMode == "isNotEmpty") {

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

UnnecessaryGString3122

[SRC]} else if (matchMode == "hasNoRelated") {

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

UnnecessaryGString3124

[SRC]} else if (matchMode == "hasRelated") {

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

NoDef3129

[SRC]def isObjectConverter = converter instanceof ObjectConverter

[MSG]def for declaration should not be used

VariableTypeRequired3129

[SRC]def isObjectConverter = converter instanceof ObjectConverter

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

UnnecessaryGString3131

[SRC]converter = ConverterFactory.getConverter("id")

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

UnnecessaryGString3137

[SRC]if (matchMode == "=") {

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

UnnecessaryGString3147

[SRC]} else if (matchMode == "!=") {

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

UnnecessaryGString3157

[SRC]} else if (matchMode == ">" || matchMode == "after") {

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

UnnecessaryGString3157

[SRC]} else if (matchMode == ">" || matchMode == "after") {

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

UnnecessaryGString3159

[SRC]} else if (matchMode == "<" || matchMode == "before") {

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

UnnecessaryGString3159

[SRC]} else if (matchMode == "<" || matchMode == "before") {

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

UnnecessaryGString3161

[SRC]} else if (matchMode == ">=" || matchMode == "afterOrEqual") {

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

UnnecessaryGString3161

[SRC]} else if (matchMode == ">=" || matchMode == "afterOrEqual") {

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

UnnecessaryGString3163

[SRC]} else if (matchMode == "<=" || matchMode == "beforeOrEqual") {

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

UnnecessaryGString3163

[SRC]} else if (matchMode == "<=" || matchMode == "beforeOrEqual") {

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

CouldBeSwitchStatement3165

[SRC]} else if (matchMode == "endsWith") {

[MSG]Code could use switch statement

CouldBeSwitchStatement3165

[SRC]} else if (matchMode == "endsWith") {

[MSG]Code could use switch statement

UnnecessaryGString3165

[SRC]} else if (matchMode == "endsWith") {

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

UnnecessaryGString3167

[SRC]} else if (matchMode == "startsWith") {

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

UnnecessaryGString3169

[SRC]} else if (matchMode == "contains") {

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

UnnecessaryGString3171

[SRC]} else if (matchMode == "notContains") {

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

UnnecessaryGString3176

[SRC]} else if (matchMode == "between") {

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

UnnecessaryGString3178

[SRC]} else if (matchMode == "isOneOf") {

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

UnnecessaryGString3181

[SRC]} else if (matchMode == "isNotAnyOf") {

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

NoDef3193

[SRC]def result = [

[MSG]def for declaration should not be used

TrailingComma3193

[SRC]def result = [

[MSG]Map should contain trailing comma.

VariableTypeRequired3193

[SRC]def result = [

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

➥ StorageFieldValue.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class StorageFieldValue {

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

GrailsDomainHasEquals210

[SRC]class StorageFieldValue {

[MSG]The domain class tech.muyan.StorageFieldValue should define an equals(Object) method

GrailsDomainHasToString210

[SRC]class StorageFieldValue {

[MSG]The domain class tech.muyan.StorageFieldValue should define a toString() method

GrailsDomainReservedSqlKeywordName220

[SRC]String key

[MSG]'key' is a reserved SQL keyword and - as such - a problematic domain class' field name.

GrailsDomainStringPropertyMaxSize220

[SRC]String key

[MSG]There is no constraint on the size of String property 'key' which will result in applying database defaults

FieldTypeRequired327

[SRC]static mapping = {

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

StaticFieldsBeforeInstanceFields327

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.StorageFieldValue is declared after an instance field

FieldTypeRequired332

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields332

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.StorageFieldValue is declared after an instance field

FieldTypeRequired338

[SRC]static labelField = "key"

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

StaticFieldsBeforeInstanceFields338

[SRC]static labelField = "key"

[MSG]The static field labelField in class tech.muyan.StorageFieldValue is declared after an instance field

UnnecessaryGString338

[SRC]static labelField = "key"

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

➥ UniqueValidController.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic215

[SRC]class UniqueValidController extends RestfulController {

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

Instanceof241

[SRC]if (unique instanceof Boolean) {

[MSG]The instanceof operator is used in class tech.muyan.UniqueValidController

Instanceof249

[SRC]} else if (unique instanceof JSONArray) {

[MSG]The instanceof operator is used in class tech.muyan.UniqueValidController

DuplicateStringLiteral297

[SRC]ne("id", id)

[MSG]Duplicate String Literal: id

MethodReturnTypeRequired332

[SRC]def valid(String domainName, String columnName) {

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

NoDef332

[SRC]def valid(String domainName, String columnName) {

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

UnnecessaryDefInMethodDeclaration332

[SRC]def valid(String domainName, String columnName) {

[MSG]Violation in class tech.muyan.UniqueValidController. The def keyword is unneeded when a method returns the Object type

UnnecessarySetter333

[SRC]setResourceByDomainName(domainName)

[MSG]setResourceByDomainName(..) can probably be rewritten as resourceByDomainName = ..

NoDef334

[SRC]def id = Long.valueOf(params.id)

[MSG]def for declaration should not be used

VariableTypeRequired334

[SRC]def id = Long.valueOf(params.id)

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

NoDef335

[SRC]def value = params.v

[MSG]def for declaration should not be used

VariableTypeRequired335

[SRC]def value = params.v

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

NoDef336

[SRC]def create = params.create

[MSG]def for declaration should not be used

VariableTypeRequired336

[SRC]def create = params.create

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

NoDef337

[SRC]def isCreate = "true".equals(create)

[MSG]def for declaration should not be used

VariableTypeRequired337

[SRC]def isCreate = "true".equals(create)

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

UnnecessaryGString337

[SRC]def isCreate = "true".equals(create)

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

NoDef338

[SRC]def json = request.JSON

[MSG]def for declaration should not be used

VariableTypeRequired338

[SRC]def json = request.JSON

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

NoDef339

[SRC]def unique = json.unique

[MSG]def for declaration should not be used

VariableTypeRequired339

[SRC]def unique = json.unique

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

NoDef340

[SRC]def result = [:]

[MSG]def for declaration should not be used

VariableTypeRequired340

[SRC]def result = [:]

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

NoDef342

[SRC]def hasDuplicate = isCreate? getResource().withCriteria {

[MSG]def for declaration should not be used

VariableTypeRequired342

[SRC]def hasDuplicate = isCreate? getResource().withCriteria {

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

UnnecessaryGetter342

[SRC]def hasDuplicate = isCreate? getResource().withCriteria {

[MSG]getResource() can probably be rewritten as resource

UnnecessaryGetter344

[SRC]} : getResource().withCriteria {

[MSG]getResource() can probably be rewritten as resource

UnnecessaryGString346

[SRC]ne("id", id)

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

UnnecessaryGString348

[SRC]result = [valid: (hasDuplicate == null || hasDuplicate.s.." : "false"]

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

UnnecessaryGString348

[SRC]result = [valid: (hasDuplicate == null || hasDuplicate.s.." : "false"]

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

NoDef350

[SRC]def fields = unique as JSONArray

[MSG]def for declaration should not be used

VariableTypeRequired350

[SRC]def fields = unique as JSONArray

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

NoDef351

[SRC]def record = json.record as JSONObject

[MSG]def for declaration should not be used

VariableTypeRequired351

[SRC]def record = json.record as JSONObject

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

NoDef352

[SRC]def hasDuplicate = isCreate? getResource().withCriteria {

[MSG]def for declaration should not be used

VariableTypeRequired352

[SRC]def hasDuplicate = isCreate? getResource().withCriteria {

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

UnnecessaryGetter352

[SRC]def hasDuplicate = isCreate? getResource().withCriteria {

[MSG]getResource() can probably be rewritten as resource

NoDef353

[SRC]def columnType = getResource().getDeclaredField(columnName).type

[MSG]def for declaration should not be used

VariableTypeRequired353

[SRC]def columnType = getResource().getDeclaredField(columnName).type

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

UnnecessaryGetter353

[SRC]def columnType = getResource().getDeclaredField(columnName).type

[MSG]getResource() can probably be rewritten as resource

NoDef355

[SRC]def transferValue = columnType.isEnum()? columnType.valu..lue) : value

[MSG]def for declaration should not be used

VariableTypeRequired355

[SRC]def transferValue = columnType.isEnum()? columnType.valu..lue) : value

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

UnnecessaryGetter355

[SRC]def transferValue = columnType.isEnum()? columnType.valu..lue) : value

[MSG]isEnum() can probably be rewritten as enum

NoDef362

[SRC]def rawVal = record.get(field)

[MSG]def for declaration should not be used

VariableTypeRequired362

[SRC]def rawVal = record.get(field)

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

NoDef364

[SRC]def fieldType = getResource().getDeclaredField(field).type

[MSG]def for declaration should not be used

VariableTypeRequired364

[SRC]def fieldType = getResource().getDeclaredField(field).type

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

UnnecessaryGetter364

[SRC]def fieldType = getResource().getDeclaredField(field).type

[MSG]getResource() can probably be rewritten as resource

NoDef366

[SRC]def fieldValue = fieldType.isEnum()? fieldType.valueOf(r..al) : rawVal

[MSG]def for declaration should not be used

VariableTypeRequired366

[SRC]def fieldValue = fieldType.isEnum()? fieldType.valueOf(r..al) : rawVal

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

UnnecessaryGetter366

[SRC]def fieldValue = fieldType.isEnum()? fieldType.valueOf(r..al) : rawVal

[MSG]isEnum() can probably be rewritten as enum

UnnecessaryGetter375

[SRC]} : getResource().withCriteria {

[MSG]getResource() can probably be rewritten as resource

NoDef376

[SRC]def columnType = getResource().getDeclaredField(columnName).type

[MSG]def for declaration should not be used

VariableTypeRequired376

[SRC]def columnType = getResource().getDeclaredField(columnName).type

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

UnnecessaryGetter376

[SRC]def columnType = getResource().getDeclaredField(columnName).type

[MSG]getResource() can probably be rewritten as resource

NoDef377

[SRC]def transferValue = columnType.isEnum()? columnType.valu..lue) : value

[MSG]def for declaration should not be used

VariableTypeRequired377

[SRC]def transferValue = columnType.isEnum()? columnType.valu..lue) : value

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

UnnecessaryGetter377

[SRC]def transferValue = columnType.isEnum()? columnType.valu..lue) : value

[MSG]isEnum() can probably be rewritten as enum

NoDef385

[SRC]def rawVal = record.get(field)

[MSG]def for declaration should not be used

VariableTypeRequired385

[SRC]def rawVal = record.get(field)

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

NoDef387

[SRC]def fieldType = getResource().getDeclaredField(field).type

[MSG]def for declaration should not be used

VariableTypeRequired387

[SRC]def fieldType = getResource().getDeclaredField(field).type

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

UnnecessaryGetter387

[SRC]def fieldType = getResource().getDeclaredField(field).type

[MSG]getResource() can probably be rewritten as resource

NoDef388

[SRC]def fieldVal = fieldType.isEnum()? fieldType.valueOf(rawVal) : rawVal

[MSG]def for declaration should not be used

VariableTypeRequired388

[SRC]def fieldVal = fieldType.isEnum()? fieldType.valueOf(rawVal) : rawVal

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

UnnecessaryGetter388

[SRC]def fieldVal = fieldType.isEnum()? fieldType.valueOf(rawVal) : rawVal

[MSG]isEnum() can probably be rewritten as enum

UnnecessaryGString397

[SRC]ne("id", id)

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

UnnecessaryGString399

[SRC]result = [valid: (hasDuplicate == null || hasDuplicate.s.." : "false"]

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

UnnecessaryGString399

[SRC]result = [valid: (hasDuplicate == null || hasDuplicate.s.." : "false"]

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

UnnecessarySetter3106

[SRC]setResource(clazz)

[MSG]setResource(..) can probably be rewritten as resource = ..

➥ UrlMappings.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic23

[SRC]class UrlMappings {

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

DuplicateStringLiteral27

[SRC]"/domain/$domainName/$formId(.$format)?"(controller: "do..tion: "get")

[MSG]Duplicate String Literal: domainMeta

DuplicateStringLiteral27

[SRC]"/domain/$domainName/$formId(.$format)?"(controller: "do..tion: "get")

[MSG]Duplicate String Literal: get

DuplicateStringLiteral28

[SRC]"/domain/list(.$format)?"(controller: "domainMeta", action: "list")

[MSG]Duplicate String Literal: domainMeta

DuplicateStringLiteral29

[SRC]"/menu/sub/$menuId(.$format)?"(controller: "domainMeta",.. "subMenus")

[MSG]Duplicate String Literal: domainMeta

DuplicateStringLiteral210

[SRC]"/form/$domainName/$formType(.$format)?"(controller: "do..: "getForm")

[MSG]Duplicate String Literal: domainMeta

DuplicateStringLiteral211

[SRC]"/menu/top(.$format)?"(controller: "domainMeta", action: "topMenus")

[MSG]Duplicate String Literal: domainMeta

DuplicateStringLiteral212

[SRC]"/enum/$enumType(.$format)?"(controller: "enum", action: "get")

[MSG]Duplicate String Literal: get

DuplicateStringLiteral213

[SRC]"/options/$objectDynamicFieldId(.$format)?"(controller: ..tion: "get")

[MSG]Duplicate String Literal: get

DuplicateStringLiteral214

[SRC]"/search/$domainName/$fieldName/$fieldType(.$format)?"(c..n: "search")

[MSG]Duplicate String Literal: search

DuplicateStringLiteral215

[SRC]post "/search/$domainName(.$format)?"(controller: "searc..ObjectList")

[MSG]Duplicate String Literal: search

DuplicateStringLiteral218

[SRC]"/actions/$domainName(.$format)?"(controller: "actionMet.."canCreate")

[MSG]Duplicate String Literal: actionMeta

DuplicateStringLiteral219

[SRC]get "/application(.$format)?"(controller: "application",..tion: "get")

[MSG]Duplicate String Literal: get

DuplicateStringLiteral222

[SRC]get "/$domainName(.$format)?"(controller: "domainData", ..on: "index")

[MSG]Duplicate String Literal: domainData

DuplicateStringLiteral223

[SRC]get "/$domainName/$id(.$format)?"(controller: "domainDat..ion: "show")

[MSG]Duplicate String Literal: domainData

DuplicateStringLiteral224

[SRC]get "/$domainName/multiple/$ids(.$format)?"(controller: ..owMultiple")

[MSG]Duplicate String Literal: domainData

DuplicateStringLiteral225

[SRC]post "/$domainName(.$format)?"(controller: "domainData",..ion: "save")

[MSG]Duplicate String Literal: domainData

DuplicateStringLiteral226

[SRC]put "/$domainName/$id(.$format)?"(controller: "domainDat..n: "update")

[MSG]Duplicate String Literal: domainData

DuplicateStringLiteral227

[SRC]patch "/$domainName/$id(.$format)?"(controller: "domainD..on: "patch")

[MSG]Duplicate String Literal: domainData

DuplicateStringLiteral228

[SRC]get "/$domainName/$id/$columnName(.$format)?"(controller..tion: "get")

[MSG]Duplicate String Literal: get

DuplicateStringLiteral229

[SRC]post "/oauth/access_token"(controller: "RestOauthControl..tion: "get")

[MSG]Duplicate String Literal: get

DuplicateStringLiteral232

[SRC]"/"(controller: 'application', view: 'index')

[MSG]Duplicate String Literal: application

DuplicateStringLiteral232

[SRC]"/"(controller: 'application', view: 'index')

[MSG]Duplicate String Literal: index

FieldTypeRequired35

[SRC]static mappings = {

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

UnnecessaryGString36

[SRC]"/domain/$domainName(.$format)?"(controller: "domainMeta..tion: "get")

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

UnnecessaryGString36

[SRC]"/domain/$domainName(.$format)?"(controller: "domainMeta..tion: "get")

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

DuplicateMapLiteral37

[SRC]"/domain/$domainName/$formId(.$format)?"(controller: "do..tion: "get")

[MSG]Map [controller:domainMeta, action:get] is duplicated.

UnnecessaryGString37

[SRC]"/domain/$domainName/$formId(.$format)?"(controller: "do..tion: "get")

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

UnnecessaryGString37

[SRC]"/domain/$domainName/$formId(.$format)?"(controller: "do..tion: "get")

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

UnnecessaryGString38

[SRC]"/domain/list(.$format)?"(controller: "domainMeta", action: "list")

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

UnnecessaryGString38

[SRC]"/domain/list(.$format)?"(controller: "domainMeta", action: "list")

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

UnnecessaryGString39

[SRC]"/menu/sub/$menuId(.$format)?"(controller: "domainMeta",.. "subMenus")

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

UnnecessaryGString39

[SRC]"/menu/sub/$menuId(.$format)?"(controller: "domainMeta",.. "subMenus")

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

UnnecessaryGString310

[SRC]"/form/$domainName/$formType(.$format)?"(controller: "do..: "getForm")

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

UnnecessaryGString310

[SRC]"/form/$domainName/$formType(.$format)?"(controller: "do..: "getForm")

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

UnnecessaryGString311

[SRC]"/menu/top(.$format)?"(controller: "domainMeta", action: "topMenus")

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

UnnecessaryGString311

[SRC]"/menu/top(.$format)?"(controller: "domainMeta", action: "topMenus")

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

UnnecessaryGString312

[SRC]"/enum/$enumType(.$format)?"(controller: "enum", action: "get")

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

UnnecessaryGString312

[SRC]"/enum/$enumType(.$format)?"(controller: "enum", action: "get")

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

UnnecessaryGString313

[SRC]"/options/$objectDynamicFieldId(.$format)?"(controller: ..tion: "get")

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

UnnecessaryGString313

[SRC]"/options/$objectDynamicFieldId(.$format)?"(controller: ..tion: "get")

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

UnnecessaryGString314

[SRC]"/search/$domainName/$fieldName/$fieldType(.$format)?"(c..n: "search")

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

UnnecessaryGString314

[SRC]"/search/$domainName/$fieldName/$fieldType(.$format)?"(c..n: "search")

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

UnnecessaryGString315

[SRC]post "/search/$domainName(.$format)?"(controller: "searc..ObjectList")

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

UnnecessaryGString315

[SRC]post "/search/$domainName(.$format)?"(controller: "searc..ObjectList")

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

UnnecessaryGString316

[SRC]"/column/refresh/$domainName/${sourceColumn}/${destColum..: "refresh")

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

UnnecessaryGString316

[SRC]"/column/refresh/$domainName/${sourceColumn}/${destColum..: "refresh")

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

UnnecessaryGString317

[SRC]"/actions/$domainName/$id(.$format)?"(controller: "actio..eAndDelete")

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

UnnecessaryGString317

[SRC]"/actions/$domainName/$id(.$format)?"(controller: "actio..eAndDelete")

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

UnnecessaryGString318

[SRC]"/actions/$domainName(.$format)?"(controller: "actionMet.."canCreate")

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

UnnecessaryGString318

[SRC]"/actions/$domainName(.$format)?"(controller: "actionMet.."canCreate")

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

UnnecessaryGString319

[SRC]get "/application(.$format)?"(controller: "application",..tion: "get")

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

UnnecessaryGString319

[SRC]get "/application(.$format)?"(controller: "application",..tion: "get")

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

UnnecessaryGString320

[SRC]delete "/$domainName/$id(.$format)?"(controller: "domain..n: "delete")

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

UnnecessaryGString320

[SRC]delete "/$domainName/$id(.$format)?"(controller: "domain..n: "delete")

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

UnnecessaryGString321

[SRC]post "/unique/$domainName/$columnName(.$format)?"(contro..on: "valid")

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

UnnecessaryGString321

[SRC]post "/unique/$domainName/$columnName(.$format)?"(contro..on: "valid")

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

UnnecessaryGString322

[SRC]get "/$domainName(.$format)?"(controller: "domainData", ..on: "index")

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

UnnecessaryGString322

[SRC]get "/$domainName(.$format)?"(controller: "domainData", ..on: "index")

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

UnnecessaryGString323

[SRC]get "/$domainName/$id(.$format)?"(controller: "domainDat..ion: "show")

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

UnnecessaryGString323

[SRC]get "/$domainName/$id(.$format)?"(controller: "domainDat..ion: "show")

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

UnnecessaryGString324

[SRC]get "/$domainName/multiple/$ids(.$format)?"(controller: ..owMultiple")

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

UnnecessaryGString324

[SRC]get "/$domainName/multiple/$ids(.$format)?"(controller: ..owMultiple")

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

UnnecessaryGString325

[SRC]post "/$domainName(.$format)?"(controller: "domainData",..ion: "save")

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

UnnecessaryGString325

[SRC]post "/$domainName(.$format)?"(controller: "domainData",..ion: "save")

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

UnnecessaryGString326

[SRC]put "/$domainName/$id(.$format)?"(controller: "domainDat..n: "update")

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

UnnecessaryGString326

[SRC]put "/$domainName/$id(.$format)?"(controller: "domainDat..n: "update")

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

UnnecessaryGString327

[SRC]patch "/$domainName/$id(.$format)?"(controller: "domainD..on: "patch")

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

UnnecessaryGString327

[SRC]patch "/$domainName/$id(.$format)?"(controller: "domainD..on: "patch")

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

UnnecessaryGString328

[SRC]get "/$domainName/$id/$columnName(.$format)?"(controller..tion: "get")

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

UnnecessaryGString328

[SRC]get "/$domainName/$id/$columnName(.$format)?"(controller..tion: "get")

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

UnnecessaryGString329

[SRC]post "/oauth/access_token"(controller: "RestOauthControl..tion: "get")

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

UnnecessaryGString329

[SRC]post "/oauth/access_token"(controller: "RestOauthControl..tion: "get")

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

UnnecessaryGString329

[SRC]post "/oauth/access_token"(controller: "RestOauthControl..tion: "get")

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

UnnecessaryGString330

[SRC]get "/reloadSeedData"(controller: "dataLoad", action: "reload")

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

UnnecessaryGString330

[SRC]get "/reloadSeedData"(controller: "dataLoad", action: "reload")

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

UnnecessaryGString330

[SRC]get "/reloadSeedData"(controller: "dataLoad", action: "reload")

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

UnnecessaryGString332

[SRC]"/"(controller: 'application', view: 'index')

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

UnnecessaryGString333

[SRC]"500"(view: '/error')

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

UnnecessaryGString334

[SRC]"404"(view: '/notFound')

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

➥ WithDynamicFields.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic216

[SRC]abstract class WithDynamicFields<D> implements GormEntity<D> {

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

AbstractClassWithoutAbstractMethod216

[SRC]abstract class WithDynamicFields<D> implements GormEntity<D> {

[MSG]The abstract class tech.muyan.WithDynamicFields contains no abstract methods

UnusedMethodParameter234

[SRC]boolean propertyIsDatasource(String name) {

[MSG]Violation in class WithDynamicFields. Method parameter [name] is never referenced in the method propertyIsDatasource of class tech.muyan.WithDynamicFields

MethodParameterTypeRequired320

[SRC]def propertyMissing(String name, value) {

[MSG]"value" parameter of "propertyMissing" method is dynamically typed

MethodReturnTypeRequired320

[SRC]def propertyMissing(String name, value) {

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

NoDef320

[SRC]def propertyMissing(String name, value) {

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

NoDef320

[SRC]def propertyMissing(String name, value) {

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

MethodReturnTypeRequired326

[SRC]def propertyMissing(String name) {

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

NoDef326

[SRC]def propertyMissing(String name) {

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

ImplicitReturnStatement334

[SRC]boolean propertyIsDatasource(String name) {

[MSG]The method propertyIsDatasource in class tech.muyan.WithDynamicFields is missing an explicit return

Package: tech.muyan.customise

➥ Engine.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic28

[SRC]class Engine {

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

NoDef317

[SRC]def sharedData = new Binding()

[MSG]def for declaration should not be used

VariableTypeRequired317

[SRC]def sharedData = new Binding()

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

NoDef321

[SRC]def shell = new GroovyShell(classLoader, sharedData)

[MSG]def for declaration should not be used

VariableTypeRequired321

[SRC]def shell = new GroovyShell(classLoader, sharedData)

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

UnnecessaryReturnKeyword323

[SRC]return result

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

Package: tech.muyan.dynamic

➥ DynamicLogic.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals214

[SRC]class DynamicLogic {

[MSG]The domain class tech.muyan.dynamic.DynamicLogic should define an equals(Object) method

GrailsDomainHasToString214

[SRC]class DynamicLogic {

[MSG]The domain class tech.muyan.dynamic.DynamicLogic should define a toString() method

GrailsDomainStringPropertyMaxSize227

[SRC]String triggerField

[MSG]There is no constraint on the size of String property 'triggerField' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize228

[SRC]String targetField

[MSG]There is no constraint on the size of String property 'targetField' which will result in applying database defaults

DuplicateStringLiteral251

[SRC]description type: 'text'

[MSG]Duplicate String Literal: text

DuplicateStringLiteral253

[SRC]logicSource enumType: 'string'

[MSG]Duplicate String Literal: string

FieldTypeRequired338

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields338

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.dynamic.DynamicLogic is declared after an instance field

DuplicateMapLiteral340

[SRC]triggerDynamicField nullable: true, updatable: false

[MSG]Map [nullable:true, updatable:false] is duplicated.

DuplicateMapLiteral341

[SRC]targetDynamicField nullable: true, updatable: false

[MSG]Map [nullable:true, updatable:false] is duplicated.

DuplicateMapLiteral343

[SRC]triggerField nullable: true, updatable: false

[MSG]Map [nullable:true, updatable:false] is duplicated.

DuplicateMapLiteral344

[SRC]logicType nullable: false, updatable: false

[MSG]Map [nullable:false, updatable:false] is duplicated.

DuplicateMapLiteral345

[SRC]logicSource nullable: false, updatable: false

[MSG]Map [nullable:false, updatable:false] is duplicated.

FieldTypeRequired349

[SRC]static mapping = {

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

StaticFieldsBeforeInstanceFields349

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.dynamic.DynamicLogic is declared after an instance field

DuplicateMapLiteral351

[SRC]description type: 'text'

[MSG]Map [type:text] is duplicated.

DuplicateMapLiteral353

[SRC]logicSource enumType: 'string'

[MSG]Map [enumType:string] is duplicated.

FieldTypeRequired356

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields356

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.dynamic.DynamicLogic is declared after an instance field

Package: tech.muyan.dynamic.field

➥ DynamicFieldDefinition.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic216

[SRC]class DynamicFieldDefinition {

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

GrailsDomainHasEquals216

[SRC]class DynamicFieldDefinition {

[MSG]The domain class tech.muyan.dynamic.field.DynamicFieldDefinition should define an equals(Object) method

GrailsDomainHasToString216

[SRC]class DynamicFieldDefinition {

[MSG]The domain class tech.muyan.dynamic.field.DynamicFieldDefinition should define a toString() method

GrailsDomainStringPropertyMaxSize223

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize228

[SRC]String name

[MSG]There is no constraint on the size of String property 'name' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize241

[SRC]@BindUsing({ val, source ->

[MSG]There is no constraint on the size of String property 'optionsJson' which will result in applying database defaults

DuplicateStringLiteral242

[SRC]def options = source['optionsJson']

[MSG]Duplicate String Literal: optionsJson

Instanceof243

[SRC]if (options instanceof String) {//This is for handling CSV import

[MSG]The instanceof operator is used in class tech.muyan.dynamic.field.DynamicFieldDefinition

DuplicateStringLiteral274

[SRC]result['label'] = this.label

[MSG]Duplicate String Literal: label

DuplicateStringLiteral276

[SRC]result['optionsJson'] = (this.optionsJson != null && thi..gth() > 1) ?

[MSG]Duplicate String Literal: optionsJson

GrailsDomainStringPropertyMaxSize286

[SRC]String referenceClazz

[MSG]There is no constraint on the size of String property 'referenceClazz' which will result in applying database defaults

NoWildcardImports36

[SRC]import tech.muyan.enums.DynamicFieldDataType

[MSG]Wildcard (star) import

MisorderedStaticImports39

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

[MSG]Static imports should appear before normal imports

FieldTypeRequired318

[SRC]static hasMany = [dynamicFields: ObjectDynamicField, dyn..ynamicLogic]

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

NoDef342

[SRC]def options = source['optionsJson']

[MSG]def for declaration should not be used

VariableTypeRequired342

[SRC]def options = source['optionsJson']

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

UnnecessaryGString346

[SRC]String result = "["

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

NoDef348

[SRC]def obj = options.get(i)

[MSG]def for declaration should not be used

VariableTypeRequired348

[SRC]def obj = options.get(i)

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

NoDef349

[SRC]def converter = ConverterFactory.getConverter(val.fieldT...toString())

[MSG]def for declaration should not be used

VariableTypeRequired349

[SRC]def converter = ConverterFactory.getConverter(val.fieldT...toString())

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

NoDef350

[SRC]def value = converter.convert(obj.toString(), "", "")

[MSG]def for declaration should not be used

VariableTypeRequired350

[SRC]def value = converter.convert(obj.toString(), "", "")

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

UnnecessaryGString350

[SRC]def value = converter.convert(obj.toString(), "", "")

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

UnnecessaryGString350

[SRC]def value = converter.convert(obj.toString(), "", "")

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

UnnecessaryGString355

[SRC]result += value + ","

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

UnnecessaryGString360

[SRC]result += "]"

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

UnnecessaryReturnKeyword361

[SRC]return result

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

MethodReturnTypeRequired371

[SRC]def render() {

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

NoDef371

[SRC]def render() {

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

NoDef372

[SRC]def result = [:]

[MSG]def for declaration should not be used

VariableTypeRequired372

[SRC]def result = [:]

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

UnnecessaryReturnKeyword380

[SRC]return result

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

FieldTypeRequired388

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields388

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.dynamic.field.DynamicFieldDefinition is declared after an instance field

DuplicateMapLiteral393

[SRC]referenceClazz blank: true, nullable: true

[MSG]Map [blank:true, nullable:true] is duplicated.

FieldTypeRequired397

[SRC]static mapping = {

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

StaticFieldsBeforeInstanceFields397

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.dynamic.field.DynamicFieldDefinition is declared after an instance field

DuplicateMapLiteral3100

[SRC]name updateable: false

[MSG]Map [updateable:false] is duplicated.

FieldTypeRequired3103

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields3103

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.dynamic.field.DynamicFieldDefinition is declared after an instance field

FieldTypeRequired3109

[SRC]static labelField = "label"

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

StaticFieldsBeforeInstanceFields3109

[SRC]static labelField = "label"

[MSG]The static field labelField in class tech.muyan.dynamic.field.DynamicFieldDefinition is declared after an instance field

UnnecessaryGString3109

[SRC]static labelField = "label"

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

➥ DynamicFieldValue.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic231

[SRC]class DynamicFieldValue {

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

GrailsDomainHasEquals231

[SRC]class DynamicFieldValue {

[MSG]The domain class tech.muyan.dynamic.field.DynamicFieldValue should define an equals(Object) method

GrailsDomainHasToString231

[SRC]class DynamicFieldValue {

[MSG]The domain class tech.muyan.dynamic.field.DynamicFieldValue should define a toString() method

GrailsDomainStringPropertyMaxSize287

[SRC]String jsonValue

[MSG]There is no constraint on the size of String property 'jsonValue' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize288

[SRC]String stringValue

[MSG]There is no constraint on the size of String property 'stringValue' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize297

[SRC]String objectId

[MSG]There is no constraint on the size of String property 'objectId' which will result in applying database defaults

DuplicateStringLiteral2117

[SRC]booleanValue defaultValue: "false"

[MSG]Duplicate String Literal: false

UnusedImport34

[SRC]import groovy.json.JsonBuilder

[MSG]The [groovy.json.JsonBuilder] import is never referenced

UnusedImport35

[SRC]import groovy.json.StringEscapeUtils

[MSG]The [groovy.json.StringEscapeUtils] import is never referenced

NoWildcardImports39

[SRC]import tech.muyan.enums.DynamicFieldDataType

[MSG]Wildcard (star) import

UnusedImport312

[SRC]import java.time.ZoneId

[MSG]The [java.time.ZoneId] import is never referenced

UnusedImport314

[SRC]import static tech.muyan.DomainMetaConfig.MultipleSelectionTypes

[MSG]The [tech.muyan.DomainMetaConfig] import is never referenced

MisorderedStaticImports314

[SRC]import static tech.muyan.DomainMetaConfig.MultipleSelectionTypes

[MSG]Static imports should appear before normal imports

MisorderedStaticImports315

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

[MSG]Static imports should appear before normal imports

FieldTypeRequired333

[SRC]static transients = ['fieldType', 'ownerClazz']

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

FieldTypeRequired335

[SRC]static belongsTo = [objectDynamicField: ObjectDynamicField]

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

ImplicitReturnStatement353

[SRC]DisplayComponentType getDisplayComponentType() {

[MSG]The method getDisplayComponentType in class tech.muyan.dynamic.field.DynamicFieldValue is missing an explicit return

ImplicitReturnStatement363

[SRC]DomainClass getOwnerClazz() {

[MSG]The method getOwnerClazz in class tech.muyan.dynamic.field.DynamicFieldValue is missing an explicit return

ImplicitReturnStatement372

[SRC]DynamicFieldDataType getFieldType() {

[MSG]The method getFieldType in class tech.muyan.dynamic.field.DynamicFieldValue is missing an explicit return

UnnecessaryGetter374

[SRC]ObjectDynamicField.get(objectDynamicFieldId).getFieldType() :

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

UnnecessaryGetter375

[SRC](objectDynamicField != null) ? objectDynamicField.getFie..ype() : null

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

FieldTypeRequired3104

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields3104

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.dynamic.field.DynamicFieldValue is declared after an instance field

DuplicateMapLiteral3107

[SRC]booleanValue nullable: true

[MSG]Map [nullable:true] is duplicated.

DuplicateMapLiteral3108

[SRC]numericValue nullable: true

[MSG]Map [nullable:true] is duplicated.

DuplicateMapLiteral3109

[SRC]objectId blank: true, nullable: true

[MSG]Map [blank:true, nullable:true] is duplicated.

DuplicateMapLiteral3110

[SRC]storage nullable: true

[MSG]Map [nullable:true] is duplicated.

FieldTypeRequired3116

[SRC]static mapping = {

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

StaticFieldsBeforeInstanceFields3116

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.dynamic.field.DynamicFieldValue is declared after an instance field

UnnecessaryGString3117

[SRC]booleanValue defaultValue: "false"

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

➥ ObjectDynamicField.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic214

[SRC]class ObjectDynamicField {

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

GrailsDomainHasEquals214

[SRC]class ObjectDynamicField {

[MSG]The domain class tech.muyan.dynamic.field.ObjectDynamicField should define an equals(Object) method

GrailsDomainHasToString214

[SRC]class ObjectDynamicField {

[MSG]The domain class tech.muyan.dynamic.field.ObjectDynamicField should define a toString() method

GrailsDomainStringPropertyMaxSize237

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize242

[SRC]String meta

[MSG]There is no constraint on the size of String property 'meta' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize262

[SRC]String validation

[MSG]There is no constraint on the size of String property 'validation' which will result in applying database defaults

DuplicateStringLiteral289

[SRC]editable defaultValue: "true"

[MSG]Duplicate String Literal: true

DuplicateStringLiteral290

[SRC]display defaultValue: "true"

[MSG]Duplicate String Literal: true

DuplicateStringLiteral291

[SRC]required defaultValue: "true"

[MSG]Duplicate String Literal: true

DuplicateStringLiteral293

[SRC]displayComponentType enumType: 'string'

[MSG]Duplicate String Literal: string

ImportFromSamePackage34

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

FieldTypeRequired316

[SRC]static transients = ['fieldType']

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

ImplicitReturnStatement318

[SRC]DynamicFieldDataType getFieldType() {

[MSG]The method getFieldType in class tech.muyan.dynamic.field.ObjectDynamicField is missing an explicit return

FieldTypeRequired374

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields374

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.dynamic.field.ObjectDynamicField is declared after an instance field

DuplicateMapLiteral377

[SRC]validation blank: true, nullable: true

[MSG]Map [blank:true, nullable:true] is duplicated.

FieldTypeRequired388

[SRC]static mapping = {

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

StaticFieldsBeforeInstanceFields388

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.dynamic.field.ObjectDynamicField is declared after an instance field

UnnecessaryGString389

[SRC]editable defaultValue: "true"

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

DuplicateMapLiteral390

[SRC]display defaultValue: "true"

[MSG]Map [defaultValue:true] is duplicated.

UnnecessaryGString390

[SRC]display defaultValue: "true"

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

DuplicateMapLiteral391

[SRC]required defaultValue: "true"

[MSG]Map [defaultValue:true] is duplicated.

UnnecessaryGString391

[SRC]required defaultValue: "true"

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

DuplicateMapLiteral393

[SRC]displayComponentType enumType: 'string'

[MSG]Map [enumType:string] is duplicated.

FieldTypeRequired396

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields396

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.dynamic.field.ObjectDynamicField is declared after an instance field

Package: tech.muyan.dynamic.form

➥ DynamicForm.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals214

[SRC]class DynamicForm {

[MSG]The domain class tech.muyan.dynamic.form.DynamicForm should define an equals(Object) method

GrailsDomainHasToString214

[SRC]class DynamicForm {

[MSG]The domain class tech.muyan.dynamic.form.DynamicForm should define a toString() method

GrailsDomainStringPropertyMaxSize216

[SRC]String name

[MSG]There is no constraint on the size of String property 'name' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize217

[SRC]String description

[MSG]There is no constraint on the size of String property 'description' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize221

[SRC]String defaultSortField

[MSG]There is no constraint on the size of String property 'defaultSortField' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize222

[SRC]String defaultSortDirection

[MSG]There is no constraint on the size of String property 'defaultSortDirection' which will result in applying database defaults

FieldTypeRequired327

[SRC]static hasMany = [fields: DynamicFormField]

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

StaticFieldsBeforeInstanceFields327

[SRC]static hasMany = [fields: DynamicFormField]

[MSG]The static field hasMany in class tech.muyan.dynamic.form.DynamicForm is declared after an instance field

FieldTypeRequired329

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields329

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.dynamic.form.DynamicForm is declared after an instance field

DuplicateMapLiteral333

[SRC]objectType nullable: false

[MSG]Map [nullable:false] is duplicated.

DuplicateMapLiteral334

[SRC]type nullable: false

[MSG]Map [nullable:false] is duplicated.

DuplicateMapLiteral335

[SRC]defaultSortField nullable: true

[MSG]Map [nullable:true] is duplicated.

DuplicateMapLiteral336

[SRC]defaultSortDirection nullable: true

[MSG]Map [nullable:true] is duplicated.

DuplicateMapLiteral337

[SRC]importEnable nullable: false

[MSG]Map [nullable:false] is duplicated.

DuplicateMapLiteral338

[SRC]exportEnable nullable: false

[MSG]Map [nullable:false] is duplicated.

FieldTypeRequired342

[SRC]static mapping = {

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

StaticFieldsBeforeInstanceFields342

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.dynamic.form.DynamicForm is declared after an instance field

FieldTypeRequired346

[SRC]static labelField = "name"

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

StaticFieldsBeforeInstanceFields346

[SRC]static labelField = "name"

[MSG]The static field labelField in class tech.muyan.dynamic.form.DynamicForm is declared after an instance field

UnnecessaryGString346

[SRC]static labelField = "name"

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

FieldTypeRequired348

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields348

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.dynamic.form.DynamicForm is declared after an instance field

➥ DynamicFormField.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals213

[SRC]class DynamicFormField {

[MSG]The domain class tech.muyan.dynamic.form.DynamicFormField should define an equals(Object) method

GrailsDomainHasToString213

[SRC]class DynamicFormField {

[MSG]The domain class tech.muyan.dynamic.form.DynamicFormField should define a toString() method

GrailsDomainStringPropertyMaxSize219

[SRC]String fieldName

[MSG]There is no constraint on the size of String property 'fieldName' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize221

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize222

[SRC]String helpText

[MSG]There is no constraint on the size of String property 'helpText' which will result in applying database defaults

FieldTypeRequired315

[SRC]static belongsTo = [DynamicForm]

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

FieldTypeRequired325

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields325

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.dynamic.form.DynamicFormField is declared after an instance field

DuplicateMapLiteral327

[SRC]form nullable: false

[MSG]Map [nullable:false] is duplicated.

DuplicateMapLiteral329

[SRC]displaySequence nullable: false

[MSG]Map [nullable:false] is duplicated.

DuplicateMapLiteral330

[SRC]label nullable: false, blank: false

[MSG]Map [nullable:false, blank:false] is duplicated.

DuplicateMapLiteral332

[SRC]fieldType nullable: false

[MSG]Map [nullable:false] is duplicated.

FieldTypeRequired336

[SRC]static mapping = {

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

StaticFieldsBeforeInstanceFields336

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.dynamic.form.DynamicFormField is declared after an instance field

FieldTypeRequired340

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields340

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.dynamic.form.DynamicFormField is declared after an instance field

➥ DynamicMenu.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals213

[SRC]class DynamicMenu {

[MSG]The domain class tech.muyan.dynamic.form.DynamicMenu should define an equals(Object) method

GrailsDomainHasToString213

[SRC]class DynamicMenu {

[MSG]The domain class tech.muyan.dynamic.form.DynamicMenu should define a toString() method

GrailsDomainStringPropertyMaxSize216

[SRC]String icon

[MSG]There is no constraint on the size of String property 'icon' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize217

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize220

[SRC]String link

[MSG]There is no constraint on the size of String property 'link' which will result in applying database defaults

DuplicateStringLiteral246

[SRC]result.put("label", label)

[MSG]Duplicate String Literal: label

FieldTypeRequired323

[SRC]static hasMany = [children: DynamicMenu]

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

StaticFieldsBeforeInstanceFields323

[SRC]static hasMany = [children: DynamicMenu]

[MSG]The static field hasMany in class tech.muyan.dynamic.form.DynamicMenu is declared after an instance field

FieldTypeRequired324

[SRC]static hasOne = [form: DynamicForm]

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

StaticFieldsBeforeInstanceFields324

[SRC]static hasOne = [form: DynamicForm]

[MSG]The static field hasOne in class tech.muyan.dynamic.form.DynamicMenu is declared after an instance field

FieldTypeRequired326

[SRC]static constraints = {

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

StaticFieldsBeforeInstanceFields326

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.dynamic.form.DynamicMenu is declared after an instance field

DuplicateMapLiteral328

[SRC]icon nullable: true

[MSG]Map [nullable:true] is duplicated.

DuplicateMapLiteral331

[SRC]organization nullable: false

[MSG]Map [nullable:false] is duplicated.

DuplicateMapLiteral332

[SRC]link nullable: true

[MSG]Map [nullable:true] is duplicated.

DuplicateMapLiteral333

[SRC]form nullable: true

[MSG]Map [nullable:true] is duplicated.

DuplicateMapLiteral334

[SRC]children nullable: true

[MSG]Map [nullable:true] is duplicated.

DuplicateMapLiteral335

[SRC]displaySequence nullable: true

[MSG]Map [nullable:true] is duplicated.

FieldTypeRequired338

[SRC]static mapping = {

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

StaticFieldsBeforeInstanceFields338

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.dynamic.form.DynamicMenu is declared after an instance field

MethodReturnTypeRequired342

[SRC]def render() {

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

NoDef342

[SRC]def render() {

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

UnnecessaryGString344

[SRC]result.put("parentMenu", [id: parentMenu?.id])

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

UnnecessaryGString345

[SRC]result.put("icon", icon)

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

UnnecessaryGString346

[SRC]result.put("label", label)

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

UnnecessaryGString347

[SRC]result.put("type", type)

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

UnnecessaryGString348

[SRC]result.put("organization", [id: organization.id])

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

UnnecessaryGString349

[SRC]result.put("link", link)

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

UnnecessaryObjectReferences349

[SRC]result.put("link", link)

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

UnnecessaryGString350

[SRC]result.put("form", [id: form?.id])

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

UnnecessaryObjectReferences350

[SRC]result.put("form", [id: form?.id])

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

UnnecessaryGString351

[SRC]result.put("displaySequence", displaySequence)

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

UnnecessaryObjectReferences351

[SRC]result.put("displaySequence", displaySequence)

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

FieldTypeRequired355

[SRC]static searchable = {

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

StaticFieldsBeforeInstanceFields355

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.dynamic.form.DynamicMenu is declared after an instance field

Package: tech.muyan.enums

➥ ContractStatus.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals211

[SRC]enum ContractStatus {

[MSG]The domain class tech.muyan.enums.ContractStatus should define an equals(Object) method

GrailsDomainHasToString211

[SRC]enum ContractStatus {

[MSG]The domain class tech.muyan.enums.ContractStatus should define a toString() method

GrailsDomainStringPropertyMaxSize216

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName228

[SRC]private static final Map<String, ContractStatus> lookup ..HashMap<>(8)

[MSG]The fieldname lookup in class tech.muyan.enums.ContractStatus does not match [A-Z][A-Z0-9_]*

UnusedImport33

[SRC]import grails.util.Environment

[MSG]The [grails.util.Environment] import is never referenced

UnnecessaryGString313

[SRC]DRAFT("Draft"),

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

UnnecessaryGString314

[SRC]ACTIVE("Active"),

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

UnnecessaryGString315

[SRC]TERMINATED("Terminated")

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

UnnecessaryReturnKeyword323

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields328

[SRC]private static final Map<String, ContractStatus> lookup ..HashMap<>(8)

[MSG]The static field lookup in class tech.muyan.enums.ContractStatus is declared after an instance field

StaticMethodsBeforeInstanceMethods338

[SRC]static ContractStatus get(String label) {

[MSG]The public static method get in class tech.muyan.enums.ContractStatus is declared after a public instance method

UnnecessaryReturnKeyword339

[SRC]return lookup.get(label)

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

➥ DisplayComponentType.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals210

[SRC]enum DisplayComponentType {

[MSG]The domain class tech.muyan.enums.DisplayComponentType should define an equals(Object) method

GrailsDomainHasToString210

[SRC]enum DisplayComponentType {

[MSG]The domain class tech.muyan.enums.DisplayComponentType should define a toString() method

GrailsDomainStringPropertyMaxSize287

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName2100

[SRC]private static final Map<String, DisplayComponentType> l..ashMap<>(32)

[MSG]The fieldname lookup in class tech.muyan.enums.DisplayComponentType does not match [A-Z][A-Z0-9_]*

UnnecessaryGString313

[SRC]ABSTRACT_DATE("Abstract date"),

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

UnnecessaryGString315

[SRC]ABSTRACT_DATE_TIME("Abstract date with time"),

[MSG]The String 'Abstract date with time' can be wrapped in single quotes instead of double quotes

UnnecessaryGString317

[SRC]RELATIVE_DATE("Relative date"),

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

UnnecessaryGString319

[SRC]RELATIVE_DATE_TIME("Relative date with time"),

[MSG]The String 'Relative date with time' can be wrapped in single quotes instead of double quotes

UnnecessaryGString321

[SRC]STRING_INPUT("Text input"),

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

UnnecessaryGString323

[SRC]STRING_SINGLE_SELECTION("Text single selection"),

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

UnnecessaryGString325

[SRC]STRING_MULTIPLE_SELECTION("Text multiple selection"),

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

UnnecessaryGString327

[SRC]STRING_SINGLE_SELECTION_OR_INPUT("Text single selection or input"),

[MSG]The String 'Text single selection or input' can be wrapped in single quotes instead of double quotes

UnnecessaryGString329

[SRC]STRING_MULTIPLE_SELECTION_OR_INPUT("Text multiple select.. or input"),

[MSG]The String 'Text multiple selection or input' can be wrapped in single quotes instead of double quotes

UnnecessaryGString331

[SRC]TEXT_AREA("Long text"),

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

UnnecessaryGString333

[SRC]INTEGER_INPUT("Integer input"),

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

UnnecessaryGString335

[SRC]INTEGER_SINGLE_SELECTION("Integer single selection"),

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

UnnecessaryGString337

[SRC]INTEGER_MULTIPLE_SELECTION("integer multiple selection"),

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

UnnecessaryGString339

[SRC]INTEGER_SINGLE_SELECTION_OR_INPUT("Integer single select.. or input"),

[MSG]The String 'Integer single selection or input' can be wrapped in single quotes instead of double quotes

UnnecessaryGString341

[SRC]INTEGER_MULTIPLE_SELECTION_OR_INPUT("Integer multiple se.. or input"),

[MSG]The String 'Integer multiple selection or input' can be wrapped in single quotes instead of double quotes

UnnecessaryGString343

[SRC]FLOAT_INPUT("Decimal input"),

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

UnnecessaryGString345

[SRC]FLOAT_SINGLE_SELECTION("Decimal single selection"),

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

UnnecessaryGString347

[SRC]FLOAT_MULTIPLE_SELECTION("Decimal Multiple selection"),

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

UnnecessaryGString349

[SRC]FLOAT_SINGLE_SELECTION_OR_INPUT("Decimal single selection or input"),

[MSG]The String 'Decimal single selection or input' can be wrapped in single quotes instead of double quotes

UnnecessaryGString351

[SRC]FLOAT_MULTIPLE_SELECTION_OR_INPUT("Decimal Multiple sele.. or input"),

[MSG]The String 'Decimal Multiple selection or input' can be wrapped in single quotes instead of double quotes

UnnecessaryGString353

[SRC]PERCENTAGE("Percentage"),

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

UnnecessaryGString355

[SRC]CURRENCY("Currency"),

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

UnnecessaryGString357

[SRC]PASSWORD("Password"),

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

UnnecessaryGString359

[SRC]BOOLEAN("Boolean switch(yes/no)"),

[MSG]The String 'Boolean switch(yes/no)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString361

[SRC]SINGLE_FILE_UPLOAD("Single file"),

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

UnnecessaryGString363

[SRC]MULTIPLE_FILE_UPLOAD("Multiple file(s)"),

[MSG]The String 'Multiple file(s)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString365

[SRC]SINGLE_IMAGE_UPLOAD("Single image"),

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

UnnecessaryGString367

[SRC]MULTIPLE_IMAGE_UPLOAD("Multiple image(s)"),

[MSG]The String 'Multiple image(s)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString369

[SRC]OBJECT_SINGLE_SELECTION("Object single selection"),

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

UnnecessaryGString371

[SRC]OBJECT_MULTIPLE_SELECTION("Object multiple selection"),

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

UnnecessaryGString373

[SRC]FLOAT_RADIO("Float Radio"),

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

UnnecessaryGString375

[SRC]STRING_RADIO("String Radio"),

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

UnnecessaryGString377

[SRC]INTEGER_RADIO("Integer Radio"),

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

UnnecessaryGString379

[SRC]FLOAT_CHECKBOX("Float CheckBox"),

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

UnnecessaryGString381

[SRC]STRING_CHECKBOX("String CheckBox"),

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

UnnecessaryGString383

[SRC]INTEGER_CHECKBOX("Integer CheckBox")

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

UnnecessaryReturnKeyword394

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields3100

[SRC]private static final Map<String, DisplayComponentType> l..ashMap<>(32)

[MSG]The static field lookup in class tech.muyan.enums.DisplayComponentType is declared after an instance field

StaticMethodsBeforeInstanceMethods3110

[SRC]static DisplayComponentType get(String label) {

[MSG]The public static method get in class tech.muyan.enums.DisplayComponentType is declared after a public instance method

UnnecessaryReturnKeyword3111

[SRC]return lookup.get(label)

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

➥ DynamicFieldDataType.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals29

[SRC]enum DynamicFieldDataType {

[MSG]The domain class tech.muyan.enums.DynamicFieldDataType should define an equals(Object) method

GrailsDomainHasToString29

[SRC]enum DynamicFieldDataType {

[MSG]The domain class tech.muyan.enums.DynamicFieldDataType should define a toString() method

GrailsDomainStringPropertyMaxSize220

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName232

[SRC]private static final Map<String, DynamicFieldDataType> l..ashMap<>(16)

[MSG]The fieldname lookup in class tech.muyan.enums.DynamicFieldDataType does not match [A-Z][A-Z0-9_]*

UnnecessaryGString311

[SRC]STRING("Text (abc123)"),

[MSG]The String 'Text (abc123)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString312

[SRC]DATETIME("Date with time (2014-06-24 11:00)"),

[MSG]The String 'Date with time (2014-06-24 11:00)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString313

[SRC]DATE("Date without time (2014-06-24)"),

[MSG]The String 'Date without time (2014-06-24)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString314

[SRC]INTEGER("Integer number (42)"),

[MSG]The String 'Integer number (42)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString315

[SRC]DECIMAL("Float number (3.14159)"),

[MSG]The String 'Float number (3.14159)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString316

[SRC]BOOLEAN("Boolean (true/false)"),

[MSG]The String 'Boolean (true/false)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString317

[SRC]OBJECT("Object (Link to existing data)"),

[MSG]The String 'Object (Link to existing data)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString318

[SRC]FILE("File (Attachment)"),

[MSG]The String 'File (Attachment)' can be wrapped in single quotes instead of double quotes

UnnecessaryGString319

[SRC]IMAGE("Image (Image attachment, can be displayed)")

[MSG]The String 'Image (Image attachment, can be displayed)' can be wrapped in single quotes instead of double quotes

UnnecessaryReturnKeyword327

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields332

[SRC]private static final Map<String, DynamicFieldDataType> l..ashMap<>(16)

[MSG]The static field lookup in class tech.muyan.enums.DynamicFieldDataType is declared after an instance field

StaticMethodsBeforeInstanceMethods342

[SRC]static DynamicFieldDataType get(String label) {

[MSG]The public static method get in class tech.muyan.enums.DynamicFieldDataType is declared after a public instance method

UnnecessaryReturnKeyword343

[SRC]return lookup.get(label)

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

➥ FieldType.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals210

[SRC]enum FieldType {

[MSG]The domain class tech.muyan.enums.FieldType should define an equals(Object) method

GrailsDomainHasToString210

[SRC]enum FieldType {

[MSG]The domain class tech.muyan.enums.FieldType should define a toString() method

GrailsDomainStringPropertyMaxSize215

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName228

[SRC]private static final Map<String, FieldType> lookup = new HashMap<>(8)

[MSG]The fieldname lookup in class tech.muyan.enums.FieldType does not match [A-Z][A-Z0-9_]*

UnnecessaryGString312

[SRC]STATIC_FIELD("Static field"),

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

UnnecessaryGString313

[SRC]DYNAMIC_FIELD("Dynamic field")

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

UnnecessaryReturnKeyword322

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields328

[SRC]private static final Map<String, FieldType> lookup = new HashMap<>(8)

[MSG]The static field lookup in class tech.muyan.enums.FieldType is declared after an instance field

StaticMethodsBeforeInstanceMethods338

[SRC]static FieldType get(String label) {

[MSG]The public static method get in class tech.muyan.enums.FieldType is declared after a public instance method

UnnecessaryReturnKeyword339

[SRC]return lookup.get(label)

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

➥ FileImportStatus.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals29

[SRC]enum FileImportStatus {

[MSG]The domain class tech.muyan.enums.FileImportStatus should define an equals(Object) method

GrailsDomainHasToString29

[SRC]enum FileImportStatus {

[MSG]The domain class tech.muyan.enums.FileImportStatus should define a toString() method

FieldName230

[SRC]private static final Map<String, FileImportStatus> looku..HashMap<>(8)

[MSG]The fieldname lookup in class tech.muyan.enums.FileImportStatus does not match [A-Z][A-Z0-9_]*

UnnecessaryGString311

[SRC]SUCCESS("Success"),

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

UnnecessaryGString312

[SRC]PARTIALLY_SUCCESS("Partially success"),

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

UnnecessaryGString313

[SRC]FAILED("Failed"),

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

UnnecessaryGString314

[SRC]RUNNING("Running"),

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

UnnecessaryGString315

[SRC]NO_DATA_IMPORTED("No data imported"),

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

UnnecessaryGString316

[SRC]NOT_START("Not start");

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

UnnecessaryReturnKeyword325

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields330

[SRC]private static final Map<String, FileImportStatus> looku..HashMap<>(8)

[MSG]The static field lookup in class tech.muyan.enums.FileImportStatus is declared after an instance field

StaticMethodsBeforeInstanceMethods340

[SRC]static FileImportStatus get(String label) {

[MSG]The public static method get in class tech.muyan.enums.FileImportStatus is declared after a public instance method

UnnecessaryReturnKeyword341

[SRC]return lookup.get(label)

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

➥ FormType.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic27

[SRC]enum FormType {

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

GrailsDomainHasEquals27

[SRC]enum FormType {

[MSG]The domain class tech.muyan.enums.FormType should define an equals(Object) method

GrailsDomainHasToString27

[SRC]enum FormType {

[MSG]The domain class tech.muyan.enums.FormType should define a toString() method

GrailsDomainStringPropertyMaxSize215

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName228

[SRC]private static final Map<String, FormType> lookup = new HashMap<>(8)

[MSG]The fieldname lookup in class tech.muyan.enums.FormType does not match [A-Z][A-Z0-9_]*

UnnecessaryGString39

[SRC]LIST("List"),

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

UnnecessaryGString310

[SRC]CREATE("Create"),

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

UnnecessaryGString311

[SRC]UPDATE("Update"),

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

UnnecessaryGString312

[SRC]DISPLAY("Display"),

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

UnnecessaryGString313

[SRC]WIZARD("Wizard")

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

UnnecessaryReturnKeyword322

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields328

[SRC]private static final Map<String, FormType> lookup = new HashMap<>(8)

[MSG]The static field lookup in class tech.muyan.enums.FormType is declared after an instance field

StaticMethodsBeforeInstanceMethods338

[SRC]static FormType get(String label) {

[MSG]The public static method get in class tech.muyan.enums.FormType is declared after a public instance method

UnnecessaryReturnKeyword339

[SRC]return lookup.get(label)

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

➥ LineImportStatus.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals210

[SRC]enum LineImportStatus {

[MSG]The domain class tech.muyan.enums.LineImportStatus should define an equals(Object) method

GrailsDomainHasToString210

[SRC]enum LineImportStatus {

[MSG]The domain class tech.muyan.enums.LineImportStatus should define a toString() method

GrailsDomainStringPropertyMaxSize216

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName228

[SRC]private static final Map<String, LineImportStatus> looku..HashMap<>(8)

[MSG]The fieldname lookup in class tech.muyan.enums.LineImportStatus does not match [A-Z][A-Z0-9_]*

UnnecessaryGString312

[SRC]SKIPPED("Skipped"),

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

UnnecessaryGString313

[SRC]FAILED("Failed"),

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

UnnecessaryGString314

[SRC]INSERTED("Inserted"),

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

UnnecessaryGString315

[SRC]UPDATED("Updated")

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

UnnecessaryReturnKeyword323

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields328

[SRC]private static final Map<String, LineImportStatus> looku..HashMap<>(8)

[MSG]The static field lookup in class tech.muyan.enums.LineImportStatus is declared after an instance field

StaticMethodsBeforeInstanceMethods338

[SRC]static LineImportStatus get(String label) {

[MSG]The public static method get in class tech.muyan.enums.LineImportStatus is declared after a public instance method

UnnecessaryReturnKeyword339

[SRC]return lookup.get(label)

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

➥ LogicType.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals210

[SRC]enum LogicType {

[MSG]The domain class tech.muyan.enums.LogicType should define an equals(Object) method

GrailsDomainHasToString210

[SRC]enum LogicType {

[MSG]The domain class tech.muyan.enums.LogicType should define a toString() method

GrailsDomainStringPropertyMaxSize221

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName234

[SRC]private static final Map<String, LogicType> lookup = new HashMap<>(8)

[MSG]The fieldname lookup in class tech.muyan.enums.LogicType does not match [A-Z][A-Z0-9_]*

UnnecessaryGString312

[SRC]DECIDES("Field dependencies logic"),

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

UnnecessaryGString313

[SRC]DEFAULT_VALUE("Field default value logic"),

[MSG]The String 'Field default value logic' can be wrapped in single quotes instead of double quotes

UnnecessaryGString314

[SRC]REQUIRED("Field Mandatory logic"),

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

UnnecessaryGString315

[SRC]VISIBILITY("Field visibility logic"),

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

UnnecessaryGString316

[SRC]EDIT_ABILITY("Field edit ability logic"),

[MSG]The String 'Field edit ability logic' can be wrapped in single quotes instead of double quotes

UnnecessaryGString317

[SRC]UPDATE_DELETE("Object update/delete ability logic"),

[MSG]The String 'Object update/delete ability logic' can be wrapped in single quotes instead of double quotes

UnnecessaryGString318

[SRC]CREATE("Object create ability logic"),

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

UnnecessaryGString319

[SRC]SEARCH("Object search logic")

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

UnnecessaryReturnKeyword328

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields334

[SRC]private static final Map<String, LogicType> lookup = new HashMap<>(8)

[MSG]The static field lookup in class tech.muyan.enums.LogicType is declared after an instance field

StaticMethodsBeforeInstanceMethods344

[SRC]static LogicType get(String label) {

[MSG]The public static method get in class tech.muyan.enums.LogicType is declared after a public instance method

UnnecessaryReturnKeyword345

[SRC]return lookup.get(label)

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

➥ MenuType.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic27

[SRC]enum MenuType {

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

GrailsDomainHasEquals27

[SRC]enum MenuType {

[MSG]The domain class tech.muyan.enums.MenuType should define an equals(Object) method

GrailsDomainHasToString27

[SRC]enum MenuType {

[MSG]The domain class tech.muyan.enums.MenuType should define a toString() method

GrailsDomainStringPropertyMaxSize214

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName227

[SRC]private static final Map<String, MenuType> lookup = new HashMap<>(8)

[MSG]The fieldname lookup in class tech.muyan.enums.MenuType does not match [A-Z][A-Z0-9_]*

UnnecessaryGString39

[SRC]MENU_GROUP("Menu Group"),

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

UnnecessaryGString310

[SRC]EXTERNAL_LINK("External Link"),

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

UnnecessaryGString311

[SRC]INTERNAL_LINK("Internal Link"),

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

UnnecessaryGString312

[SRC]FORM("Form")

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

UnnecessaryReturnKeyword321

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields327

[SRC]private static final Map<String, MenuType> lookup = new HashMap<>(8)

[MSG]The static field lookup in class tech.muyan.enums.MenuType is declared after an instance field

StaticMethodsBeforeInstanceMethods337

[SRC]static MenuType get(String label) {

[MSG]The public static method get in class tech.muyan.enums.MenuType is declared after a public instance method

UnnecessaryReturnKeyword338

[SRC]return lookup.get(label)

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

➥ ObjectReferenceType.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals29

[SRC]enum ObjectReferenceType {

[MSG]The domain class tech.muyan.enums.ObjectReferenceType should define an equals(Object) method

GrailsDomainHasToString29

[SRC]enum ObjectReferenceType {

[MSG]The domain class tech.muyan.enums.ObjectReferenceType should define a toString() method

GrailsDomainStringPropertyMaxSize214

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName227

[SRC]private static final Map<String, ObjectReferenceType> lo..HashMap<>(8)

[MSG]The fieldname lookup in class tech.muyan.enums.ObjectReferenceType does not match [A-Z][A-Z0-9_]*

UnnecessaryGString310

[SRC]ONE_TO_ONE("One to One"),

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

UnnecessaryGString311

[SRC]ONE_TO_MANY("One to Many"),

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

UnnecessaryGString312

[SRC]MANY_TO_MANY("Many to Many");

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

UnnecessaryReturnKeyword321

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields327

[SRC]private static final Map<String, ObjectReferenceType> lo..HashMap<>(8)

[MSG]The static field lookup in class tech.muyan.enums.ObjectReferenceType is declared after an instance field

StaticMethodsBeforeInstanceMethods337

[SRC]static ObjectReferenceType get(String label) {

[MSG]The public static method get in class tech.muyan.enums.ObjectReferenceType is declared after a public instance method

UnnecessaryReturnKeyword338

[SRC]return lookup.get(label)

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

➥ StorageEngineType.groovy

Rule NamePriorityLine #Source Line / Message
GrailsDomainHasEquals211

[SRC]enum StorageEngineType {

[MSG]The domain class tech.muyan.enums.StorageEngineType should define an equals(Object) method

GrailsDomainHasToString211

[SRC]enum StorageEngineType {

[MSG]The domain class tech.muyan.enums.StorageEngineType should define a toString() method

GrailsDomainStringPropertyMaxSize215

[SRC]String label

[MSG]There is no constraint on the size of String property 'label' which will result in applying database defaults

FieldName227

[SRC]private static final Map<String, StorageEngineType> look..HashMap<>(8)

[MSG]The fieldname lookup in class tech.muyan.enums.StorageEngineType does not match [A-Z][A-Z0-9_]*

UnnecessaryGString312

[SRC]S3_CEPH("Ceph & S3"),

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

UnnecessaryGString313

[SRC]LOCAL_FILE("Local file system")

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

UnnecessaryReturnKeyword322

[SRC]return this.label

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

StaticFieldsBeforeInstanceFields327

[SRC]private static final Map<String, StorageEngineType> look..HashMap<>(8)

[MSG]The static field lookup in class tech.muyan.enums.StorageEngineType is declared after an instance field

StaticMethodsBeforeInstanceMethods337

[SRC]static StorageEngineType get(String label) {

[MSG]The public static method get in class tech.muyan.enums.StorageEngineType is declared after a public instance method

UnnecessaryReturnKeyword338

[SRC]return lookup.get(label)

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

Package: tech.muyan.helper

➥ ConverterHelper.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic25

[SRC]class ConverterHelper {

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

MethodReturnTypeRequired315

[SRC]def static convertList(Converter converter, String type,..ist value) {

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

NoDef315

[SRC]def static convertList(Converter converter, String type,..ist value) {

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

UnnecessaryDefInMethodDeclaration315

[SRC]def static convertList(Converter converter, String type,..ist value) {

[MSG]Violation in class tech.muyan.helper.ConverterHelper. The def keyword is unneeded when a method is marked static

NoDef317

[SRC]def result = []

[MSG]def for declaration should not be used

VariableTypeRequired317

[SRC]def result = []

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

ImplicitClosureParameter318

[SRC]value.forEach { it ->

[MSG]By convention "it" should not be used as a closure parameter name.

➥ DomainHelper.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic229

[SRC]class DomainHelper {

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

ClassForName273

[SRC]return initialize? Class.forName(domainClazz.getFullName.. domainClazz

[MSG]Violation in class tech.muyan.helper.DomainHelper. Methods calls to Class.forName(...) can create resource leaks and should almost always be replaced with calls to ClassLoader.loadClass(...)

DuplicateNumberLiteral291

[SRC]def trimmedDomainName = (domainName.indexOf('_') > -1) ?

[MSG]Duplicate Number Literal: -1

DuplicateStringLiteral291

[SRC]def trimmedDomainName = (domainName.indexOf('_') > -1) ?

[MSG]Duplicate String Literal: _

DuplicateStringLiteral2204

[SRC]def propGrailsClazz = grailsApplication.getArtefact("Dom..e.getName())

[MSG]Duplicate String Literal: Domain

DuplicateStringLiteral2209

[SRC]if (result['type'] == "array") {

[MSG]Duplicate String Literal: type

DuplicateStringLiteral2210

[SRC]def objGrailsClazz = grailsApplication.getArtefact("Doma..).getName())

[MSG]Duplicate String Literal: Domain

DuplicateStringLiteral2214

[SRC]result['backReferenceField'] = getBackReferenceFieldFromOwner(

[MSG]Duplicate String Literal: backReferenceField

DuplicateStringLiteral2227

[SRC]if (columnMapping != null && columnMapping.type == "text.. 'string') {

[MSG]Duplicate String Literal: type

DuplicateStringLiteral2228

[SRC]result['type'] = 'text'

[MSG]Duplicate String Literal: text

DuplicateStringLiteral2228

[SRC]result['type'] = 'text'

[MSG]Duplicate String Literal: type

DuplicateStringLiteral2333

[SRC]if (domainClazz == null && domainName.indexOf("_") > 0) {

[MSG]Duplicate String Literal: _

DuplicateStringLiteral2355

[SRC]attributes.put("decides", dependFields)

[MSG]Duplicate String Literal: decides

UnnecessaryReturnKeyword344

[SRC]return getDomainClassInfo(domainName, true) as Class<?>

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

UnnecessaryReturnKeyword358

[SRC]return getDomainClassInfo(domainName, false) as DomainClass

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

InvertedCondition363

[SRC]if (null == domainName || "" == domainName) {

[MSG]null is a constant expression on the left side of a compare equals operation

InvertedCondition363

[SRC]if (null == domainName || "" == domainName) {

[MSG] is a constant expression on the left side of a compare equals operation

UnnecessaryGString363

[SRC]if (null == domainName || "" == domainName) {

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

NoDef366

[SRC]def domains = DomainClass.getAll()

[MSG]def for declaration should not be used

VariableTypeRequired366

[SRC]def domains = DomainClass.getAll()

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

UnnecessaryGetter366

[SRC]def domains = DomainClass.getAll()

[MSG]getAll() can probably be rewritten as all

NoDef367

[SRC]def trimmedDomainName = (domainName.indexOf('_') > -1)?

[MSG]def for declaration should not be used

VariableTypeRequired367

[SRC]def trimmedDomainName = (domainName.indexOf('_') > -1)?

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

NoDef369

[SRC]def upperCase = trimmedDomainName.toUpperCase()

[MSG]def for declaration should not be used

VariableTypeRequired369

[SRC]def upperCase = trimmedDomainName.toUpperCase()

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

UnnecessaryGetter371

[SRC]if (upperCase.equals(domainClazz.getFullName().toUpperCase())

[MSG]getFullName() can probably be rewritten as fullName

UnnecessaryGetter372

[SRC]|| upperCase.equals(domainClazz.getShortName().toUpperCase())) {

[MSG]getShortName() can probably be rewritten as shortName

UnnecessaryGetter373

[SRC]return initialize? Class.forName(domainClazz.getFullName.. domainClazz

[MSG]getFullName() can probably be rewritten as fullName

InvertedCondition387

[SRC]if (null == domainName || "" == domainName) {

[MSG]null is a constant expression on the left side of a compare equals operation

InvertedCondition387

[SRC]if (null == domainName || "" == domainName) {

[MSG] is a constant expression on the left side of a compare equals operation

UnnecessaryGString387

[SRC]if (null == domainName || "" == domainName) {

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

NoDef390

[SRC]def domains = DomainClass.getAll()

[MSG]def for declaration should not be used

VariableTypeRequired390

[SRC]def domains = DomainClass.getAll()

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

UnnecessaryGetter390

[SRC]def domains = DomainClass.getAll()

[MSG]getAll() can probably be rewritten as all

NoDef391

[SRC]def trimmedDomainName = (domainName.indexOf('_') > -1) ?

[MSG]def for declaration should not be used

VariableTypeRequired391

[SRC]def trimmedDomainName = (domainName.indexOf('_') > -1) ?

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

NoDef393

[SRC]def upperCase = trimmedDomainName.toUpperCase()

[MSG]def for declaration should not be used

VariableTypeRequired393

[SRC]def upperCase = trimmedDomainName.toUpperCase()

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

UnnecessaryGetter395

[SRC]if (upperCase.equals(domainClazz.getFullName().toUpperCase())

[MSG]getFullName() can probably be rewritten as fullName

UnnecessaryGetter396

[SRC]|| upperCase.equals(domainClazz.getShortName().toUpperCase())) {

[MSG]getShortName() can probably be rewritten as shortName

UnnecessaryReturnKeyword3100

[SRC]return false

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

NoDef3113

[SRC]def value

[MSG]def for declaration should not be used

VariableTypeRequired3113

[SRC]def value

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

UnnecessaryGString3118

[SRC]resource.metaClass.respondsTo(resource, "render")) {

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

UnnecessaryReturnKeyword3124

[SRC]return value

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

UnnecessaryGetter3136

[SRC]List<MappingFactory> associated = manySideDomainDef.pers..sociations()

[MSG]getAssociations() can probably be rewritten as associations

UnnecessaryGString3145

[SRC]return ""

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

UnnecessaryReturnKeyword3145

[SRC]return ""

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

UnnecessaryGetter3157

[SRC]List<MappingFactory> associated = oneSideDomainDef.persi..sociations()

[MSG]getAssociations() can probably be rewritten as associations

UnnecessaryGString3166

[SRC]return ""

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

UnnecessaryReturnKeyword3166

[SRC]return ""

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

ImplicitReturnStatement3175

[SRC]static Collection<Map<String, Object>> getStaticFields(S..plication) {

[MSG]The method getStaticFields in class tech.muyan.helper.DomainHelper is missing an explicit return

NoDef3176

[SRC]def staticFields = []

[MSG]def for declaration should not be used

VariableTypeRequired3176

[SRC]def staticFields = []

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

NoDef3178

[SRC]def artifacts = grailsApplication.getArtefacts("Domain")

[MSG]def for declaration should not be used

VariableTypeRequired3178

[SRC]def artifacts = grailsApplication.getArtefacts("Domain")

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

UnnecessaryGString3178

[SRC]def artifacts = grailsApplication.getArtefacts("Domain")

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

NoDef3182

[SRC]def constraints = obj.constrainedProperties

[MSG]def for declaration should not be used

VariableTypeRequired3182

[SRC]def constraints = obj.constrainedProperties

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

NoDef3183

[SRC]def mappings = GrailsDomainBinder.getMapping(obj.getClazz())

[MSG]def for declaration should not be used

VariableTypeRequired3183

[SRC]def mappings = GrailsDomainBinder.getMapping(obj.getClazz())

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

UnnecessaryGetter3183

[SRC]def mappings = GrailsDomainBinder.getMapping(obj.getClazz())

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

NoDef3184

[SRC]def columns = mappings.columns

[MSG]def for declaration should not be used

VariableTypeRequired3184

[SRC]def columns = mappings.columns

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

NoDef3185

[SRC]def hasMany = GrailsClassUtils.getStaticPropertyValue(ob.., "hasMany")

[MSG]def for declaration should not be used

VariableTypeRequired3185

[SRC]def hasMany = GrailsClassUtils.getStaticPropertyValue(ob.., "hasMany")

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

UnnecessaryGetter3185

[SRC]def hasMany = GrailsClassUtils.getStaticPropertyValue(ob.., "hasMany")

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

UnnecessaryGString3185

[SRC]def hasMany = GrailsClassUtils.getStaticPropertyValue(ob.., "hasMany")

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

NoDef3189

[SRC]def result = [:]

[MSG]def for declaration should not be used

VariableTypeRequired3189

[SRC]def result = [:]

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

NoDef3191

[SRC]def propertyType = property.getPropertyType()

[MSG]def for declaration should not be used

VariableTypeRequired3191

[SRC]def propertyType = property.getPropertyType()

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

UnnecessaryGetter3191

[SRC]def propertyType = property.getPropertyType()

[MSG]getPropertyType() can probably be rewritten as propertyType

NoDef3196

[SRC]def appliedConstraints = property.getAppliedConstraints()

[MSG]def for declaration should not be used

VariableTypeRequired3196

[SRC]def appliedConstraints = property.getAppliedConstraints()

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

UnnecessaryGetter3196

[SRC]def appliedConstraints = property.getAppliedConstraints()

[MSG]getAppliedConstraints() can probably be rewritten as appliedConstraints

UnnecessaryGetter3202

[SRC]if (isDomainClass(propertyType.getName())) {

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

NoDef3204

[SRC]def propGrailsClazz = grailsApplication.getArtefact("Dom..e.getName())

[MSG]def for declaration should not be used

VariableTypeRequired3204

[SRC]def propGrailsClazz = grailsApplication.getArtefact("Dom..e.getName())

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

UnnecessaryGetter3204

[SRC]def propGrailsClazz = grailsApplication.getArtefact("Dom..e.getName())

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

UnnecessaryGString3204

[SRC]def propGrailsClazz = grailsApplication.getArtefact("Dom..e.getName())

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

UnnecessaryGString3209

[SRC]if (result['type'] == "array") {

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

NoDef3210

[SRC]def objGrailsClazz = grailsApplication.getArtefact("Doma..).getName())

[MSG]def for declaration should not be used

VariableTypeRequired3210

[SRC]def objGrailsClazz = grailsApplication.getArtefact("Doma..).getName())

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

UnnecessaryGetter3210

[SRC]def objGrailsClazz = grailsApplication.getArtefact("Doma..).getName())

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

UnnecessaryGetter3210

[SRC]def objGrailsClazz = grailsApplication.getArtefact("Doma..).getName())

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

UnnecessaryGString3210

[SRC]def objGrailsClazz = grailsApplication.getArtefact("Doma..).getName())

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

UnnecessaryGetter3213

[SRC]result['elementType'] = StringHelper.javaTypeToPathType(v.getName())

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

NoDef3221

[SRC]def constrainKey = DomainMetaConfig.ConstraintTypeToDisp..).getName()]

[MSG]def for declaration should not be used

VariableTypeRequired3221

[SRC]def constrainKey = DomainMetaConfig.ConstraintTypeToDisp..).getName()]

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

UnnecessaryGetter3221

[SRC]def constrainKey = DomainMetaConfig.ConstraintTypeToDisp..).getName()]

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

NoDef3222

[SRC]def constrainValue = getColumnConstrainMeta(cObj)

[MSG]def for declaration should not be used

VariableTypeRequired3222

[SRC]def constrainValue = getColumnConstrainMeta(cObj)

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

NoDef3226

[SRC]def columnMapping = columns.get(name)

[MSG]def for declaration should not be used

VariableTypeRequired3226

[SRC]def columnMapping = columns.get(name)

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

UnnecessaryGString3227

[SRC]if (columnMapping != null && columnMapping.type == "text.. 'string') {

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

NoDef3256

[SRC]def constrainValue = ""

[MSG]def for declaration should not be used

VariableTypeRequired3256

[SRC]def constrainValue = ""

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

UnnecessaryGString3256

[SRC]def constrainValue = ""

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

UnnecessaryReturnKeyword3273

[SRC]return constrainValue

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

UnnecessaryGString3289

[SRC]case "boolean":

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

UnnecessaryGString3292

[SRC]case "integer":

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

UnnecessaryGString3295

[SRC]case "long":

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

UnnecessaryGString3298

[SRC]case "decimal":

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

UnnecessaryReturnKeyword3302

[SRC]return defaultVal

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

NoDef3319

[SRC]def type = property.propertyType

[MSG]def for declaration should not be used

VariableTypeRequired3319

[SRC]def type = property.propertyType

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

NoDef3320

[SRC]def typeName = type.getName()

[MSG]def for declaration should not be used

VariableTypeRequired3320

[SRC]def typeName = type.getName()

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

UnnecessaryGetter3320

[SRC]def typeName = type.getName()

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

NoDef3321

[SRC]def clientType = DomainMetaConfig.AttributeTypeToClientT..ap[typeName]

[MSG]def for declaration should not be used

VariableTypeRequired3321

[SRC]def clientType = DomainMetaConfig.AttributeTypeToClientT..ap[typeName]

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

UnnecessaryReturnKeyword3322

[SRC]return clientType == null? StringHelper.javaTypeToPathTy..: clientType

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

NoDef3332

[SRC]def domainClazz = DomainClass.findByShortName(domainName.capitalize())

[MSG]def for declaration should not be used

VariableTypeRequired3332

[SRC]def domainClazz = DomainClass.findByShortName(domainName.capitalize())

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

UnnecessaryGString3333

[SRC]if (domainClazz == null && domainName.indexOf("_") > 0) {

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

NoDef3336

[SRC]def dynamicFields = ObjectDynamicField.findAllByObjectTy..domainClazz)

[MSG]def for declaration should not be used

VariableTypeRequired3336

[SRC]def dynamicFields = ObjectDynamicField.findAllByObjectTy..domainClazz)

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

NoDef3337

[SRC]def fields = []

[MSG]def for declaration should not be used

VariableTypeRequired3337

[SRC]def fields = []

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

UnnecessaryGetter3339

[SRC]List dependFields = getDynamicFieldDecides(domainClazz.g..), field.id)

[MSG]getFullName() can probably be rewritten as fullName

NoDef3340

[SRC]def key = "df_$field.id".toString()

[MSG]def for declaration should not be used

VariableTypeRequired3340

[SRC]def key = "df_$field.id".toString()

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

NoDef3341

[SRC]def fieldType = field.dynamicField.fieldType.name().toLowerCase()

[MSG]def for declaration should not be used

VariableTypeRequired3341

[SRC]def fieldType = field.dynamicField.fieldType.name().toLowerCase()

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

NoDef3342

[SRC]def displayControllerType = DomainMetaConfig.DisplayComp..mponentType]

[MSG]def for declaration should not be used

VariableTypeRequired3342

[SRC]def displayControllerType = DomainMetaConfig.DisplayComp..mponentType]

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

NoDef3343

[SRC]def controller = displayControllerType != null? displayC.. : fieldType

[MSG]def for declaration should not be used

VariableTypeRequired3343

[SRC]def controller = displayControllerType != null? displayC.. : fieldType

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

NoDef3344

[SRC]def attributes = [

[MSG]def for declaration should not be used

VariableTypeRequired3344

[SRC]def attributes = [

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

UnnecessaryGString3355

[SRC]attributes.put("decides", dependFields)

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

UnnecessaryReturnKeyword3359

[SRC]return fields

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

NoDef3369

[SRC]def decideLogics = DynamicLogic.where {

[MSG]def for declaration should not be used

VariableTypeRequired3369

[SRC]def decideLogics = DynamicLogic.where {

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

NoDef3372

[SRC]def dependFields = []

[MSG]def for declaration should not be used

VariableTypeRequired3372

[SRC]def dependFields = []

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

ImplicitClosureParameter3375

[SRC]dependFields.add(it.targetField)

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

UnnecessaryReturnKeyword3378

[SRC]return dependFields

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

NoDef3388

[SRC]def decideLogics = DynamicLogic.where {

[MSG]def for declaration should not be used

VariableTypeRequired3388

[SRC]def decideLogics = DynamicLogic.where {

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

NoDef3393

[SRC]def dependFields = []

[MSG]def for declaration should not be used

VariableTypeRequired3393

[SRC]def dependFields = []

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

ImplicitClosureParameter3396

[SRC]dependFields.add(it.targetField)

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

UnnecessaryReturnKeyword3399

[SRC]return dependFields

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

NoDef3412

[SRC]def staticFields = getStaticFields(domainName, application)

[MSG]def for declaration should not be used

VariableTypeRequired3412

[SRC]def staticFields = getStaticFields(domainName, application)

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

NoDef3414

[SRC]def dynamicFields = getDynamicFields(domainName)

[MSG]def for declaration should not be used

VariableTypeRequired3414

[SRC]def dynamicFields = getDynamicFields(domainName)

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

UnnecessaryReturnKeyword3416

[SRC]return allFields

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

➥ DynamicFieldHelper.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic227

[SRC]class DynamicFieldHelper {

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

FactoryMethodName252

[SRC]static DynamicFieldValue buildFromString(

[MSG]Violation in class DynamicFieldHelper. The method 'buildFromString' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/

FactoryMethodName283

[SRC]static DynamicFieldValue build(ObjectDynamicField field,..ypedValue) {

[MSG]Violation in class DynamicFieldHelper. The method 'build' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/

FactoryMethodName2109

[SRC]static DynamicFieldValue createDynamicFieldValue(domainO..amicField) {

[MSG]Violation in class DynamicFieldHelper. The method 'createDynamicFieldValue' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/

Instanceof2166

[SRC]return (obj instanceof WithDynamicFields)

[MSG]The instanceof operator is used in class tech.muyan.helper.DynamicFieldHelper

VariableName2177

[SRC]def df_id = key.substring(prefix.length())

[MSG]Variable named df_id in class tech.muyan.helper.DynamicFieldHelper does not match the pattern [a-z][a-zA-Z0-9]*

ThrowRuntimeException2188

[SRC]throw new RuntimeException("Multiple dynamic field value..inObj.id}]")

[MSG]The type RuntimeException should not be thrown

Instanceof2211

[SRC]if ((val instanceof HibernateProxy)) {

[MSG]The instanceof operator is used in class tech.muyan.helper.DynamicFieldHelper

Instanceof2218

[SRC]} else if (val instanceof Set || val instanceof List) {

[MSG]The instanceof operator is used in class tech.muyan.helper.DynamicFieldHelper

Instanceof2218

[SRC]} else if (val instanceof Set || val instanceof List) {

[MSG]The instanceof operator is used in class tech.muyan.helper.DynamicFieldHelper

MethodReturnTypeRequired334

[SRC]static saveAllToOwner(long ownerId, List<DynamicFieldValue> values) {

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

NoDef334

[SRC]static saveAllToOwner(long ownerId, List<DynamicFieldValue> values) {

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

NoDef336

[SRC]def existing = DynamicFieldValue.findByOwnerIdAndObjectDynamicField(

[MSG]def for declaration should not be used

VariableTypeRequired336

[SRC]def existing = DynamicFieldValue.findByOwnerIdAndObjectDynamicField(

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

UnnecessaryObjectReferences344

[SRC]existing.save(flush: true)

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

DuplicateMapLiteral347

[SRC]value.save(flush: true)

[MSG]Map [flush:true] is duplicated.

NoDef356

[SRC]def type = dfv.objectDynamicField.displayComponentType

[MSG]def for declaration should not be used

VariableTypeRequired356

[SRC]def type = dfv.objectDynamicField.displayComponentType

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

NoDef357

[SRC]def isSingleSelection = DomainMetaConfig.SingleSelection..ntains(type)

[MSG]def for declaration should not be used

VariableTypeRequired357

[SRC]def isSingleSelection = DomainMetaConfig.SingleSelection..ntains(type)

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

NoDef358

[SRC]def isMultipleSelection = DomainMetaConfig.MultipleSelec..ntains(type)

[MSG]def for declaration should not be used

VariableTypeRequired358

[SRC]def isMultipleSelection = DomainMetaConfig.MultipleSelec..ntains(type)

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

UnnecessaryGetter360

[SRC]String optionStr = dfv.objectDynamicField.dynamicField.g..ptionsJson()

[MSG]getOptionsJson() can probably be rewritten as optionsJson

UnnecessaryReturnKeyword380

[SRC]return dfv

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

CouldBeSwitchStatement386

[SRC]if (fieldDefinition.fieldType == DynamicFieldDataType.STRING) {

[MSG]Code could use switch statement

CouldBeSwitchStatement386

[SRC]if (fieldDefinition.fieldType == DynamicFieldDataType.STRING) {

[MSG]Code could use switch statement

NoDef391

[SRC]def val = typedValue as LocalDate

[MSG]def for declaration should not be used

VariableTypeRequired391

[SRC]def val = typedValue as LocalDate

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

UnnecessaryReturnKeyword3100

[SRC]return dfv

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

ImplicitReturnStatement3109

[SRC]static DynamicFieldValue createDynamicFieldValue(domainO..amicField) {

[MSG]The method createDynamicFieldValue in class tech.muyan.helper.DynamicFieldHelper is missing an explicit return

MethodParameterTypeRequired3109

[SRC]static DynamicFieldValue createDynamicFieldValue(domainO..amicField) {

[MSG]"domainObj" parameter of "createDynamicFieldValue" method is dynamically typed

MethodParameterTypeRequired3109

[SRC]static DynamicFieldValue createDynamicFieldValue(domainO..amicField) {

[MSG]"objectDynamicField" parameter of "createDynamicFieldValue" method is dynamically typed

NoDef3109

[SRC]static DynamicFieldValue createDynamicFieldValue(domainO..amicField) {

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

NoDef3109

[SRC]static DynamicFieldValue createDynamicFieldValue(domainO..amicField) {

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

NoDef3110

[SRC]def val = new DynamicFieldValue()

[MSG]def for declaration should not be used

VariableTypeRequired3110

[SRC]def val = new DynamicFieldValue()

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

MethodParameterTypeRequired3121

[SRC]static List<DynamicFieldValue> getDynamicFieldValuesOf(domainObj) {

[MSG]"domainObj" parameter of "getDynamicFieldValuesOf" method is dynamically typed

NoDef3121

[SRC]static List<DynamicFieldValue> getDynamicFieldValuesOf(domainObj) {

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

UnnecessaryGetter3123

[SRC](ownerId == domainObj.id) && (objectDynamicField.objectT..).getName())

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

UnnecessaryReturnKeyword3125

[SRC]return values

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

ImplicitReturnStatement3134

[SRC]static List<DynamicFieldValue> getDynamicFieldValueByTyp..domainObj) {

[MSG]The method getDynamicFieldValueByType in class tech.muyan.helper.DynamicFieldHelper is missing an explicit return

MethodParameterTypeRequired3134

[SRC]static List<DynamicFieldValue> getDynamicFieldValueByTyp..domainObj) {

[MSG]"objectField" parameter of "getDynamicFieldValueByType" method is dynamically typed

MethodParameterTypeRequired3134

[SRC]static List<DynamicFieldValue> getDynamicFieldValueByTyp..domainObj) {

[MSG]"domainObj" parameter of "getDynamicFieldValueByType" method is dynamically typed

NoDef3134

[SRC]static List<DynamicFieldValue> getDynamicFieldValueByTyp..domainObj) {

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

NoDef3134

[SRC]static List<DynamicFieldValue> getDynamicFieldValueByTyp..domainObj) {

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

UnnecessaryGString3137

[SRC]eq("objectDynamicField", objectField)

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

UnnecessaryGString3138

[SRC]eq("ownerId", domainObj.id)

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

ImplicitReturnStatement3148

[SRC]static List fillAllWithDynamicFieldValues(domainObjects) {

[MSG]The method fillAllWithDynamicFieldValues in class tech.muyan.helper.DynamicFieldHelper is missing an explicit return

MethodParameterTypeRequired3148

[SRC]static List fillAllWithDynamicFieldValues(domainObjects) {

[MSG]"domainObjects" parameter of "fillAllWithDynamicFieldValues" method is dynamically typed

NoDef3148

[SRC]static List fillAllWithDynamicFieldValues(domainObjects) {

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

NoDef3149

[SRC]def result = []

[MSG]def for declaration should not be used

VariableTypeRequired3149

[SRC]def result = []

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

MethodReturnTypeRequired3165

[SRC]static hasDynamicFields(Object obj) {

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

NoDef3165

[SRC]static hasDynamicFields(Object obj) {

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

UnnecessaryReturnKeyword3166

[SRC]return (obj instanceof WithDynamicFields)

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

MethodParameterTypeRequired3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

[MSG]"domainObj" parameter of "parseDynamicFields" method is dynamically typed

MethodParameterTypeRequired3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

[MSG]"jsonObj" parameter of "parseDynamicFields" method is dynamically typed

MethodParameterTypeRequired3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

[MSG]"decimalConverter" parameter of "parseDynamicFields" method is dynamically typed

MethodParameterTypeRequired3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

[MSG]"dateConverter" parameter of "parseDynamicFields" method is dynamically typed

MethodParameterTypeRequired3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

[MSG]"isCreate" parameter of "parseDynamicFields" method is dynamically typed

MethodReturnTypeRequired3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

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

NoDef3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

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

NoDef3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

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

NoDef3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

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

NoDef3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

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

NoDef3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

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

NoDef3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

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

UnnecessaryDefInMethodDeclaration3169

[SRC]def static parseDynamicFields(domainObj, jsonObj, decima.. isCreate) {

[MSG]Violation in class tech.muyan.helper.DynamicFieldHelper. The def keyword is unneeded when a method is marked static

NoDef3170

[SRC]def result = []

[MSG]def for declaration should not be used

VariableTypeRequired3170

[SRC]def result = []

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

NoDef3175

[SRC]def prefix = DomainMetaConfig.DynamicFieldKeyPrefix

[MSG]def for declaration should not be used

VariableTypeRequired3175

[SRC]def prefix = DomainMetaConfig.DynamicFieldKeyPrefix

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

NoDef3177

[SRC]def df_id = key.substring(prefix.length())

[MSG]def for declaration should not be used

VariableTypeRequired3177

[SRC]def df_id = key.substring(prefix.length())

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

UnnecessarySubstring3177

[SRC]def df_id = key.substring(prefix.length())

[MSG]Violation in class tech.muyan.helper.DynamicFieldHelper. The String.substring(int) method can be replaced with the subscript operator

NoDef3178

[SRC]def odf = ObjectDynamicField.get(df_id)

[MSG]def for declaration should not be used

VariableTypeRequired3178

[SRC]def odf = ObjectDynamicField.get(df_id)

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

NoDef3185

[SRC]def firstElem = currVals.get(0)

[MSG]def for declaration should not be used

VariableTypeRequired3185

[SRC]def firstElem = currVals.get(0)

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

MethodParameterTypeRequired3205

[SRC]static appendDynamicFields(domainObj) {

[MSG]"domainObj" parameter of "appendDynamicFields" method is dynamically typed

MethodReturnTypeRequired3205

[SRC]static appendDynamicFields(domainObj) {

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

NoDef3205

[SRC]static appendDynamicFields(domainObj) {

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

NoDef3205

[SRC]static appendDynamicFields(domainObj) {

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

NoDef3207

[SRC]def result = [:]

[MSG]def for declaration should not be used

VariableTypeRequired3207

[SRC]def result = [:]

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

UnnecessaryGString3208

[SRC]result.put("id", domainObj.id)

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

NoDef3212

[SRC]def clazz = val.getMetaClass().getTheClass()

[MSG]def for declaration should not be used

VariableTypeRequired3212

[SRC]def clazz = val.getMetaClass().getTheClass()

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

UnnecessaryGetter3212

[SRC]def clazz = val.getMetaClass().getTheClass()

[MSG]getTheClass() can probably be rewritten as theClass

UnnecessaryGetter3212

[SRC]def clazz = val.getMetaClass().getTheClass()

[MSG]getMetaClass() can probably be rewritten as metaClass

UnnecessaryGetter3213

[SRC]if (DomainHelper.isDomainClass(clazz.getName())) {

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

UnnecessaryGetter3216

[SRC]} else if (DomainHelper.isDomainClass(val.getClass().getName())) {

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

NoDef3219

[SRC]def field = []

[MSG]def for declaration should not be used

VariableTypeRequired3219

[SRC]def field = []

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

MethodParameterTypeRequired3243

[SRC]static void getDomainProperties(List<DynamicFieldValue> ..domainObj) {

[MSG]"domainObj" parameter of "getDomainProperties" method is dynamically typed

NoDef3243

[SRC]static void getDomainProperties(List<DynamicFieldValue> ..domainObj) {

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

NoDef3245

[SRC]def propertyName = DomainMetaConfig.DynamicFieldKeyPrefi..amicField.id

[MSG]def for declaration should not be used

VariableTypeRequired3245

[SRC]def propertyName = DomainMetaConfig.DynamicFieldKeyPrefi..amicField.id

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

NoDef3246

[SRC]def value

[MSG]def for declaration should not be used

VariableTypeRequired3246

[SRC]def value

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

MethodParameterTypeRequired3287

[SRC]static void setDynamicFieldValue(valueObj, value, decima..Converter) {

[MSG]"valueObj" parameter of "setDynamicFieldValue" method is dynamically typed

MethodParameterTypeRequired3287

[SRC]static void setDynamicFieldValue(valueObj, value, decima..Converter) {

[MSG]"value" parameter of "setDynamicFieldValue" method is dynamically typed

MethodParameterTypeRequired3287

[SRC]static void setDynamicFieldValue(valueObj, value, decima..Converter) {

[MSG]"decimalConverter" parameter of "setDynamicFieldValue" method is dynamically typed

MethodParameterTypeRequired3287

[SRC]static void setDynamicFieldValue(valueObj, value, decima..Converter) {

[MSG]"dateConverter" parameter of "setDynamicFieldValue" method is dynamically typed

NoDef3287

[SRC]static void setDynamicFieldValue(valueObj, value, decima..Converter) {

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

NoDef3287

[SRC]static void setDynamicFieldValue(valueObj, value, decima..Converter) {

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

NoDef3287

[SRC]static void setDynamicFieldValue(valueObj, value, decima..Converter) {

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

NoDef3287

[SRC]static void setDynamicFieldValue(valueObj, value, decima..Converter) {

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

NoDef3288

[SRC]def fd = DynamicFieldDefinition.get(valueObj.objectDynam..micField.id)

[MSG]def for declaration should not be used

VariableTypeRequired3288

[SRC]def fd = DynamicFieldDefinition.get(valueObj.objectDynam..micField.id)

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

NoDef3300

[SRC]def decimal = decimalConverter.convert(value) as BigDecimal

[MSG]def for declaration should not be used

VariableTypeRequired3300

[SRC]def decimal = decimalConverter.convert(value) as BigDecimal

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

NoDef3308

[SRC]def date = dateConverter.convert(value) as Date

[MSG]def for declaration should not be used

VariableTypeRequired3308

[SRC]def date = dateConverter.convert(value) as Date

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

➥ LabelHelper.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class LabelHelper {

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

DuplicateStringLiteral222

[SRC]labelField = (GrailsClassUtils.getStaticFieldValue(clazz..abelField"))

[MSG]Duplicate String Literal: labelField

DuplicateStringLiteral224

[SRC]labelField = "label"

[MSG]Duplicate String Literal: label

ImplicitReturnStatement319

[SRC]static String getLabelField(Class<?> clazz) {

[MSG]The method getLabelField in class tech.muyan.helper.LabelHelper is missing an explicit return

UnnecessaryGString320

[SRC]String labelField = "id"

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

UnnecessaryGString321

[SRC]if (GrailsClassUtils.getStaticFieldValue(clazz, "labelField")) {

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

UnnecessaryGString322

[SRC]labelField = (GrailsClassUtils.getStaticFieldValue(clazz..abelField"))

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

UnnecessaryGString323

[SRC]} else if (GrailsClassUtils.getProperty(clazz, "label")) {

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

UnnecessaryGString324

[SRC]labelField = "label"

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

➥ OrganizationHelper.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic218

[SRC]class OrganizationHelper {

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

PropertyName244

[SRC]static final Map<FormType, HttpMethod> FormTypeToHttpMethodMapping = [

[MSG]The property name FormTypeToHttpMethodMapping in class tech.muyan.helper.OrganizationHelper does not match the pattern [A-Z][A-Z0-9_]*

MethodReturnTypeRequired320

[SRC]static def getOrganizationOfUser(Authentication authentication) {

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

NoDef320

[SRC]static def getOrganizationOfUser(Authentication authentication) {

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

UnnecessaryDefInMethodDeclaration320

[SRC]static def getOrganizationOfUser(Authentication authentication) {

[MSG]Violation in class tech.muyan.helper.OrganizationHelper. The def keyword is unneeded when a method is marked static

UnnecessaryGetter321

[SRC]long id = authentication.getPrincipal().properties.get("id") as long

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

UnnecessaryGString321

[SRC]long id = authentication.getPrincipal().properties.get("id") as long

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

NoDef322

[SRC]def user = User.get(id)

[MSG]def for declaration should not be used

VariableTypeRequired322

[SRC]def user = User.get(id)

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

ImplicitReturnStatement326

[SRC]static List<DynamicMenu> getMenusOfOrganization(Organiza..arentMenu) {

[MSG]The method getMenusOfOrganization in class tech.muyan.helper.OrganizationHelper is missing an explicit return

MethodParameterTypeRequired326

[SRC]static List<DynamicMenu> getMenusOfOrganization(Organiza..arentMenu) {

[MSG]"parentMenu" parameter of "getMenusOfOrganization" method is dynamically typed

NoDef326

[SRC]static List<DynamicMenu> getMenusOfOrganization(Organiza..arentMenu) {

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

UnnecessaryGString327

[SRC]DynamicMenu.findAllByOrganizationAndParentMenu(organizat..ySequence"])

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

UnnecessaryGString340

[SRC]"UNKNOWN_REQUEST_URL"

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

UnnecessaryReturnKeyword351

[SRC]return FormTypeToHttpMethodMapping.get(formType)

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

➥ ParamsHelper.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class ParamsHelper {

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

Instanceof218

[SRC]!((param.id instanceof Long)

[MSG]The instanceof operator is used in class tech.muyan.helper.ParamsHelper

Instanceof219

[SRC]|| (param.id instanceof String)

[MSG]The instanceof operator is used in class tech.muyan.helper.ParamsHelper

Instanceof220

[SRC]|| (param.id instanceof Integer))

[MSG]The instanceof operator is used in class tech.muyan.helper.ParamsHelper

ImplicitReturnStatement316

[SRC]static boolean idParamNotValid(GrailsParameterMap param) {

[MSG]The method idParamNotValid in class tech.muyan.helper.ParamsHelper is missing an explicit return

Package: tech.muyan.importexport

➥ ImportEngine.groovy

Rule NamePriorityLine #Source Line / Message
CatchException265

[SRC]} catch (Exception ignored) {}

[MSG]The type Exception should not be caught

Instanceof266

[SRC]if (hasOne != null && (hasOne instanceof Map)) {

[MSG]The instanceof operator is used in class tech.muyan.importexport.ImportEngine

ClassForName2176

[SRC]Class domainClazz = Class.forName(domainClass.fullName)

[MSG]Violation in class tech.muyan.importexport.ImportEngine. Methods calls to Class.forName(...) can create resource leaks and should almost always be replaced with calls to ClassLoader.loadClass(...)

CatchException2312

[SRC]} catch (Exception e) {

[MSG]The type Exception should not be caught

NoDef348

[SRC]def domainClazz = DomainHelper.getClazzFromDomainName(clazz.fullName)

[MSG]def for declaration should not be used

VariableTypeRequired348

[SRC]def domainClazz = DomainHelper.getClazzFromDomainName(clazz.fullName)

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

NoDef362

[SRC]def hasOne = null

[MSG]def for declaration should not be used

VariableTypeRequired362

[SRC]def hasOne = null

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

UnnecessaryNullCheckBeforeInstanceOf366

[SRC]if (hasOne != null && (hasOne instanceof Map)) {

[MSG]The condition ((hasOne != null) && (hasOne instanceof Map)) can be safely simplified to (hasOne instanceof Map)

InvertedIfElse388

[SRC]if (!contains) {

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

UnnecessaryGString3124

[SRC]moveToFront(sortedFileNames, "ObjectDynamicField")

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

UnnecessaryGString3125

[SRC]moveToFront(sortedFileNames, "DynamicFieldDefinition")

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

UnnecessaryReturnKeyword3126

[SRC]return sortedFileNames

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

UnnecessaryGetter3162

[SRC]List<String> headerNames = records.getHeaderNames()

[MSG]getHeaderNames() can probably be rewritten as headerNames

NoDef3165

[SRC]def queryField = CSVHelper.me().isQueryField(headerName)

[MSG]def for declaration should not be used

VariableTypeRequired3165

[SRC]def queryField = CSVHelper.me().isQueryField(headerName)

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

NoDef3166

[SRC]def fieldWithoutStart = queryField? CSVHelper.me().remov..: headerName

[MSG]def for declaration should not be used

VariableTypeRequired3166

[SRC]def fieldWithoutStart = queryField? CSVHelper.me().remov..: headerName

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

UnnecessaryGString3187

[SRC]if (rawLineContent != null && rawLineContent.trim() == "") {

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

UnnecessaryGetter3191

[SRC]long lineNo = csvRecord.getRecordNumber() + numOfComment.. + blankLine

[MSG]getRecordNumber() can probably be rewritten as recordNumber

UnnecessaryGString3195

[SRC]String lineLog = ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NestedForLoop3196

[SRC]for (headerName in headerNames) {

[MSG]Nested for loop

InvertedCondition3214

[SRC]values.put(CSVHelper.DELETE_FLAG, "Y" == rawValue)

[MSG]Y is a constant expression on the left side of a compare equals operation

UnnecessaryGString3214

[SRC]values.put(CSVHelper.DELETE_FLAG, "Y" == rawValue)

[MSG]The String 'Y' can be wrapped in single quotes instead of double quotes

NoDef3218

[SRC]def value = converter.convert(rawValue, type, fieldName)

[MSG]def for declaration should not be used

VariableTypeRequired3218

[SRC]def value = converter.convert(rawValue, type, fieldName)

[MSG]The type is not specified for variable "value"

UnnecessaryGetter3235

[SRC]lineLog += "Line ${lineNo} [${rawLineContent}] import fa..tMessage()}"

[MSG]getMessage() can probably be rewritten as message

UnnecessaryGetter3235

[SRC]lineLog += "Line ${lineNo} [${rawLineContent}] import fa..tMessage()}"

[MSG]getMessage() can probably be rewritten as message

UnnecessaryGetter3235

[SRC]lineLog += "Line ${lineNo} [${rawLineContent}] import fa..tMessage()}"

[MSG]getMessage() can probably be rewritten as message

UnnecessaryGString3250

[SRC]String conditions = ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NestedForLoop3254

[SRC]for (String queryField : queryFields) {

[MSG]Nested for loop

NoDef3255

[SRC]def val = values.get(queryField)

[MSG]def for declaration should not be used

VariableTypeRequired3255

[SRC]def val = values.get(queryField)

[MSG]The type is not specified for variable "val"

UnnecessaryGetter3264

[SRC]log.trace("${domainClazz.getName()} with condition ${con..rd.size()}")

[MSG]getName() can probably be rewritten as name

NoDef3266

[SRC]def existObj = existRecord.get(0)

[MSG]def for declaration should not be used

VariableTypeRequired3266

[SRC]def existObj = existRecord.get(0)

[MSG]The type is not specified for variable "existObj"

DuplicateMapLiteral3275

[SRC]existObj.save(flush: true)

[MSG]Map [flush:true] is duplicated.

UnnecessaryGetter3279

[SRC]recorder.onLineNoUpdate(csvRecord, existObj.getClass().g..existObj.id)

[MSG]getSimpleName() can probably be rewritten as simpleName

InvertedIfElse3287

[SRC]if (!delete) {

[MSG]Testing the negative condition first can make an if statement confusing

NoDef3288

[SRC]def obj = domainClazz.newInstance(values).save(flush: true)

[MSG]def for declaration should not be used

VariableTypeRequired3288

[SRC]def obj = domainClazz.newInstance(values).save(flush: true)

[MSG]The type is not specified for variable "obj"

DuplicateMapLiteral3288

[SRC]def obj = domainClazz.newInstance(values).save(flush: true)

[MSG]Map [flush:true] is duplicated.

InvertedIfElse3299

[SRC]if (!delete) {

[MSG]Testing the negative condition first can make an if statement confusing

NoDef3300

[SRC]def obj = domainClazz.newInstance(values).save(flush: true)

[MSG]def for declaration should not be used

VariableTypeRequired3300

[SRC]def obj = domainClazz.newInstance(values).save(flush: true)

[MSG]The type is not specified for variable "obj"

DuplicateMapLiteral3300

[SRC]def obj = domainClazz.newInstance(values).save(flush: true)

[MSG]Map [flush:true] is duplicated.

ImplicitClosureParameter3324

[SRC][reader, fileInputStream, bomInputStream].each { IOUtils..uietly(it) }

[MSG]By convention closure parameters should be specified explicitly.

ImplicitReturnStatement3329

[SRC]static boolean objectChanged(Object object, Map<String, ..ObjectMap) {

[MSG]The method objectChanged in class tech.muyan.importexport.ImportEngine is missing an explicit return

NoDef3332

[SRC]def k = f.key

[MSG]def for declaration should not be used

VariableTypeRequired3332

[SRC]def k = f.key

[MSG]The type is not specified for variable "k"

NoDef3334

[SRC]def v = f.value

[MSG]def for declaration should not be used

VariableTypeRequired3334

[SRC]def v = f.value

[MSG]The type is not specified for variable "v"

NoDef3335

[SRC]def fieldValue = object."$k"

[MSG]def for declaration should not be used

VariableTypeRequired3335

[SRC]def fieldValue = object."$k"

[MSG]The type is not specified for variable "fieldValue"

➥ ImportEngineHelper.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic210

[SRC]class ImportEngineHelper {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

TrailingComma324

[SRC]domainClass, [sort: 'startDate', order: 'desc', max: 1]

[MSG]Map should contain trailing comma.

UnnecessaryGetter328

[SRC]String existMd5 = lastImportRecord.getCsvFileMD5()

[MSG]getCsvFileMD5() can probably be rewritten as csvFileMD5

UnnecessaryReturnKeyword336

[SRC]return shouldSkip

[MSG]The return keyword is not needed and can be removed

➥ ImportHelper.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic213

[SRC]class ImportHelper {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

ImplementationAsType223

[SRC]static HashMap<String, Collection<Map<String, Object>>> ..plication) {

[MSG]The return type HashMap should be replaced with an interface or more general parent class

MethodParameterTypeRequired315

[SRC]static importFiles(List<String> sortedFiles, directory, metas) {

[MSG]"directory" parameter of "importFiles" method is dynamically typed

MethodParameterTypeRequired315

[SRC]static importFiles(List<String> sortedFiles, directory, metas) {

[MSG]"metas" parameter of "importFiles" method is dynamically typed

MethodReturnTypeRequired315

[SRC]static importFiles(List<String> sortedFiles, directory, metas) {

[MSG]Method "importFiles" has a dynamic return type

NoDef315

[SRC]static importFiles(List<String> sortedFiles, directory, metas) {

[MSG]def for method return type should not be used

NoDef315

[SRC]static importFiles(List<String> sortedFiles, directory, metas) {

[MSG]def for method parameter type should not be used

NoDef315

[SRC]static importFiles(List<String> sortedFiles, directory, metas) {

[MSG]def for method parameter type should not be used

NoDef317

[SRC]def domainClass = DomainClass.findByShortName(csvFile)

[MSG]def for declaration should not be used

VariableTypeRequired317

[SRC]def domainClass = DomainClass.findByShortName(csvFile)

[MSG]The type is not specified for variable "domainClass"

UnnecessaryGetter318

[SRC]String filePath = directory.getAbsolutePath() + File.sep..ile + ".csv"

[MSG]getAbsolutePath() can probably be rewritten as absolutePath

UnnecessaryGString318

[SRC]String filePath = directory.getAbsolutePath() + File.sep..ile + ".csv"

[MSG]The String '.csv' can be wrapped in single quotes instead of double quotes

ImplicitReturnStatement323

[SRC]static HashMap<String, Collection<Map<String, Object>>> ..plication) {

[MSG]The method getMetasOfFiles in class tech.muyan.importexport.ImportHelper is missing an explicit return

ImplicitClosureParameter327

[SRC]def allFields = DomainHelper.getStaticFields(it, application)

[MSG]By convention closure parameters should be specified explicitly.

NoDef327

[SRC]def allFields = DomainHelper.getStaticFields(it, application)

[MSG]def for declaration should not be used

VariableTypeRequired327

[SRC]def allFields = DomainHelper.getStaticFields(it, application)

[MSG]The type is not specified for variable "allFields"

ImplicitClosureParameter328

[SRC]def dynamicFields = DomainHelper.getDynamicFields(it)

[MSG]By convention closure parameters should be specified explicitly.

NoDef328

[SRC]def dynamicFields = DomainHelper.getDynamicFields(it)

[MSG]def for declaration should not be used

VariableTypeRequired328

[SRC]def dynamicFields = DomainHelper.getDynamicFields(it)

[MSG]The type is not specified for variable "dynamicFields"

ImplicitClosureParameter330

[SRC]metas.put(it, allFields)

[MSG]By convention closure parameters should be specified explicitly.

MethodParameterTypeRequired339

[SRC]static void initSeedDomainClassData(application) {

[MSG]"application" parameter of "initSeedDomainClassData" method is dynamically typed

NoDef339

[SRC]static void initSeedDomainClassData(application) {

[MSG]def for method parameter type should not be used

UnnecessaryGString341

[SRC]application.getArtefacts("Domain").each { domainObject ->

[MSG]The String 'Domain' can be wrapped in single quotes instead of double quotes

NoDef342

[SRC]def shortName = domainObject.shortName

[MSG]def for declaration should not be used

VariableTypeRequired342

[SRC]def shortName = domainObject.shortName

[MSG]The type is not specified for variable "shortName"

NoDef343

[SRC]def fullName = domainObject.fullName

[MSG]def for declaration should not be used

VariableTypeRequired343

[SRC]def fullName = domainObject.fullName

[MSG]The type is not specified for variable "fullName"

NoDef344

[SRC]def existing = DomainClass.findByFullName(fullName)

[MSG]def for declaration should not be used

VariableTypeRequired344

[SRC]def existing = DomainClass.findByFullName(fullName)

[MSG]The type is not specified for variable "existing"

➥ ImportRecord.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic211

[SRC]class ImportRecord {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

GrailsDomainHasEquals211

[SRC]class ImportRecord {

[MSG]The domain class tech.muyan.importexport.ImportRecord should define an equals(Object) method

GrailsDomainHasToString211

[SRC]class ImportRecord {

[MSG]The domain class tech.muyan.importexport.ImportRecord should define a toString() method

DuplicateNumberLiteral215

[SRC]updatedIds type: 'text', length: 8192

[MSG]Duplicate Number Literal: 8192

DuplicateStringLiteral215

[SRC]updatedIds type: 'text', length: 8192

[MSG]Duplicate String Literal: text

DuplicateNumberLiteral216

[SRC]deletedIds type: 'text', length: 8192

[MSG]Duplicate Number Literal: 8192

DuplicateStringLiteral216

[SRC]deletedIds type: 'text', length: 8192

[MSG]Duplicate String Literal: text

DuplicateNumberLiteral217

[SRC]noUpdateIds type: 'text', length: 8192

[MSG]Duplicate Number Literal: 8192

DuplicateStringLiteral217

[SRC]noUpdateIds type: 'text', length: 8192

[MSG]Duplicate String Literal: text

DuplicateNumberLiteral218

[SRC]failedLines type: 'text', length: 8192

[MSG]Duplicate Number Literal: 8192

DuplicateStringLiteral218

[SRC]failedLines type: 'text', length: 8192

[MSG]Duplicate String Literal: text

DuplicateNumberLiteral219

[SRC]skippedLines type: 'text', length: 8192

[MSG]Duplicate Number Literal: 8192

DuplicateStringLiteral219

[SRC]skippedLines type: 'text', length: 8192

[MSG]Duplicate String Literal: text

DuplicateNumberLiteral220

[SRC]logs type: 'text', length: 8192

[MSG]Duplicate Number Literal: 8192

DuplicateStringLiteral220

[SRC]logs type: 'text', length: 8192

[MSG]Duplicate String Literal: text

GrailsDomainStringPropertyMaxSize244

[SRC]String csvFileMD5

[MSG]There is no constraint on the size of String property 'csvFileMD5' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize247

[SRC]String csvFileHeader

[MSG]There is no constraint on the size of String property 'csvFileHeader' which will result in applying database defaults

FieldTypeRequired313

[SRC]static mapping = {

[MSG]The type is not specified for field "mapping"

DuplicateMapLiteral315

[SRC]updatedIds type: 'text', length: 8192

[MSG]Map [type:text, length:8192] is duplicated.

DuplicateMapLiteral316

[SRC]deletedIds type: 'text', length: 8192

[MSG]Map [type:text, length:8192] is duplicated.

DuplicateMapLiteral317

[SRC]noUpdateIds type: 'text', length: 8192

[MSG]Map [type:text, length:8192] is duplicated.

DuplicateMapLiteral318

[SRC]failedLines type: 'text', length: 8192

[MSG]Map [type:text, length:8192] is duplicated.

DuplicateMapLiteral319

[SRC]skippedLines type: 'text', length: 8192

[MSG]Map [type:text, length:8192] is duplicated.

DuplicateMapLiteral320

[SRC]logs type: 'text', length: 8192

[MSG]Map [type:text, length:8192] is duplicated.

FieldTypeRequired324

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

DuplicateMapLiteral327

[SRC]status nullable: false

[MSG]Map [nullable:false] is duplicated.

DuplicateMapLiteral328

[SRC]startDate nullable: false

[MSG]Map [nullable:false] is duplicated.

DuplicateMapLiteral331

[SRC]updatedIds nullable: true, blank: true

[MSG]Map [nullable:true, blank:true] is duplicated.

DuplicateMapLiteral332

[SRC]deletedIds nullable: true, blank: true

[MSG]Map [nullable:true, blank:true] is duplicated.

DuplicateMapLiteral333

[SRC]noUpdateIds nullable: true, blank: true

[MSG]Map [nullable:true, blank:true] is duplicated.

DuplicateMapLiteral334

[SRC]failedLines nullable: true, blank: true

[MSG]Map [nullable:true, blank:true] is duplicated.

DuplicateMapLiteral335

[SRC]skippedLines nullable: true, blank: true

[MSG]Map [nullable:true, blank:true] is duplicated.

DuplicateMapLiteral336

[SRC]logs nullable: true, blank: true

[MSG]Map [nullable:true, blank:true] is duplicated.

DuplicateMapLiteral337

[SRC]finishDate nullable: true

[MSG]Map [nullable:true] is duplicated.

➥ ImportRecorder.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic215

[SRC]class ImportRecorder {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

DuplicateStringLiteral262

[SRC]record.logs += lineFailedLog + "\n"

[MSG]Duplicate String Literal:

DuplicateStringLiteral269

[SRC]record.skippedLines += CSVHelper.me().getCSVRecordConten..cord) + "\n"

[MSG]Duplicate String Literal:

DuplicateStringLiteral270

[SRC]record.logs += lineSkipLog + "\n"

[MSG]Duplicate String Literal:

DuplicateStringLiteral2103

[SRC]record.failedLines += CSVHelper.me().getCSVRecordContent..cord) + "\n"

[MSG]Duplicate String Literal:

DuplicateStringLiteral2118

[SRC]record.updatedIds = updatedIds.join(",")

[MSG]Duplicate String Literal: ,

DuplicateStringLiteral2119

[SRC]record.insertedIds = insertedIds.join(",")

[MSG]Duplicate String Literal: ,

DuplicateStringLiteral2120

[SRC]record.deletedIds = deletedIds.join(",")

[MSG]Duplicate String Literal: ,

DuplicateStringLiteral2121

[SRC]record.noUpdateIds = noUpdateIds.join(",")

[MSG]Duplicate String Literal: ,

UnnecessaryGString351

[SRC]String headerLine = headerNames.join(",")

[MSG]The String ',' can be wrapped in single quotes instead of double quotes

UnnecessaryGString361

[SRC]record.failedLines += CSVHelper.me().getCSVRecordContent..cord) + "\n"

[MSG]The String ' ' can be wrapped in single quotes instead of double quotes

UnnecessaryGString362

[SRC]record.logs += lineFailedLog + "\n"

[MSG]The String ' ' can be wrapped in single quotes instead of double quotes

UnnecessaryGString369

[SRC]record.skippedLines += CSVHelper.me().getCSVRecordConten..cord) + "\n"

[MSG]The String ' ' can be wrapped in single quotes instead of double quotes

UnnecessaryGString370

[SRC]record.logs += lineSkipLog + "\n"

[MSG]The String ' ' can be wrapped in single quotes instead of double quotes

NoDef377

[SRC]def content = CSVHelper.me().getCSVRecordContent(csvRecord)

[MSG]def for declaration should not be used

VariableTypeRequired377

[SRC]def content = CSVHelper.me().getCSVRecordContent(csvRecord)

[MSG]The type is not specified for variable "content"

UnnecessaryGString3103

[SRC]record.failedLines += CSVHelper.me().getCSVRecordContent..cord) + "\n"

[MSG]The String ' ' can be wrapped in single quotes instead of double quotes

NoDef3105

[SRC]def msg = "Line ${csvRecord.getRecordNumber()} [${CSVHel..ssage()}]\n"

[MSG]def for declaration should not be used

VariableTypeRequired3105

[SRC]def msg = "Line ${csvRecord.getRecordNumber()} [${CSVHel..ssage()}]\n"

[MSG]The type is not specified for variable "msg"

UnnecessaryGetter3105

[SRC]def msg = "Line ${csvRecord.getRecordNumber()} [${CSVHel..ssage()}]\n"

[MSG]getRecordNumber() can probably be rewritten as recordNumber

UnnecessaryGetter3105

[SRC]def msg = "Line ${csvRecord.getRecordNumber()} [${CSVHel..ssage()}]\n"

[MSG]getMessage() can probably be rewritten as message

UnnecessaryGString3118

[SRC]record.updatedIds = updatedIds.join(",")

[MSG]The String ',' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3119

[SRC]record.insertedIds = insertedIds.join(",")

[MSG]The String ',' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3120

[SRC]record.deletedIds = deletedIds.join(",")

[MSG]The String ',' can be wrapped in single quotes instead of double quotes

UnnecessaryGString3121

[SRC]record.noUpdateIds = noUpdateIds.join(",")

[MSG]The String ',' can be wrapped in single quotes instead of double quotes

Package: tech.muyan.importexport.converter

➥ IdConverter.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]class IdConverter implements Converter {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

ClassForName221

[SRC]def object = Class.forName(type).get(Long.parseLong(sourceValue))

[MSG]Violation in class tech.muyan.importexport.converter.IdConverter. Methods calls to Class.forName(...) can create resource leaks and should almost always be replaced with calls to ClassLoader.loadClass(...)

UnusedImport33

[SRC]import tech.muyan.importexport.CSVHelper

[MSG]The [tech.muyan.importexport.CSVHelper] import is never referenced

UnusedImport34

[SRC]import tech.muyan.importexport.exception.MultiObjectMatchedException

[MSG]The [tech.muyan.importexport.exception.MultiObjectMatchedException] import is never referenced

UnnecessaryGString314

[SRC]public static final String INTENTIONAL_NULL_VALUE = "NULL"

[MSG]The String 'NULL' can be wrapped in single quotes instead of double quotes

UnnecessaryElseStatement320

[SRC]} else {

[MSG]When an if statement block ends with a return statement the else is unnecessary

NoDef321

[SRC]def object = Class.forName(type).get(Long.parseLong(sourceValue))

[MSG]def for declaration should not be used

VariableTypeRequired321

[SRC]def object = Class.forName(type).get(Long.parseLong(sourceValue))

[MSG]The type is not specified for variable "object"

UnnecessaryElseStatement324

[SRC]} else {

[MSG]When an if statement block ends with a return statement the else is unnecessary

UnnecessaryDotClass325

[SRC]throw new NoObjectMatchedException(IdConverter.class, so..Value, type)

[MSG]IdConverter.class can be rewritten as IdConverter

➥ ObjectConverter.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic217

[SRC]class ObjectConverter implements Converter {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

ClassForName228

[SRC]def relateObj = Class.forName(type).withCriteria {

[MSG]Violation in class tech.muyan.importexport.converter.ObjectConverter. Methods calls to Class.forName(...) can create resource leaks and should almost always be replaced with calls to ClassLoader.loadClass(...)

UnnecessaryGString320

[SRC]public static final String INTENTIONAL_NULL_VALUE = "NULL"

[MSG]The String 'NULL' can be wrapped in single quotes instead of double quotes

UnnecessaryElseStatement327

[SRC]} else {

[MSG]When an if statement block ends with a return statement the else is unnecessary

NoDef328

[SRC]def relateObj = Class.forName(type).withCriteria {

[MSG]def for declaration should not be used

VariableTypeRequired328

[SRC]def relateObj = Class.forName(type).withCriteria {

[MSG]The type is not specified for variable "relateObj"

UnnecessaryDotClass334

[SRC]throw new MultiObjectMatchedException(ObjectConverter.cl..Value, type)

[MSG]ObjectConverter.class can be rewritten as ObjectConverter

UnnecessaryDotClass337

[SRC]throw new NoObjectMatchedException(ObjectConverter.class..Value, type)

[MSG]ObjectConverter.class can be rewritten as ObjectConverter

Package: tech.muyan.security

➥ AuthenticationToken.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic23

[SRC]class AuthenticationToken {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

GrailsDomainHasEquals23

[SRC]class AuthenticationToken {

[MSG]The domain class tech.muyan.security.AuthenticationToken should define an equals(Object) method

GrailsDomainHasToString23

[SRC]class AuthenticationToken {

[MSG]The domain class tech.muyan.security.AuthenticationToken should define a toString() method

GrailsDomainStringPropertyMaxSize24

[SRC]String tokenValue

[MSG]There is no constraint on the size of String property 'tokenValue' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize25

[SRC]String username

[MSG]There is no constraint on the size of String property 'username' which will result in applying database defaults

FieldTypeRequired37

[SRC]static mapping = {

[MSG]The type is not specified for field "mapping"

StaticFieldsBeforeInstanceFields37

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.security.AuthenticationToken is declared after an instance field

FieldTypeRequired311

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

StaticFieldsBeforeInstanceFields311

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.security.AuthenticationToken is declared after an instance field

➥ AuthorityHelper.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic212

[SRC]public class AuthorityHelper {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

UnnecessaryPublicModifier312

[SRC]public class AuthorityHelper {

[MSG]The public keyword is unnecessary for classes

UnnecessaryReturnKeyword327

[SRC]return false

[MSG]The return keyword is not needed and can be removed

NoDef331

[SRC]def suffix = (wildcard)? "/**" : ""

[MSG]def for declaration should not be used

VariableTypeRequired331

[SRC]def suffix = (wildcard)? "/**" : ""

[MSG]The type is not specified for variable "suffix"

UnnecessaryGString331

[SRC]def suffix = (wildcard)? "/**" : ""

[MSG]The String '/**' can be wrapped in single quotes instead of double quotes

UnnecessaryGString331

[SRC]def suffix = (wildcard)? "/**" : ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NoDef332

[SRC]def map = RequestMap.findByUrlAndHttpMethod("/${clazz.ge.. httpMethod)

[MSG]def for declaration should not be used

VariableTypeRequired332

[SRC]def map = RequestMap.findByUrlAndHttpMethod("/${clazz.ge.. httpMethod)

[MSG]The type is not specified for variable "map"

UnnecessaryGetter332

[SRC]def map = RequestMap.findByUrlAndHttpMethod("/${clazz.ge.. httpMethod)

[MSG]getName() can probably be rewritten as name

NoDef333

[SRC]def isNullOrEmpty = (map == null || map.configAttribute == null)

[MSG]def for declaration should not be used

VariableTypeRequired333

[SRC]def isNullOrEmpty = (map == null || map.configAttribute == null)

[MSG]The type is not specified for variable "isNullOrEmpty"

NoDef334

[SRC]def roles = isNullOrEmpty? "" : map.configAttribute

[MSG]def for declaration should not be used

VariableTypeRequired334

[SRC]def roles = isNullOrEmpty? "" : map.configAttribute

[MSG]The type is not specified for variable "roles"

UnnecessaryGString334

[SRC]def roles = isNullOrEmpty? "" : map.configAttribute

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGetter335

[SRC]map = RequestMap.findByUrlAndHttpMethod("/${clazz.getSim.. httpMethod)

[MSG]getSimpleName() can probably be rewritten as simpleName

UnnecessaryGString338

[SRC]roles += isNullOrEmpty? "" : map.configAttribute

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString340

[SRC]roles += isNullOrEmpty? "" : "," + map.configAttribute

[MSG]The String '' can be wrapped in single quotes instead of double quotes

UnnecessaryGString340

[SRC]roles += isNullOrEmpty? "" : "," + map.configAttribute

[MSG]The String ',' can be wrapped in single quotes instead of double quotes

UnnecessaryReturnKeyword342

[SRC]return roles

[MSG]The return keyword is not needed and can be removed

➥ Group.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic28

[SRC]class Group implements Serializable {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

GrailsDomainStringPropertyMaxSize212

[SRC]String name

[MSG]There is no constraint on the size of String property 'name' which will result in applying database defaults

ImplicitReturnStatement314

[SRC]Set<Role> getAuthorities() {

[MSG]The method getAuthorities in class tech.muyan.security.Group is missing an explicit return

FieldTypeRequired318

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

StaticFieldsBeforeInstanceFields318

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.security.Group is declared after an instance field

FieldTypeRequired322

[SRC]static labelField = 'name'

[MSG]The type is not specified for field "labelField"

StaticFieldsBeforeInstanceFields322

[SRC]static labelField = 'name'

[MSG]The static field labelField in class tech.muyan.security.Group is declared after an instance field

FieldTypeRequired324

[SRC]static mapping = {

[MSG]The type is not specified for field "mapping"

StaticFieldsBeforeInstanceFields324

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.security.Group is declared after an instance field

UnnecessaryGString325

[SRC]table "application_group"

[MSG]The String 'application_group' can be wrapped in single quotes instead of double quotes

FieldTypeRequired328

[SRC]static searchable = {

[MSG]The type is not specified for field "searchable"

StaticFieldsBeforeInstanceFields328

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.security.Group is declared after an instance field

➥ GroupRole.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic29

[SRC]class GroupRole implements Serializable {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

Instanceof218

[SRC]if (other == null || !(other instanceof GroupRole)) {

[MSG]The instanceof operator is used in class tech.muyan.security.GroupRole

FactoryMethodName251

[SRC]static GroupRole create(Group group, Role role, boolean ..h = false) {

[MSG]Violation in class GroupRole. The method 'create' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/

ImplicitReturnStatement317

[SRC]boolean equals(other) {

[MSG]The method equals in class tech.muyan.security.GroupRole is missing an explicit return

MethodParameterTypeRequired317

[SRC]boolean equals(other) {

[MSG]"other" parameter of "equals" method is dynamically typed

NoDef317

[SRC]boolean equals(other) {

[MSG]def for method parameter type should not be used

ImplicitReturnStatement325

[SRC]int hashCode() {

[MSG]The method hashCode in class tech.muyan.security.GroupRole is missing an explicit return

ImplicitReturnStatement336

[SRC]static GroupRole get(long groupId, long roleId) {

[MSG]The method get in class tech.muyan.security.GroupRole is missing an explicit return

StaticMethodsBeforeInstanceMethods336

[SRC]static GroupRole get(long groupId, long roleId) {

[MSG]The public static method get in class tech.muyan.security.GroupRole is declared after a public instance method

ImplicitReturnStatement340

[SRC]static boolean exists(long groupId, long roleId) {

[MSG]The method exists in class tech.muyan.security.GroupRole is missing an explicit return

StaticMethodsBeforeInstanceMethods340

[SRC]static boolean exists(long groupId, long roleId) {

[MSG]The public static method exists in class tech.muyan.security.GroupRole is declared after a public instance method

ImplicitReturnStatement344

[SRC]private static DetachedCriteria criteriaFor(long groupId..ng roleId) {

[MSG]The method criteriaFor in class tech.muyan.security.GroupRole is missing an explicit return

ImplicitReturnStatement351

[SRC]static GroupRole create(Group group, Role role, boolean ..h = false) {

[MSG]The method create in class tech.muyan.security.GroupRole is missing an explicit return

PublicMethodsBeforeNonPublicMethods351

[SRC]static GroupRole create(Group group, Role role, boolean ..h = false) {

[MSG]The public method create in class tech.muyan.security.GroupRole is declared after a non-public method

StaticMethodsBeforeInstanceMethods351

[SRC]static GroupRole create(Group group, Role role, boolean ..h = false) {

[MSG]The public static method create in class tech.muyan.security.GroupRole is declared after a public instance method

NoDef352

[SRC]def instance = new GroupRole(group: group, role: role)

[MSG]def for declaration should not be used

VariableTypeRequired352

[SRC]def instance = new GroupRole(group: group, role: role)

[MSG]The type is not specified for variable "instance"

ImplicitReturnStatement357

[SRC]static boolean remove(Group rg, Role r) {

[MSG]The method remove in class tech.muyan.security.GroupRole is missing an explicit return

PublicMethodsBeforeNonPublicMethods357

[SRC]static boolean remove(Group rg, Role r) {

[MSG]The public method remove in class tech.muyan.security.GroupRole is declared after a non-public method

StaticMethodsBeforeInstanceMethods357

[SRC]static boolean remove(Group rg, Role r) {

[MSG]The public static method remove in class tech.muyan.security.GroupRole is declared after a public instance method

ImplicitReturnStatement364

[SRC]static int removeAll(Role r) {

[MSG]The method removeAll in class tech.muyan.security.GroupRole is missing an explicit return

PublicMethodsBeforeNonPublicMethods364

[SRC]static int removeAll(Role r) {

[MSG]The public method removeAll in class tech.muyan.security.GroupRole is declared after a non-public method

StaticMethodsBeforeInstanceMethods364

[SRC]static int removeAll(Role r) {

[MSG]The public static method removeAll in class tech.muyan.security.GroupRole is declared after a public instance method

ImplicitReturnStatement368

[SRC]static int removeAll(Group rg) {

[MSG]The method removeAll in class tech.muyan.security.GroupRole is missing an explicit return

PublicMethodsBeforeNonPublicMethods368

[SRC]static int removeAll(Group rg) {

[MSG]The public method removeAll in class tech.muyan.security.GroupRole is declared after a non-public method

StaticMethodsBeforeInstanceMethods368

[SRC]static int removeAll(Group rg) {

[MSG]The public static method removeAll in class tech.muyan.security.GroupRole is declared after a public instance method

FieldTypeRequired372

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

StaticFieldsBeforeInstanceFields372

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.security.GroupRole is declared after an instance field

➥ RequestMap.groovy

Rule NamePriorityLine #Source Line / Message
DuplicateStringLiteral212

[SRC]@ToString(includes = ['configAttribute', 'httpMethod', '..age = false)

[MSG]Duplicate String Literal: configAttribute

DuplicateStringLiteral212

[SRC]@ToString(includes = ['configAttribute', 'httpMethod', '..age = false)

[MSG]Duplicate String Literal: httpMethod

DuplicateStringLiteral212

[SRC]@ToString(includes = ['configAttribute', 'httpMethod', '..age = false)

[MSG]Duplicate String Literal: url

CompileStatic213

[SRC]class RequestMap implements Serializable {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

GrailsDomainWithServiceReference217

[SRC]SpringSecurityService springSecurityService

[MSG]Violation in class tech.muyan.security.RequestMap. Domain class RequestMap should not reference services (offending field: springSecurityService)

GrailsDomainStringPropertyMaxSize221

[SRC]@BindUsing({ val, source ->

[MSG]There is no constraint on the size of String property 'configAttribute' which will result in applying database defaults

DuplicateStringLiteral222

[SRC]def value = source['configAttribute']

[MSG]Duplicate String Literal: configAttribute

Instanceof223

[SRC]if (value instanceof JSONArray || value instanceof ArrayList) {

[MSG]The instanceof operator is used in class tech.muyan.security.RequestMap

Instanceof223

[SRC]if (value instanceof JSONArray || value instanceof ArrayList) {

[MSG]The instanceof operator is used in class tech.muyan.security.RequestMap

GrailsDomainStringPropertyMaxSize247

[SRC]String url

[MSG]There is no constraint on the size of String property 'url' which will result in applying database defaults

DuplicateStringLiteral251

[SRC]result["url"] = url

[MSG]Duplicate String Literal: url

DuplicateStringLiteral252

[SRC]result["httpMethod"] = httpMethod

[MSG]Duplicate String Literal: httpMethod

DuplicateStringLiteral254

[SRC]for (roleName in configAttribute.split(",")) {

[MSG]Duplicate String Literal: ,

DuplicateStringLiteral257

[SRC]result["configAttribute"] = ids

[MSG]Duplicate String Literal: configAttribute

DuplicateStringLiteral264

[SRC]httpMethod nullable: true, unique: 'url'

[MSG]Duplicate String Literal: url

DuplicateStringLiteral265

[SRC]url nullable: false, blank: false, unique: 'httpMethod'

[MSG]Duplicate String Literal: httpMethod

FieldTypeRequired315

[SRC]static transients = ['springSecurityService']

[MSG]The type is not specified for field "transients"

StaticFieldsBeforeInstanceFields319

[SRC]private static final long serialVersionUID = 1

[MSG]The static field serialVersionUID in class tech.muyan.security.RequestMap is declared after an instance field

NoDef322

[SRC]def value = source['configAttribute']

[MSG]def for declaration should not be used

VariableTypeRequired322

[SRC]def value = source['configAttribute']

[MSG]The type is not specified for variable "value"

NoDef324

[SRC]def roleIds = value as List

[MSG]def for declaration should not be used

VariableTypeRequired324

[SRC]def roleIds = value as List

[MSG]The type is not specified for variable "roleIds"

UnnecessaryGString325

[SRC]String roleNames = ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

NoDef327

[SRC]def longIds = []

[MSG]def for declaration should not be used

VariableTypeRequired327

[SRC]def longIds = []

[MSG]The type is not specified for variable "longIds"

ImplicitClosureParameter335

[SRC]if (it != null && it.authority != null) {

[MSG]By convention closure parameters should be specified explicitly.

ImplicitClosureParameter335

[SRC]if (it != null && it.authority != null) {

[MSG]By convention closure parameters should be specified explicitly.

ImplicitClosureParameter336

[SRC]roleNames += (it.authority + ",")

[MSG]By convention closure parameters should be specified explicitly.

UnnecessaryGString336

[SRC]roleNames += (it.authority + ",")

[MSG]The String ',' can be wrapped in single quotes instead of double quotes

UnnecessarySubstring340

[SRC]return roleNames.substring(0, roleNames.length() - 1)

[MSG]Violation in class tech.muyan.security.RequestMap. The String.substring(int, int) method can be replaced with the subscript operator

UnnecessaryElseStatement341

[SRC]} else {

[MSG]When an if statement block ends with a return statement the else is unnecessary

MethodReturnTypeRequired349

[SRC]def render() {

[MSG]Method "render" has a dynamic return type

NoDef349

[SRC]def render() {

[MSG]def for method return type should not be used

UnnecessaryGString351

[SRC]result["url"] = url

[MSG]The String 'url' can be wrapped in single quotes instead of double quotes

UnnecessaryGString352

[SRC]result["httpMethod"] = httpMethod

[MSG]The String 'httpMethod' can be wrapped in single quotes instead of double quotes

UnnecessaryGString354

[SRC]for (roleName in configAttribute.split(",")) {

[MSG]The String ',' can be wrapped in single quotes instead of double quotes

UnnecessaryGString357

[SRC]result["configAttribute"] = ids

[MSG]The String 'configAttribute' can be wrapped in single quotes instead of double quotes

UnnecessaryGString358

[SRC]result["id"] = id

[MSG]The String 'id' can be wrapped in single quotes instead of double quotes

UnnecessaryReturnKeyword359

[SRC]return result

[MSG]The return keyword is not needed and can be removed

FieldTypeRequired362

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

StaticFieldsBeforeInstanceFields362

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.security.RequestMap is declared after an instance field

FieldTypeRequired368

[SRC]static mapping = {

[MSG]The type is not specified for field "mapping"

StaticFieldsBeforeInstanceFields368

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.security.RequestMap is declared after an instance field

MethodReturnTypeRequired372

[SRC]def afterInsert() {

[MSG]Method "afterInsert" has a dynamic return type

NoDef372

[SRC]def afterInsert() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired376

[SRC]def afterUpdate() {

[MSG]Method "afterUpdate" has a dynamic return type

NoDef376

[SRC]def afterUpdate() {

[MSG]def for method return type should not be used

MethodReturnTypeRequired380

[SRC]def afterDelete() {

[MSG]Method "afterDelete" has a dynamic return type

NoDef380

[SRC]def afterDelete() {

[MSG]def for method return type should not be used

➥ Role.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic28

[SRC]class Role implements Serializable {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

GrailsDomainStringPropertyMaxSize212

[SRC]String authority

[MSG]There is no constraint on the size of String property 'authority' which will result in applying database defaults

FieldTypeRequired314

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

StaticFieldsBeforeInstanceFields314

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.security.Role is declared after an instance field

FieldTypeRequired318

[SRC]static labelField = 'authority'

[MSG]The type is not specified for field "labelField"

StaticFieldsBeforeInstanceFields318

[SRC]static labelField = 'authority'

[MSG]The static field labelField in class tech.muyan.security.Role is declared after an instance field

FieldTypeRequired327

[SRC]static searchable = {

[MSG]The type is not specified for field "searchable"

StaticFieldsBeforeInstanceFields327

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.security.Role is declared after an instance field

UnnecessaryGString329

[SRC]only = ["authority"]

[MSG]The String 'authority' can be wrapped in single quotes instead of double quotes

FieldTypeRequired332

[SRC]static mapping = {

[MSG]The type is not specified for field "mapping"

StaticFieldsBeforeInstanceFields332

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.security.Role is declared after an instance field

UnnecessaryGString333

[SRC]table "application_role"

[MSG]The String 'application_role' can be wrapped in single quotes instead of double quotes

➥ RoleHierarchyEntry.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic28

[SRC]class RoleHierarchyEntry implements Serializable {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

GrailsDomainStringPropertyMaxSize212

[SRC]String entry

[MSG]There is no constraint on the size of String property 'entry' which will result in applying database defaults

FieldTypeRequired314

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

StaticFieldsBeforeInstanceFields314

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.security.RoleHierarchyEntry is declared after an instance field

➥ User.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic211

[SRC]class User implements Serializable {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

GrailsDomainStringPropertyMaxSize213

[SRC]String username

[MSG]There is no constraint on the size of String property 'username' which will result in applying database defaults

GrailsDomainStringPropertyMaxSize214

[SRC]String password

[MSG]There is no constraint on the size of String property 'password' which will result in applying database defaults

DuplicateStringLiteral265

[SRC]result['username'] = username

[MSG]Duplicate String Literal: username

ImplicitReturnStatement321

[SRC]Set<Group> getAuthorities() {

[MSG]The method getAuthorities in class tech.muyan.security.User is missing an explicit return

FieldTypeRequired331

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

StaticFieldsBeforeInstanceFields331

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.security.User is declared after an instance field

FieldTypeRequired336

[SRC]static mapping = {

[MSG]The type is not specified for field "mapping"

StaticFieldsBeforeInstanceFields336

[SRC]static mapping = {

[MSG]The static field mapping in class tech.muyan.security.User is declared after an instance field

UnnecessaryGString338

[SRC]table "application_user"

[MSG]The String 'application_user' can be wrapped in single quotes instead of double quotes

FieldTypeRequired341

[SRC]static searchable = {

[MSG]The type is not specified for field "searchable"

StaticFieldsBeforeInstanceFields341

[SRC]static searchable = {

[MSG]The static field searchable in class tech.muyan.security.User is declared after an instance field

MethodReturnTypeRequired346

[SRC]def beforeInsert() {

[MSG]Method "beforeInsert" has a dynamic return type

NoDef346

[SRC]def beforeInsert() {

[MSG]def for method return type should not be used

NoDef347

[SRC]def group = Group.findByName(UserGroup.USER_DEFAULT_GROUP)

[MSG]def for declaration should not be used

VariableTypeRequired347

[SRC]def group = Group.findByName(UserGroup.USER_DEFAULT_GROUP)

[MSG]The type is not specified for variable "group"

MethodReturnTypeRequired357

[SRC]def render() {

[MSG]Method "render" has a dynamic return type

NoDef357

[SRC]def render() {

[MSG]def for method return type should not be used

NoDef358

[SRC]def result = [:]

[MSG]def for declaration should not be used

VariableTypeRequired358

[SRC]def result = [:]

[MSG]The type is not specified for variable "result"

UnnecessaryGString366

[SRC]result['password'] = ""

[MSG]The String '' can be wrapped in single quotes instead of double quotes

FieldTypeRequired370

[SRC]static hasMany = [groups: UserGroup]

[MSG]The type is not specified for field "hasMany"

StaticFieldsBeforeInstanceFields370

[SRC]static hasMany = [groups: UserGroup]

[MSG]The static field hasMany in class tech.muyan.security.User is declared after an instance field

FieldTypeRequired372

[SRC]static belongsTo = Organization

[MSG]The type is not specified for field "belongsTo"

StaticFieldsBeforeInstanceFields372

[SRC]static belongsTo = Organization

[MSG]The static field belongsTo in class tech.muyan.security.User is declared after an instance field

FieldTypeRequired374

[SRC]static labelField = "username"

[MSG]The type is not specified for field "labelField"

StaticFieldsBeforeInstanceFields374

[SRC]static labelField = "username"

[MSG]The static field labelField in class tech.muyan.security.User is declared after an instance field

UnnecessaryGString374

[SRC]static labelField = "username"

[MSG]The String 'username' can be wrapped in single quotes instead of double quotes

➥ UserGroup.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic211

[SRC]class UserGroup implements Serializable {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

Instanceof220

[SRC]if (other == null || !(other instanceof UserGroup)) {

[MSG]The instanceof operator is used in class tech.muyan.security.UserGroup

FactoryMethodName253

[SRC]static UserGroup create(User user, Group group, boolean ..h = false) {

[MSG]Violation in class UserGroup. The method 'create' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/

UnnecessaryGString313

[SRC]public static final String USER_DEFAULT_GROUP = "USER"

[MSG]The String 'USER' can be wrapped in single quotes instead of double quotes

ImplicitReturnStatement319

[SRC]boolean equals(other) {

[MSG]The method equals in class tech.muyan.security.UserGroup is missing an explicit return

MethodParameterTypeRequired319

[SRC]boolean equals(other) {

[MSG]"other" parameter of "equals" method is dynamically typed

NoDef319

[SRC]boolean equals(other) {

[MSG]def for method parameter type should not be used

ImplicitReturnStatement327

[SRC]int hashCode() {

[MSG]The method hashCode in class tech.muyan.security.UserGroup is missing an explicit return

ImplicitReturnStatement338

[SRC]static UserGroup get(long userId, long groupId) {

[MSG]The method get in class tech.muyan.security.UserGroup is missing an explicit return

StaticMethodsBeforeInstanceMethods338

[SRC]static UserGroup get(long userId, long groupId) {

[MSG]The public static method get in class tech.muyan.security.UserGroup is declared after a public instance method

ImplicitReturnStatement342

[SRC]static boolean exists(long userId, long groupId) {

[MSG]The method exists in class tech.muyan.security.UserGroup is missing an explicit return

StaticMethodsBeforeInstanceMethods342

[SRC]static boolean exists(long userId, long groupId) {

[MSG]The public static method exists in class tech.muyan.security.UserGroup is declared after a public instance method

ImplicitReturnStatement346

[SRC]private static DetachedCriteria criteriaFor(long userId,..g groupId) {

[MSG]The method criteriaFor in class tech.muyan.security.UserGroup is missing an explicit return

ImplicitReturnStatement353

[SRC]static UserGroup create(User user, Group group, boolean ..h = false) {

[MSG]The method create in class tech.muyan.security.UserGroup is missing an explicit return

PublicMethodsBeforeNonPublicMethods353

[SRC]static UserGroup create(User user, Group group, boolean ..h = false) {

[MSG]The public method create in class tech.muyan.security.UserGroup is declared after a non-public method

StaticMethodsBeforeInstanceMethods353

[SRC]static UserGroup create(User user, Group group, boolean ..h = false) {

[MSG]The public static method create in class tech.muyan.security.UserGroup is declared after a public instance method

NoDef354

[SRC]def instance = new UserGroup(user: user, group: group)

[MSG]def for declaration should not be used

VariableTypeRequired354

[SRC]def instance = new UserGroup(user: user, group: group)

[MSG]The type is not specified for variable "instance"

ImplicitReturnStatement359

[SRC]static boolean remove(User u, Group rg) {

[MSG]The method remove in class tech.muyan.security.UserGroup is missing an explicit return

PublicMethodsBeforeNonPublicMethods359

[SRC]static boolean remove(User u, Group rg) {

[MSG]The public method remove in class tech.muyan.security.UserGroup is declared after a non-public method

StaticMethodsBeforeInstanceMethods359

[SRC]static boolean remove(User u, Group rg) {

[MSG]The public static method remove in class tech.muyan.security.UserGroup is declared after a public instance method

ImplicitReturnStatement366

[SRC]static int removeAll(User u) {

[MSG]The method removeAll in class tech.muyan.security.UserGroup is missing an explicit return

PublicMethodsBeforeNonPublicMethods366

[SRC]static int removeAll(User u) {

[MSG]The public method removeAll in class tech.muyan.security.UserGroup is declared after a non-public method

StaticMethodsBeforeInstanceMethods366

[SRC]static int removeAll(User u) {

[MSG]The public static method removeAll in class tech.muyan.security.UserGroup is declared after a public instance method

ImplicitReturnStatement370

[SRC]static int removeAll(Group rg) {

[MSG]The method removeAll in class tech.muyan.security.UserGroup is missing an explicit return

PublicMethodsBeforeNonPublicMethods370

[SRC]static int removeAll(Group rg) {

[MSG]The public method removeAll in class tech.muyan.security.UserGroup is declared after a non-public method

StaticMethodsBeforeInstanceMethods370

[SRC]static int removeAll(Group rg) {

[MSG]The public static method removeAll in class tech.muyan.security.UserGroup is declared after a public instance method

FieldTypeRequired374

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

StaticFieldsBeforeInstanceFields374

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.security.UserGroup is declared after an instance field

FieldTypeRequired387

[SRC]static searchable = false

[MSG]The type is not specified for field "searchable"

StaticFieldsBeforeInstanceFields387

[SRC]static searchable = false

[MSG]The static field searchable in class tech.muyan.security.UserGroup is declared after an instance field

➥ UserPasswordEncoderListener.groovy

Rule NamePriorityLine #Source Line / Message
Instanceof228

[SRC]if (event.entityObject instanceof User) {

[MSG]The instanceof operator is used in class tech.muyan.security.UserPasswordEncoderListener

Instanceof230

[SRC]if (u.password && ((event instanceof PreInsertEvent) ||..sword')))) {

[MSG]The instanceof operator is used in class tech.muyan.security.UserPasswordEncoderListener

Instanceof230

[SRC]if (u.password && ((event instanceof PreInsertEvent) ||..sword')))) {

[MSG]The instanceof operator is used in class tech.muyan.security.UserPasswordEncoderListener

DuplicateStringLiteral231

[SRC]event.getEntityAccess().setProperty('password', encodePa..u.password))

[MSG]Duplicate String Literal: password

UnnecessaryGetter331

[SRC]event.getEntityAccess().setProperty('password', encodePa..u.password))

[MSG]getEntityAccess() can probably be rewritten as entityAccess

ImplicitReturnStatement336

[SRC]private String encodePassword(String password) {

[MSG]The method encodePassword in class tech.muyan.security.UserPasswordEncoderListener is missing an explicit return

➥ UserRole.groovy

Rule NamePriorityLine #Source Line / Message
CompileStatic29

[SRC]class UserRole implements Serializable {

[MSG]Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic

Instanceof218

[SRC]if (other != null && other instanceof UserRole) {

[MSG]The instanceof operator is used in class tech.muyan.security.UserRole

FactoryMethodName252

[SRC]static UserRole create(User user, Role role, boolean flush = false) {

[MSG]Violation in class UserRole. The method 'create' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/

MethodParameterTypeRequired317

[SRC]boolean equals(other) {

[MSG]"other" parameter of "equals" method is dynamically typed

NoDef317

[SRC]boolean equals(other) {

[MSG]def for method parameter type should not be used

UnnecessaryNullCheckBeforeInstanceOf318

[SRC]if (other != null && other instanceof UserRole) {

[MSG]The condition ((other != null) && (other instanceof UserRole)) can be safely simplified to (other instanceof UserRole)

ImplicitReturnStatement326

[SRC]int hashCode() {

[MSG]The method hashCode in class tech.muyan.security.UserRole is missing an explicit return

ImplicitReturnStatement337

[SRC]static UserRole get(long userId, long roleId) {

[MSG]The method get in class tech.muyan.security.UserRole is missing an explicit return

StaticMethodsBeforeInstanceMethods337

[SRC]static UserRole get(long userId, long roleId) {

[MSG]The public static method get in class tech.muyan.security.UserRole is declared after a public instance method

ImplicitReturnStatement341

[SRC]static boolean exists(long userId, long roleId) {

[MSG]The method exists in class tech.muyan.security.UserRole is missing an explicit return

StaticMethodsBeforeInstanceMethods341

[SRC]static boolean exists(long userId, long roleId) {

[MSG]The public static method exists in class tech.muyan.security.UserRole is declared after a public instance method

ImplicitReturnStatement345

[SRC]private static DetachedCriteria criteriaFor(long userId,..ng roleId) {

[MSG]The method criteriaFor in class tech.muyan.security.UserRole is missing an explicit return

ImplicitReturnStatement352

[SRC]static UserRole create(User user, Role role, boolean flush = false) {

[MSG]The method create in class tech.muyan.security.UserRole is missing an explicit return

PublicMethodsBeforeNonPublicMethods352

[SRC]static UserRole create(User user, Role role, boolean flush = false) {

[MSG]The public method create in class tech.muyan.security.UserRole is declared after a non-public method

StaticMethodsBeforeInstanceMethods352

[SRC]static UserRole create(User user, Role role, boolean flush = false) {

[MSG]The public static method create in class tech.muyan.security.UserRole is declared after a public instance method

NoDef353

[SRC]def instance = new UserRole(user: user, role: role)

[MSG]def for declaration should not be used

VariableTypeRequired353

[SRC]def instance = new UserRole(user: user, role: role)

[MSG]The type is not specified for variable "instance"

ImplicitReturnStatement358

[SRC]static boolean remove(User u, Role r) {

[MSG]The method remove in class tech.muyan.security.UserRole is missing an explicit return

PublicMethodsBeforeNonPublicMethods358

[SRC]static boolean remove(User u, Role r) {

[MSG]The public method remove in class tech.muyan.security.UserRole is declared after a non-public method

StaticMethodsBeforeInstanceMethods358

[SRC]static boolean remove(User u, Role r) {

[MSG]The public static method remove in class tech.muyan.security.UserRole is declared after a public instance method

ImplicitReturnStatement365

[SRC]static int removeAll(User u) {

[MSG]The method removeAll in class tech.muyan.security.UserRole is missing an explicit return

PublicMethodsBeforeNonPublicMethods365

[SRC]static int removeAll(User u) {

[MSG]The public method removeAll in class tech.muyan.security.UserRole is declared after a non-public method

StaticMethodsBeforeInstanceMethods365

[SRC]static int removeAll(User u) {

[MSG]The public static method removeAll in class tech.muyan.security.UserRole is declared after a public instance method

ImplicitReturnStatement369

[SRC]static int removeAll(Role r) {

[MSG]The method removeAll in class tech.muyan.security.UserRole is missing an explicit return

PublicMethodsBeforeNonPublicMethods369

[SRC]static int removeAll(Role r) {

[MSG]The public method removeAll in class tech.muyan.security.UserRole is declared after a non-public method

StaticMethodsBeforeInstanceMethods369

[SRC]static int removeAll(Role r) {

[MSG]The public static method removeAll in class tech.muyan.security.UserRole is declared after a public instance method

FieldTypeRequired373

[SRC]static constraints = {

[MSG]The type is not specified for field "constraints"

StaticFieldsBeforeInstanceFields373

[SRC]static constraints = {

[MSG]The static field constraints in class tech.muyan.security.UserRole is declared after an instance field

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.