workcraft/workcraft

View on GitHub
workcraft/SonPlugin/src/org/workcraft/plugins/son/algorithm/ErrorTracingAlg.java

Summary

Maintainability
D
3 days
Test Coverage

Avoid deeply nested control flow statements.
Open

                        for (Condition min : bsonAlg.getMinimalPhase(getActivatedPhases(phases.get(post)))) {
                            min.setErrors(min.getErrors() - ((Condition) post).getErrors());
                        }

    Avoid deeply nested control flow statements.
    Open

                            for (Node n: cycle) {
                                if (n instanceof TransitionNode) {
                                    eventCycle.add((TransitionNode) n);
                                    if (!getPreAsynEvents((TransitionNode) n).isEmpty()
                                            && hasCommonElements(fireList2, getPreAsynEvents((TransitionNode) n))) {

      Avoid deeply nested control flow statements.
      Open

                              if (!hasPreAsyn) {
                                  setSyncErrNum(eventCycle, phases, isLower);
                                  removeList.addAll(eventCycle);
                                  b = true;
                                  break;

        Avoid deeply nested control flow statements.
        Open

                                for (Condition min : bsonAlg.getMinimalPhase(getActivatedPhases(phases.get(post)))) {
                                    min.setErrors(min.getErrors() + ((Condition) post).getErrors());
                                }

          Avoid deeply nested control flow statements.
          Open

                                  if (!hasPostAsyn) {
                                      setRevSyncErrNum(eventCycle, phases, isLower);
                                      removeList.addAll(eventCycle);
                                      b = true;
                                      break;

            Avoid deeply nested control flow statements.
            Open

                                    for (Node n: cycle) {
                                        if (n instanceof TransitionNode) {
                                            eventCycle.add((TransitionNode) n);
                                            if (!getPostAsynEvents((TransitionNode) n).isEmpty()
                                                    && hasCommonElements(fireList2, getPostAsynEvents((TransitionNode) n))) {

              Avoid deeply nested control flow statements.
              Open

                                      if (!sync.contains(n)) {
                                          err += ((ChannelPlace) pre).getErrors();
                                      }

                Avoid deeply nested control flow statements.
                Open

                                        if (!sync.contains(n)) {
                                            err += ((ChannelPlace) pre).getErrors();
                                        }

                  Avoid deeply nested control flow statements.
                  Open

                                          if (!sync.contains(n)) {
                                              ((ChannelPlace) post).setErrors(err);
                                          }

                    Avoid deeply nested control flow statements.
                    Open

                                            if (!sync.contains(n)) {
                                                ((ChannelPlace) post).setErrors(((ChannelPlace) post).getErrors() - err);
                                            }

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

                          public void setErrNum(Collection<TransitionNode> fireList, Collection<Path> sync, Map<Condition, Collection<Phase>> phases, boolean isLower) {
                      
                              while (!fireList.isEmpty()) {
                                  Collection<TransitionNode> removeList = new ArrayList<>();
                      
                      
                      workcraft/SonPlugin/src/org/workcraft/plugins/son/algorithm/ErrorTracingAlg.java on lines 166..214

                      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 279.

                      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 2 locations. Consider refactoring.
                      Open

                          public void setRevErrNum(Collection<TransitionNode> fireList, Collection<Path> sync, Map<Condition, Collection<Phase>> phases, boolean isLower) {
                      
                              while (!fireList.isEmpty()) {
                                  Collection<TransitionNode> removeList = new ArrayList<>();
                      
                      
                      workcraft/SonPlugin/src/org/workcraft/plugins/son/algorithm/ErrorTracingAlg.java on lines 29..77

                      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 279.

                      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 (TransitionNode e : sync) {
                                  if (e.isFaulty()) {
                                      err++;
                                  }
                                  for (MathNode pre : net.getPreset((MathNode) e)) {
                      workcraft/SonPlugin/src/org/workcraft/plugins/son/algorithm/ErrorTracingAlg.java on lines 124..140

                      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 110.

                      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 (TransitionNode e : sync) {
                                  if (e.isFaulty()) {
                                      err++;
                                  }
                                  for (MathNode pre : net.getPreset((MathNode) e)) {
                      workcraft/SonPlugin/src/org/workcraft/plugins/son/algorithm/ErrorTracingAlg.java on lines 248..264

                      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 110.

                      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

                                  if (post instanceof Condition) {
                                      ((Condition) post).setErrors(err);
                                      //set err number for lower condition
                                      if (!isLower) {
                                          for (Condition min : bsonAlg.getMinimalPhase(getActivatedPhases(phases.get(post)))) {
                      workcraft/SonPlugin/src/org/workcraft/plugins/son/algorithm/ErrorTracingAlg.java on lines 268..277

                      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 90.

                      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

                                      if (post instanceof Condition) {
                                          ((Condition) post).setErrors(err);
                                          //set err number for upper conditions
                                          if (!isLower) {
                                              for (Condition min : bsonAlg.getMinimalPhase(getActivatedPhases(phases.get(post)))) {
                      workcraft/SonPlugin/src/org/workcraft/plugins/son/algorithm/ErrorTracingAlg.java on lines 229..238

                      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 90.

                      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

                                  if (post instanceof Condition) {
                                      ((Condition) post).setErrors(err);
                                      //set err number for lower condition
                                      if (!isLower) {
                                          for (Condition min : bsonAlg.getMinimalPhase(getActivatedPhases(phases.get(post)))) {
                      workcraft/SonPlugin/src/org/workcraft/plugins/son/algorithm/ErrorTracingAlg.java on lines 144..152

                      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 68.

                      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

                                      if (post instanceof Condition) {
                                          ((Condition) post).setErrors(err);
                                          //set err number for upper conditions
                                          if (!isLower) {
                                              for (Condition min : bsonAlg.getMinimalPhase(getActivatedPhases(phases.get(post)))) {
                      workcraft/SonPlugin/src/org/workcraft/plugins/son/algorithm/ErrorTracingAlg.java on lines 106..114

                      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 68.

                      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