workcraft/workcraft

View on GitHub
workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java

Summary

Maintainability
F
3 days
Test Coverage

Avoid deeply nested control flow statements.
Open

                        for (MathNode node : wtg.getPostset(entry)) {
                            if ((isFirstTransition(wtg, node)) && (isWaveformInChoice(wtg, waveform))) {
                                DialogUtils.showError("Signal '" + wtg.getName(entry.getSignal())
                                        + "' cannot be fired immediately after a choice, in waveform '"
                                        + wtg.getName(waveform) + "'.");

    Avoid deeply nested control flow statements.
    Open

                            if (node instanceof TransitionEvent) {
                                TransitionEvent dstTransition = (TransitionEvent) node;
                                if (dstTransition.getSignal().getType() == Signal.Type.INPUT) {
                                    String msg = "Internal signal '" + wtg.getName(transition.getSignal())
                                            + "' triggers input signal '"

      Avoid deeply nested control flow statements.
      Open

                              if (node instanceof TransitionEvent) {
                                  TransitionEvent dstTransition = (TransitionEvent) node;
                                  Signal signal = dstTransition.getSignal();
                                  if (signal.getType() != Signal.Type.INPUT) {
                                      String transitionName = wtg.getName(transition.getSignal()) + direction.getSymbol();

        Method processTransition has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private static void processTransition(Wtg wtg, TransitionEvent visitingTransition, Set<TransitionEvent> outputHasFired,
                                                  Set<String> firedBeforeOut, Integer index,
                                                  Map<TransitionEvent, Map<Signal, Pair<Boolean, Integer>>> inputsFiredAfterOutput) {

          Avoid deeply nested control flow statements.
          Open

                                  if (previousState != Signal.State.STABLE) {
                                      DialogUtils.showError("Signal '" + signalGuarded
                                              + "' should be stable before reaching the state '"
                                              + wtg.getName(precedingState) + "'.");
                                      return false;

            Avoid deeply nested control flow statements.
            Open

                                            if ((finalWaveformSignalState.containsKey(signal.getKey())) &&
                                                    (!finalWaveformSignalState.get(signal.getKey()).equals(signal.getValue()))) {
                                                msg += ' ' + signal.getKey();
                                            }

              Avoid deeply nested control flow statements.
              Open

                                      for (Signal signal : guardedSignals)  {
                                          inputsFiredAfterOutput.get(transition).put(signal, new Pair<>(true, 0));
                                      }

                Method checkTransitionConnections has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    private static boolean checkTransitionConnections(Wtg wtg, Waveform waveform, Set<? extends MathNode> connections,
                            Signal signal, String connectionType) {

                  Method signalFollowsSynthesisGuidelines has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private static boolean signalFollowsSynthesisGuidelines(Wtg wtg, String signal, Map<Waveform, Set<String>> firedBeforeOut,
                                                                              Map<Waveform, Set<String>> firedAfterOut, Map<Waveform, Boolean> hasOutput) {

                    Avoid too many return statements within this method.
                    Open

                                return false;

                      Avoid too many return statements within this method.
                      Open

                                  return false;

                        Avoid too many return statements within this method.
                        Open

                                    return false;

                          Avoid too many return statements within this method.
                          Open

                                      return false;

                            Avoid too many return statements within this method.
                            Open

                                        return false;

                              Avoid too many return statements within this method.
                              Open

                                          return false;

                                Avoid too many return statements within this method.
                                Open

                                            return false;

                                  Avoid too many return statements within this method.
                                  Open

                                              return false;

                                    Avoid too many return statements within this method.
                                    Open

                                                    return false;

                                      Avoid too many return statements within this method.
                                      Open

                                                  return false;

                                        Avoid too many return statements within this method.
                                        Open

                                                return true;

                                          Avoid too many return statements within this method.
                                          Open

                                                      return false;

                                            Avoid too many return statements within this method.
                                            Open

                                                    return true;

                                              Avoid too many return statements within this method.
                                              Open

                                                      return true;

                                                Avoid too many return statements within this method.
                                                Open

                                                            return false;

                                                  Avoid too many return statements within this method.
                                                  Open

                                                          return true;

                                                    Avoid too many return statements within this method.
                                                    Open

                                                            return true;

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                  return false;

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                    return false;

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                      return false;

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

                                                                public static boolean checkExitEventPresetPostset(Wtg wtg) {
                                                                    for (Waveform waveform : wtg.getWaveforms()) {
                                                                        for (ExitEvent exit : wtg.getExits(waveform)) {
                                                                            String msg = "Waveform '" + wtg.getName(waveform) + "' has an exit event ";
                                                                            if (!wtg.getPostset(exit).isEmpty()) {
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 260..288

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

                                                            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 static boolean checkEntryEventPresetPostset(Wtg wtg) {
                                                                    for (Waveform waveform : wtg.getWaveforms()) {
                                                                        for (EntryEvent entry : wtg.getEntries(waveform)) {
                                                                            String msg = "Waveform '" + wtg.getName(waveform) + "' has an entry event ";
                                                                            if (!wtg.getPreset(entry).isEmpty()) {
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 230..258

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

                                                            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 static boolean checkWaveformsHaveEntryState(Wtg wtg) {
                                                                    for (Waveform waveform : wtg.getWaveforms()) {
                                                                        Set<MathNode> preset = wtg.getPreset(waveform);
                                                                        String name = wtg.getName(waveform);
                                                                        if (preset.isEmpty()) {
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 615..629

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

                                                            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 static boolean checkWaveformsHaveExitState(Wtg wtg) {
                                                                    for (Waveform waveform : wtg.getWaveforms()) {
                                                                        Set<MathNode> postset = wtg.getPostset(waveform);
                                                                        String name = wtg.getName(waveform);
                                                                        if (postset.isEmpty()) {
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 599..613

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

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

                                                                        for (MathNode n : wtg.getPostset(node)) {
                                                                            if (!reachableNodes.contains(n)) {
                                                                                reachableNodes.add(n);
                                                                                nodesToVisit.add(n);
                                                                            }
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/WtgPropertyHelper.java on lines 196..201
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/WtgUtils.java on lines 105..110
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/WtgUtils.java on lines 133..138

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

                                                            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

                                                                    for (String signalName : getUnstableSignalNames(wtg)) {
                                                                        unstableSignalPlaces.add(getLowStateName(signalName));
                                                                        unstableSignalPlaces.add(getHighStateName(signalName));
                                                                        unstableSignalPlaces.add(getStableStateName(signalName));
                                                                        unstableSignalPlaces.add(getUnstableStateName(signalName));
                                                            workcraft/SonPlugin/src/org/workcraft/plugins/son/tasks/BSONStructureTask.java on lines 212..218

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

                                                            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

                                                                        if (wtg.getExits(waveform).size() > exitEventSignals.size()) {
                                                                            DialogUtils.showError("Waveform '" + wtg.getName(waveform) + "' has repeated exit events.");
                                                                            return false;
                                                                        }
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 294..297

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

                                                            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

                                                                        if (wtg.getEntries(waveform).size() > entryEventSignals.size()) {
                                                                            DialogUtils.showError("Waveform '" + wtg.getName(waveform) + "' has repeated entry events.");
                                                                            return false;
                                                                        }
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 304..307

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

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

                                                                        } else if (direction == TransitionEvent.Direction.FALL) {
                                                                            if ((previousState != Signal.State.HIGH) && (previousState != Signal.State.UNSTABLE)) {
                                                                                consistent = false;
                                                                            }
                                                                        }  else if (direction == TransitionEvent.Direction.STABILISE) {
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 794..798
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 782..786

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

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

                                                                        } else if (direction == TransitionEvent.Direction.DESTABILISE) {
                                                                            if ((previousState != Signal.State.HIGH) && (previousState != Signal.State.LOW)) {
                                                                                consistent = false;
                                                                            }
                                                                        }
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 786..790
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 782..786

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

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

                                                                        if (direction == TransitionEvent.Direction.RISE) {
                                                                            if ((previousState != Signal.State.LOW) && (previousState != Signal.State.UNSTABLE)) {
                                                                                consistent = false;
                                                                            }
                                                                        } else if (direction == TransitionEvent.Direction.FALL) {
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 794..798
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 786..790

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

                                                            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

                                                                                        if ((isFirstTransition(wtg, node)) && (isWaveformInChoice(wtg, waveform))) {
                                                                                            DialogUtils.showError("Signal '" + wtg.getName(entry.getSignal())
                                                                                                    + "' cannot be fired immediately after a choice, in waveform '"
                                                                                                    + wtg.getName(waveform) + "'.");
                                                                                            return false;
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 824..829

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

                                                            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

                                                                                                    isFirstTransitionInputInSuccessorWaveforms(wtg, waveform)) {
                                                                                                DialogUtils.showError("Internal signal '" + wtg.getName(transition.getSignal())
                                                                                                        + "' triggers an input signal with its transition at the end of waveform '"
                                                                                                        + wtg.getName(waveform) + "'.");
                                                                                                return false;
                                                            workcraft/WtgPlugin/src/org/workcraft/plugins/wtg/utils/VerificationUtils.java on lines 340..345

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

                                                            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