Package | Total Files | Files with Violations | Priority 1 | Priority 2 | Priority 3 |
---|---|---|---|---|---|
All Packages | 32 | 24 | - | 117 | 10 |
org/k1s/cpn/nppn/att | 3 | 1 | - | 27 | 1 |
org/k1s/cpn/nppn/pragmatics | 5 | 4 | - | 13 | 5 |
org/k1s/nppn | 2 | 2 | - | 7 | - |
org/k1s/nppn/generation | 7 | 6 | - | 24 | 3 |
org/k1s/nppn/cpn/io | 1 | 1 | - | 7 | - |
org/k1s/nppn/blocks | 7 | 4 | - | 8 | 1 |
org/k1s/nppn/blocks/derived | 3 | 2 | - | 21 | - |
org/k1s/nppn/generationVisitors | 4 | 4 | - | 10 | - |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
IfStatementBraces | 2 | 35 | [SRC]if(it.controlFlow || it.block != null) controlFlowPragma..s << it.name [MSG]The if statement lacks braces |
FactoryMethodName | 2 | 48 | [SRC]AbstractTemplateTree createATT(pn, pragmatics, bindings){ [MSG]Violation in class ATTFactory. The method 'createATT' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/ |
DuplicateStringLiteral | 2 | 89 | [SRC]page.object.findAll{ it instanceof Place && !it.pragmati..ch{ state -> [MSG]Duplicate String Literal: LCV |
IfStatementBraces | 2 | 106 | [SRC]if(page.id == subPageID) [MSG]The if statement lacks braces |
DuplicateStringLiteral | 2 | 137 | [SRC]atomic.pragmatics = service.start_node.pragmatics.findAl..= "service"} [MSG]Duplicate String Literal: service |
IfStatementBraces | 2 | 142 | [SRC]if(firstBlockStart.size() == 0) return service [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 144 | [SRC]if(firstBlockStart.size() > 1) throw new Exception("unex..rt.size()}") [MSG]The if statement lacks braces |
LineLength | 2 | 144 | [SRC]if(firstBlockStart.size() > 1) throw new Exception("unex..rt.size()}") [MSG]The line exceeds 120 characters. The line is 151 characters. |
ThrowException | 2 | 144 | [SRC]if(firstBlockStart.size() > 1) throw new Exception("unex..rt.size()}") [MSG]The type Exception should not be thrown |
IfStatementBraces | 2 | 150 | [SRC]if(block != null) service.children << block [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 153 | [SRC]if(block != null) service.children << block [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 168 | [SRC]if(isControllFlowPlace(it.target)) retval << it.target [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 181 | [SRC]if(controlFlowPragmatics.contains(it.name)) retval = true [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 196 | [SRC]if(pragmaticsMap[it.name].block != null) retval = true [MSG]The if statement lacks braces |
EmptyElseBlock | 2 | 217 | [SRC]} else { [MSG]The else block is empty |
FactoryMethodName | 2 | 234 | [SRC]def createBlock(Place node, parent){ [MSG]Violation in class ATTFactory. The method 'createBlock' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/ |
IfStatementBraces | 2 | 248 | [SRC]if(block != null) sequence.children << block [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 258 | [SRC]if(block != null) sequence.children << block [MSG]The if statement lacks braces |
ThrowException | 2 | 270 | [SRC]throw new Exception("branching not yet supported") [MSG]The type Exception should not be thrown |
ThrowException | 2 | 272 | [SRC]throw new Exception("block type for ${node.name} not yet supported") [MSG]The type Exception should not be thrown |
FactoryMethodName | 2 | 281 | [SRC]def createAtomic(Place node, parent, transition = null){ [MSG]Violation in class ATTFactory. The method 'createAtomic' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/ |
LineLength | 2 | 282 | [SRC]//if(node.sourceArc.size() != 1) throw new Exception("No..xpected 1.") [MSG]The line exceeds 120 characters. The line is 162 characters. |
IfStatementBraces | 2 | 298 | [SRC]if(transition == null) return null [MSG]The if statement lacks braces |
DuplicateStringLiteral | 2 | 315 | [SRC]def res = findNodesInPageByPragmatic(page, "service") [MSG]Duplicate String Literal: service |
ThrowException | 2 | 317 | [SRC]throw new Exception("Too many services in $page : $res") [MSG]The type Exception should not be thrown |
ThrowException | 2 | 320 | [SRC]throw new Exception("No service found $page") [MSG]The type Exception should not be thrown |
ThrowException | 2 | 335 | [SRC]throw new Exception("Too many returns in $page") [MSG]The type Exception should not be thrown |
ParameterReassignment | 3 | 294 | [SRC]transition = it.target [MSG]The method parameter [transition] in class org.k1s.cpn.nppn.att.ATTFactory was reassigned. Use a temporary variable instead. |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
FactoryMethodName | 2 | 21 | [SRC]def build(closure){ [MSG]Violation in class PrgamaticsDescriptorDSL. The method 'build' matches the regular expression /(build.*|create.*)/ and does not appear in a class matching /*.Builder/ |
IfStatementBraces | 2 | 25 | [SRC]if(!(closure instanceof Closure)) throw new IllegalArgum..: $closure") [MSG]The if statement lacks braces |
ParameterReassignment | 3 | 23 | [SRC]closure = new GroovyShell().evaluate("return {${closure}}") [MSG]The method parameter [closure] in class org.k1s.cpn.nppn.pragmatics.PrgamaticsDescriptorDSL was reassigned. Use a temporary variable instead. |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
DuplicateStringLiteral | 2 | 48 | [SRC]prag.name = pragDef.subSequence(0, pragDef.indexOf('(')) [MSG]Duplicate String Literal: ( |
DuplicateStringLiteral | 2 | 51 | [SRC]String d = pragDef.substring(pragDef.indexOf('(') + 1, [MSG]Duplicate String Literal: ( |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
ThrowException | 2 | 50 | [SRC]throw new Exception("can not construct PragmaticConstrai..${c.class}") [MSG]The type Exception should not be thrown |
ParameterReassignment | 3 | 29 | [SRC]origin = OriginType.EXPLICIT [MSG]The method parameter [origin] in class org.k1s.cpn.nppn.pragmatics.PragmaticsDescriptor was reassigned. Use a temporary variable instead. |
ParameterReassignment | 3 | 31 | [SRC]origin = OriginType.DERIVED [MSG]The method parameter [origin] in class org.k1s.cpn.nppn.pragmatics.PragmaticsDescriptor was reassigned. Use a temporary variable instead. |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
EmptyIfStatement | 2 | 99 | [SRC]if(desc && desc.constraints instanceof List){ [MSG]The if statement is empty |
DuplicateStringLiteral | 2 | 112 | [SRC]println "not ok" [MSG]Duplicate String Literal: not ok |
DuplicateStringLiteral | 2 | 115 | [SRC]println "ok" [MSG]Duplicate String Literal: ok |
DeadCode | 2 | 151 | [SRC]break [MSG]This code cannot be reached |
DeadCode | 2 | 154 | [SRC]break [MSG]This code cannot be reached |
DeadCode | 2 | 159 | [SRC]break [MSG]This code cannot be reached |
ThrowException | 2 | 161 | [SRC]throw new Exception("unknown node type: $typeStr") [MSG]The type Exception should not be thrown |
ThrowException | 2 | 186 | [SRC]throw new Exception("unknown level name: ${levelName}") [MSG]The type Exception should not be thrown |
InvertedIfElse | 3 | 104 | [SRC]if(!PragmaticsChecker.checkConnectedType(desc.constraint..ypes, obj)){ [MSG]Testing the negative condition first can make an if statement confusing |
InvertedIfElse | 3 | 111 | [SRC]if(!PragmaticsChecker.checklevel(desc.constraints.levels, pageType)){ [MSG]Testing the negative condition first can make an if statement confusing |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
IfStatementBraces | 2 | 23 | [SRC]if(template instanceof Closure) return template.call() [MSG]The if statement lacks braces |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
IfStatementBraces | 2 | 27 | [SRC]if(template instanceof String) [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 30 | [SRC]if(template instanceof Closure) [MSG]The if statement lacks braces |
ThrowRuntimeException | 2 | 33 | [SRC]throw new RuntimeException("could not find specified tem...toString()) [MSG]The type RuntimeException should not be thrown |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
IfStatementBraces | 2 | 112 | [SRC]if(currExpr != null) parentExprs.push(currExpr) [MSG]The if statement lacks braces |
DuplicateStringLiteral | 2 | 125 | [SRC]}else if(it == ' '){ [MSG]Duplicate String Literal: |
IfStatementBraces | 2 | 129 | [SRC]if(currToken.trim().size() > 0) [MSG]The if statement lacks braces |
DuplicateStringLiteral | 2 | 153 | [SRC]if(it == '(' && currCond == null){ [MSG]Duplicate String Literal: ( |
DuplicateStringLiteral | 2 | 156 | [SRC]}else if(it == '(') { [MSG]Duplicate String Literal: ( |
DuplicateStringLiteral | 2 | 158 | [SRC]} else if(it == ')'){ [MSG]Duplicate String Literal: ) |
DuplicateStringLiteral | 2 | 171 | [SRC]}else if(it == ' ' && state == COND){ [MSG]Duplicate String Literal: |
IfStatementBraces | 2 | 172 | [SRC]if(currCond.e == null) currCond.e = currToken [MSG]The if statement lacks braces |
ElseBlockBraces | 2 | 172 | [SRC]if(currCond.e == null) currCond.e = currToken [MSG]The else block lacks braces |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
IfStatementBraces | 2 | 26 | [SRC]if(strategy == null) strategy = TemplateParameters.DEFAULT_STRATEGY [MSG]The if statement lacks braces |
ThrowException | 2 | 36 | [SRC]throw new Exception("Unimplemented parameter strategy: $strategy") [MSG]The type Exception should not be thrown |
DuplicateStringLiteral | 2 | 56 | [SRC]def pragParams = prag.arguments.split(",") [MSG]Duplicate String Literal: , |
DuplicateStringLiteral | 2 | 68 | [SRC]retval['condTrueExpr'] = pragParams[1].replaceAll("_",",").trim() [MSG]Duplicate String Literal: , |
DuplicateStringLiteral | 2 | 69 | [SRC]retval['condFalseExpr'] = pragParams[2].replaceAll("_",",").trim() [MSG]Duplicate String Literal: _ |
DuplicateStringLiteral | 2 | 69 | [SRC]retval['condFalseExpr'] = pragParams[2].replaceAll("_",",").trim() [MSG]Duplicate String Literal: , |
ParameterReassignment | 3 | 26 | [SRC]if(strategy == null) strategy = TemplateParameters.DEFAULT_STRATEGY [MSG]The method parameter [strategy] in class org.k1s.nppn.generation.TemplateParameters was reassigned. Use a temporary variable instead. |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
PropertyName | 2 | 36 | [SRC]static final String postfix = "\n)" [MSG]The property name postfix in class org.k1s.nppn.generation.BindingsDSL does not match the pattern [A-Z][A-Z0-9_]* |
DuplicateStringLiteral | 2 | 83 | [SRC]} else if(style == "BINDINGS"){ [MSG]Duplicate String Literal: BINDINGS |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
DuplicateStringLiteral | 2 | 69 | [SRC]text = text.replace("%%yield_declarations%%", node.decla..ls found*/") [MSG]Duplicate String Literal: %%yield_declarations%% |
IfStatementBraces | 2 | 76 | [SRC]if(str.indexOf("<") < 0) return str [MSG]The if statement lacks braces |
DuplicateStringLiteral | 2 | 78 | [SRC]return str.substring(0,str.indexOf("<")).trim() [MSG]Duplicate String Literal: < |
ParameterReassignment | 3 | 82 | [SRC]str = removePrags(str) [MSG]The method parameter [str] in class org.k1s.nppn.generation.CodeGenerator was reassigned. Use a temporary variable instead. |
ParameterReassignment | 3 | 83 | [SRC]str = str.replace(" ", "_") [MSG]The method parameter [str] in class org.k1s.nppn.generation.CodeGenerator was reassigned. Use a temporary variable instead. |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
CatchException | 2 | 40 | [SRC]} catch (Exception e) { [MSG]The type Exception should not be caught |
ThrowRuntimeException | 2 | 43 | [SRC]throw new RuntimeException(e); [MSG]The type RuntimeException should not be thrown |
IfStatementBraces | 2 | 89 | [SRC]if(elemName == null) return retval; [MSG]The if statement lacks braces |
DuplicateStringLiteral | 2 | 95 | [SRC]int pragStart = elemName.indexOf("<<", start) + 2; [MSG]Duplicate String Literal: << |
IfStatementBraces | 2 | 100 | [SRC]if(!pragDef.contains("(")) pragDef = pragDef + "()"; [MSG]The if statement lacks braces |
CatchException | 2 | 105 | [SRC]}catch(Exception ex){ [MSG]The type Exception should not be caught |
ThrowException | 2 | 106 | [SRC]throw new Exception("Unnable to parse $elemName",ex) [MSG]The type Exception should not be thrown |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
IfStatementBraces | 2 | 17 | [SRC]if(!cond) work() [MSG]The if statement lacks braces |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
TernaryCouldBeElvis | 3 | 36 | [SRC]text.append tm.runTemplate(binding.template,params ? params : [:]) [MSG](params) ? params : [:] in class org.k1s.nppn.blocks.Atomic can be simplified to params ?: [:] |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
IfStatementBraces | 2 | 45 | [SRC]if(type != null) [MSG]The if statement lacks braces |
EmptyIfStatement | 2 | 52 | [SRC]if(node instanceof Arc){ [MSG]The if statement is empty |
IfStatementBraces | 2 | 58 | [SRC]if(name != node.name.text) return false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 69 | [SRC]if(pragNode == null || pragNode.pragmatics == null || pr..return false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 75 | [SRC]if(!pragmatics.contains(pragName)) pragsOk = false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 77 | [SRC]if(!pragsOk) return false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 81 | [SRC]if(node instanceof Page) return false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 88 | [SRC]if(adjPattern.matchNode(adjArc.target)) hasMatchingAdj = true [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 91 | [SRC]if(!hasMatchingAdj) adjOk = false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 95 | [SRC]if(!adjOk) return false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 120 | [SRC]if(node.getTargetArc().size() < minInEdges) return false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 125 | [SRC]if(node.getSourceArc().size() < minOutEdges) return false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 129 | [SRC]if(node instanceof Page) return false [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 155 | [SRC]if(arc.target == to) retval = true [MSG]The if statement lacks braces |
IfStatementBraces | 2 | 170 | [SRC]if(linksTo.contains(it.target)) numLinks++ [MSG]The if statement lacks braces |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
PropertyName | 2 | 20 | [SRC]static CONTROL_FLOW_PRAGS = ["Id", "startLoop", "endLoop..h", "merge"] [MSG]The property name CONTROL_FLOW_PRAGS in class org.k1s.nppn.blocks.derived.PragmaticsDerivator does not match the pattern [a-z][a-zA-Z0-9]* |
IfStatementBraces | 2 | 74 | [SRC]if(serviceNode == null) throw new IllegalArgumentExcepti..no service") [MSG]The if statement lacks braces |
LineLength | 2 | 104 | [SRC]PNPattern pd = new GroovyShell(this.getClass().getClassL..ttern; $it") [MSG]The line exceeds 120 characters. The line is 130 characters. |
DuplicateStringLiteral | 2 | 134 | [SRC]def serviceNode = page.object.findAll{ it.pragmatics.nam.."service") } [MSG]Duplicate String Literal: service |
IfStatementBraces | 2 | 135 | [SRC]if(serviceNode.size() != 1) throw new Exception("Illegal..rviceNode}") [MSG]The if statement lacks braces |
ThrowException | 2 | 135 | [SRC]if(serviceNode.size() != 1) throw new Exception("Illegal..rviceNode}") [MSG]The type Exception should not be thrown |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
LineLength | 2 | 41 | [SRC]this.text = new TemplateManager().runTemplate(binding.te..).toString() [MSG]The line exceeds 120 characters. The line is 152 characters. |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
PropertyName | 2 | 15 | [SRC]def start_node [MSG]The property name start_node in class org.k1s.nppn.blocks.Service does not match the pattern [a-z][a-zA-Z0-9]* |
PropertyName | 2 | 16 | [SRC]def end_node [MSG]The property name end_node in class org.k1s.nppn.blocks.Service does not match the pattern [a-z][a-zA-Z0-9]* |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
AbstractClassWithoutAbstractMethod | 2 | 8 | [SRC]abstract class Block { [MSG]The abstract class org.k1s.nppn.blocks.Block contains no abstract methods |
PublicInstanceField | 2 | 9 | [SRC]public def start [MSG]Violation in class org.k1s.nppn.blocks.Block. Using public fields is considered bad design. Create property 'start' instead. |
PublicInstanceField | 2 | 10 | [SRC]public def end [MSG]Violation in class org.k1s.nppn.blocks.Block. Using public fields is considered bad design. Create property 'end' instead. |
PublicInstanceField | 2 | 12 | [SRC]public def text [MSG]Violation in class org.k1s.nppn.blocks.Block. Using public fields is considered bad design. Create property 'text' instead. |
PublicInstanceField | 2 | 13 | [SRC]public def pragmatics = [] [MSG]Violation in class org.k1s.nppn.blocks.Block. Using public fields is considered bad design. Create property 'pragmatics' instead. |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
ThrowException | 2 | 69 | [SRC]throw new Exception("nyi") [MSG]The type Exception should not be thrown |
DuplicateStringLiteral | 2 | 105 | [SRC]_(longOpt: 'no-derived', 'No derived pragmatics will be added') [MSG]Duplicate String Literal: no-derived |
DuplicateStringLiteral | 2 | 106 | [SRC]_(longOpt: 'output-annotated-net', 'write the annotated ..output dir') [MSG]Duplicate String Literal: output-annotated-net |
DuplicateStringLiteral | 2 | 107 | [SRC]_(longOpt: 'only-output-annotated-net','write the annota..r and exit') [MSG]Duplicate String Literal: only-output-annotated-net |
LineLength | 2 | 108 | [SRC]//p(longOpt: 'pragmatics-specification', args: Option.UN.. the model') [MSG]The line exceeds 120 characters. The line is 157 characters. |
DuplicateStringLiteral | 2 | 110 | [SRC]c(longOpt: 'no-core-pragmatics', 'disables the default c..roagmatics') [MSG]Duplicate String Literal: no-core-pragmatics |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
PackageName | 2 | [MSG]package=org.k1s.nppn.generationVisitors | |
PropertyName | 2 | 16 | [SRC]static final def visitorsPass1 = [new GenerationVisitor(), [MSG]The property name visitorsPass1 in class org.k1s.nppn.generationVisitors.ODGVisitor does not match the pattern [A-Z][A-Z0-9_]* |
PropertyName | 2 | 19 | [SRC]static final def visitorsPass2 = [new VarsTextVisitor()] [MSG]The property name visitorsPass2 in class org.k1s.nppn.generationVisitors.ODGVisitor does not match the pattern [A-Z][A-Z0-9_]* |
IfStatementBraces | 2 | 53 | [SRC]if(it != null) flattenAtt(it, list) [MSG]The if statement lacks braces |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
PackageName | 2 | [MSG]package=org.k1s.nppn.generationVisitors |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
PackageName | 2 | [MSG]package=org.k1s.nppn.generationVisitors |
Rule Name | Priority | Line # | Source Line / Message |
---|---|---|---|
PackageName | 2 | [MSG]package=org.k1s.nppn.generationVisitors | |
LineLength | 2 | 27 | [SRC]//println "element.metaClass.hasProperty(element, \"pare..uch field'}" [MSG]The line exceeds 120 characters. The line is 223 characters. |
IfStatementBraces | 2 | 39 | [SRC]if(vars > -1 ) vars = vars + 7 [MSG]The if statement lacks braces |
ElseBlockBraces | 2 | 39 | [SRC]if(vars > -1 ) vars = vars + 7 [MSG]The else block lacks braces |