LearnPAd/learnpad

View on GitHub
lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingANDGateways.java

Summary

Maintainability
F
4 days
Test Coverage

Method findGL has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    protected void findGL(Definitions diagram) {
        StringBuilder temp = new StringBuilder();

        int num = 0;

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method searchSubProcess has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

    protected void searchSubProcess(SubProcess sub){
        StringBuilder temp = new StringBuilder();

        int num = 0;
        for ( FlowElement fe : sub.getFlowElements()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method findGL has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    protected void findGL(Definitions diagram) {
        StringBuilder temp = new StringBuilder();

        int num = 0;

    Method searchSubProcess has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected void searchSubProcess(SubProcess sub){
            StringBuilder temp = new StringBuilder();
    
            int num = 0;
            for ( FlowElement fe : sub.getFlowElements()) {

      Avoid deeply nested control flow statements.
      Open

                                              if(descrpt.equals("without name")){
                                                  flag=true;
                                              }

        Avoid deeply nested control flow statements.
        Open

                                                        if(descrpt.equals("without name")){
                                                            flag=true;
                                                        }

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                          for (FlowElement fe : process.getFlowElements()) {
                              if(fe instanceof SubProcess){
                                  SubProcess sub = (SubProcess) fe;
                                  //System.out.format("Found a SubProcess: %s\n", sub.getName());
                                  this.searchSubProcess(sub);
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingANDGateways.java on lines 117..170

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 392.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  for ( FlowElement fe : sub.getFlowElements()) {
                      if(fe instanceof SubProcess){
                          SubProcess ssub = (SubProcess) fe;
                          //System.out.format("Found a SubProcess: %s\n", ssub.getName());
                          this.searchSubProcess(ssub);
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingANDGateways.java on lines 48..100

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 392.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 32 locations. Consider refactoring.
          Open

              public LabelingANDGateways(Definitions diagram, Locale l){
                  super(diagram,l);
                  this.l=l;
                  this.id = "35"; //$NON-NLS-1$
                  this.Description = Messages.getString("LabelingANDGateways.Description",l); //$NON-NLS-1$
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/ActivityDescription.java on lines 25..33
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/ApplyHierarchicalStructure.java on lines 21..29
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/MinimizeGatewayHeterogeneity.java on lines 23..31
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/MinimizeModelSize.java on lines 24..32
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/ModelLoops.java on lines 23..31
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/appearence/LinearMessageFlows.java on lines 24..32
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/appearence/LinearSequenceFlows.java on lines 25..33
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/appearence/ProcessOrientation.java on lines 20..28
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingActivities.java on lines 19..27
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingConvergingGateways.java on lines 25..33
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingDataObject.java on lines 20..28
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingEvents.java on lines 21..29
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingLanes.java on lines 23..31
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingMessageEvent.java on lines 24..32
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingPools.java on lines 22..30
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingStartandEndEvents.java on lines 23..31
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingXORGateway.java on lines 20..28
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LoopMarkerAnnotation.java on lines 23..31
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/BalanceGateways.java on lines 23..30
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/ConsistentUsageEndEvents.java on lines 27..35
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/ConsistentUsageLanes.java on lines 24..32
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/ConsistentUsagePools.java on lines 24..32
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/ConsistentUsageStartEvents.java on lines 22..30
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/ExclusiveGatewayMarking.java on lines 20..28
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/ExplicitStartEndEvents.java on lines 21..29
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/RestrictUsageTerminateEndEvent.java on lines 24..32
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/SplitAndJoinFlows.java on lines 20..28
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/UsageDefaultFlows.java on lines 20..26
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/UsageInclusiveORGateways.java on lines 18..26
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/UsageMeaningfulGateways.java on lines 20..28
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/explicitGateways.java on lines 26..34

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 65.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 11 locations. Consider refactoring.
          Open

                  if ( num>0) {
                      this.Suggestion += Messages.getString("LabelingANDGateways.SuggestionSubprocessKO",l)+sub.getName()+" "; //$NON-NLS-1$ //$NON-NLS-2$
                      this.status = false;
                  }
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingConvergingGateways.java on lines 170..173
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingDataObject.java on lines 99..102
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingEvents.java on lines 131..134
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingMessageEvent.java on lines 155..158
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingStartandEndEvents.java on lines 139..142
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LabelingXORGateway.java on lines 105..108
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/labeling/LoopMarkerAnnotation.java on lines 133..136
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/RestrictUsageTerminateEndEvent.java on lines 116..121
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/UsageDefaultFlows.java on lines 108..113
          lp-model-verification/verification-component-understandability-plugin/src/main/java/eu/learnpad/verification/plugin/bpmn/guideline/impl/notationusage/UsageInclusiveORGateways.java on lines 106..111

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status