java/src/jmri/implementation/DefaultSection.java

Summary

Maintainability
F
2 mos
Test Coverage

Method placeDirectionSensors has a Cognitive Complexity of 1045 (exceeds 20 allowed). Consider refactoring.
Open

    @Override
    public int placeDirectionSensors() {
        int missingSignalsBB = 0;
        int missingSignalsTurnouts = 0;
        int missingSignalsLevelXings = 0;
Severity: Minor
Found in java/src/jmri/implementation/DefaultSection.java - About 3 wks to fix

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

File DefaultSection.java has 2318 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.implementation;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.beans.*;
Severity: Major
Found in java/src/jmri/implementation/DefaultSection.java - About 6 days to fix

    Method placeDirectionSensors has 648 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public int placeDirectionSensors() {
            int missingSignalsBB = 0;
            int missingSignalsTurnouts = 0;
            int missingSignalsLevelXings = 0;
    Severity: Major
    Found in java/src/jmri/implementation/DefaultSection.java - About 3 days to fix

      Method getDirectionXoverTurnout has a Cognitive Complexity of 166 (exceeds 20 allowed). Consider refactoring.
      Open

          private int getDirectionXoverTurnout(LayoutTurnout t, ConnectivityUtil cUtil) {
              LayoutBlock aBlock = ((TrackSegment) t.getConnectA()).getLayoutBlock();
              LayoutBlock bBlock = ((TrackSegment) t.getConnectB()).getLayoutBlock();
              LayoutBlock cBlock = ((TrackSegment) t.getConnectC()).getLayoutBlock();
              LayoutBlock dBlock = ((TrackSegment) t.getConnectD()).getLayoutBlock();
      Severity: Minor
      Found in java/src/jmri/implementation/DefaultSection.java - About 3 days to fix

      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 getDirectionSlip has a Cognitive Complexity of 161 (exceeds 20 allowed). Consider refactoring.
      Open

          private int getDirectionSlip(LayoutTurnout t, ConnectivityUtil cUtil) {
              LayoutBlock aBlock = ((TrackSegment) t.getConnectA()).getLayoutBlock();
              LayoutBlock bBlock = ((TrackSegment) t.getConnectB()).getLayoutBlock();
              LayoutBlock cBlock = ((TrackSegment) t.getConnectC()).getLayoutBlock();
              LayoutBlock dBlock = ((TrackSegment) t.getConnectD()).getLayoutBlock();
      Severity: Minor
      Found in java/src/jmri/implementation/DefaultSection.java - About 2 days to fix

      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

      DefaultSection has 79 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class DefaultSection extends AbstractNamedBean implements Section {
      
          private static final NamedBean.DisplayOptions USERSYS = NamedBean.DisplayOptions.USERNAME_SYSTEMNAME;
      
          public DefaultSection(String systemName, String userName) {
      Severity: Major
      Found in java/src/jmri/implementation/DefaultSection.java - About 1 day to fix

        Method getDirectionStandardTurnout has a Cognitive Complexity of 88 (exceeds 20 allowed). Consider refactoring.
        Open

            private int getDirectionStandardTurnout(LayoutTurnout t, ConnectivityUtil cUtil) {
                LayoutBlock aBlock = ((TrackSegment) t.getConnectA()).getLayoutBlock();
                LayoutBlock bBlock = ((TrackSegment) t.getConnectB()).getLayoutBlock();
                LayoutBlock cBlock = ((TrackSegment) t.getConnectC()).getLayoutBlock();
                if ((aBlock == null) || (bBlock == null) || (cBlock == null)) {
        Severity: Minor
        Found in java/src/jmri/implementation/DefaultSection.java - About 1 day to fix

        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 getDirectionSlip has 183 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private int getDirectionSlip(LayoutTurnout t, ConnectivityUtil cUtil) {
                LayoutBlock aBlock = ((TrackSegment) t.getConnectA()).getLayoutBlock();
                LayoutBlock bBlock = ((TrackSegment) t.getConnectB()).getLayoutBlock();
                LayoutBlock cBlock = ((TrackSegment) t.getConnectC()).getLayoutBlock();
                LayoutBlock dBlock = ((TrackSegment) t.getConnectD()).getLayoutBlock();
        Severity: Major
        Found in java/src/jmri/implementation/DefaultSection.java - About 7 hrs to fix

          Method getDirectionXoverTurnout has 179 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private int getDirectionXoverTurnout(LayoutTurnout t, ConnectivityUtil cUtil) {
                  LayoutBlock aBlock = ((TrackSegment) t.getConnectA()).getLayoutBlock();
                  LayoutBlock bBlock = ((TrackSegment) t.getConnectB()).getLayoutBlock();
                  LayoutBlock cBlock = ((TrackSegment) t.getConnectC()).getLayoutBlock();
                  LayoutBlock dBlock = ((TrackSegment) t.getConnectD()).getLayoutBlock();
          Severity: Major
          Found in java/src/jmri/implementation/DefaultSection.java - About 7 hrs to fix

            Method validate has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring.
            Open

                @Override
                public String validate() {
                    if (initializationNeeded) {
                        initializeBlocks();
                    }
            Severity: Minor
            Found in java/src/jmri/implementation/DefaultSection.java - About 6 hrs to fix

            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 setDirectionSensorByConnectivity has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
            Open

                private boolean setDirectionSensorByConnectivity(TrackNode tNode, TrackNode altNode, SignalHead sh,
                        Block cBlock, ConnectivityUtil cUtil) {
                    boolean successful = false;
                    TrackNode tn = tNode;
                    if ((tn != null) && (sh != null)) {
            Severity: Minor
            Found in java/src/jmri/implementation/DefaultSection.java - About 5 hrs to fix

            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 getDirectionStandardTurnout has 121 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private int getDirectionStandardTurnout(LayoutTurnout t, ConnectivityUtil cUtil) {
                    LayoutBlock aBlock = ((TrackSegment) t.getConnectA()).getLayoutBlock();
                    LayoutBlock bBlock = ((TrackSegment) t.getConnectB()).getLayoutBlock();
                    LayoutBlock cBlock = ((TrackSegment) t.getConnectC()).getLayoutBlock();
                    if ((aBlock == null) || (bBlock == null) || (cBlock == null)) {
            Severity: Major
            Found in java/src/jmri/implementation/DefaultSection.java - About 4 hrs to fix

              Method validate has 100 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Override
                  public String validate() {
                      if (initializationNeeded) {
                          initializeBlocks();
                      }
              Severity: Major
              Found in java/src/jmri/implementation/DefaultSection.java - About 4 hrs to fix

                Method setAlternateColorFromActiveBlock has a Cognitive Complexity of 39 (exceeds 20 allowed). Consider refactoring.
                Open

                    @Override
                    public void setAlternateColorFromActiveBlock(boolean set) {
                        LayoutBlockManager lbm = InstanceManager.getDefault(LayoutBlockManager.class);
                        boolean beenSet = false;
                        if (!set || getState() == FREE || getState() == UNKNOWN) {
                Severity: Minor
                Found in java/src/jmri/implementation/DefaultSection.java - About 3 hrs to fix

                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 setState has a Cognitive Complexity of 39 (exceeds 20 allowed). Consider refactoring.
                Open

                    @Override
                    public void setState(int state) {
                        if ((state == Section.FREE) || (state == Section.FORWARD) || (state == Section.REVERSE)) {
                            int old = mState;
                            mState = state;
                Severity: Minor
                Found in java/src/jmri/implementation/DefaultSection.java - About 3 hrs to fix

                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 setDirectionSensorByConnectivity has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private boolean setDirectionSensorByConnectivity(TrackNode tNode, TrackNode altNode, SignalHead sh,
                            Block cBlock, ConnectivityUtil cUtil) {
                        boolean successful = false;
                        TrackNode tn = tNode;
                        if ((tn != null) && (sh != null)) {
                Severity: Minor
                Found in java/src/jmri/implementation/DefaultSection.java - About 1 hr to fix

                  Method setState has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Override
                      public void setState(int state) {
                          if ((state == Section.FREE) || (state == Section.FORWARD) || (state == Section.REVERSE)) {
                              int old = mState;
                              mState = state;
                  Severity: Minor
                  Found in java/src/jmri/implementation/DefaultSection.java - About 1 hr to fix

                    Method setAlternateColorFromActiveBlock has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @Override
                        public void setAlternateColorFromActiveBlock(boolean set) {
                            LayoutBlockManager lbm = InstanceManager.getDefault(LayoutBlockManager.class);
                            boolean beenSet = false;
                            if (!set || getState() == FREE || getState() == UNKNOWN) {
                    Severity: Minor
                    Found in java/src/jmri/implementation/DefaultSection.java - About 1 hr to fix

                      Method placeSensorInCrossover has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private boolean placeSensorInCrossover(String b1Name, String b2Name, String c1Name, String c2Name,
                                  int direction, ConnectivityUtil cUtil) {
                              SignalHead b1Head = InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(b1Name);
                              SignalHead b2Head = null;
                              SignalHead c1Head = null;
                      Severity: Minor
                      Found in java/src/jmri/implementation/DefaultSection.java - About 1 hr to fix

                        Method vetoableChange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @Override
                            public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException {
                                if ("CanDelete".equals(evt.getPropertyName())) { // NOI18N
                                    NamedBean nb = (NamedBean) evt.getOldValue();
                                    if (nb instanceof Sensor) {
                        Severity: Minor
                        Found in java/src/jmri/implementation/DefaultSection.java - About 1 hr to fix

                          Method addBlock has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @Override
                              public boolean addBlock(Block b) {
                                  // validate that this entry is unique, if not first.
                                  if (mBlockEntries.isEmpty()) {
                                      mFirstBlock = b;
                          Severity: Minor
                          Found in java/src/jmri/implementation/DefaultSection.java - About 1 hr to fix

                            Method placeSensorInCrossover has 6 arguments (exceeds 5 allowed). Consider refactoring.
                            Open

                                private boolean placeSensorInCrossover(String b1Name, String b2Name, String c1Name, String c2Name,
                                        int direction, ConnectivityUtil cUtil) {
                            Severity: Minor
                            Found in java/src/jmri/implementation/DefaultSection.java - About 35 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                  return dir;
                              Severity: Major
                              Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return dir;
                                Severity: Major
                                Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return EntryPoint.UNKNOWN;
                                  Severity: Major
                                  Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                        return dir;
                                    Severity: Major
                                    Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                          return s;
                                      Severity: Major
                                      Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                return "";
                                        Severity: Major
                                        Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                              return dir;
                                          Severity: Major
                                          Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                            return dir;
                                            Severity: Major
                                            Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                                  return EntryPoint.FORWARD;
                                              Severity: Major
                                              Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                    return EntryPoint.REVERSE;
                                                Severity: Major
                                                Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                      return EntryPoint.REVERSE;
                                                  Severity: Major
                                                  Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                        return dir;
                                                    Severity: Major
                                                    Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                      return dir;
                                                      Severity: Major
                                                      Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                        return dir;
                                                        Severity: Major
                                                        Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                  return EntryPoint.UNKNOWN;
                                                          Severity: Major
                                                          Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                                return dir;
                                                            Severity: Major
                                                            Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                                  return EntryPoint.FORWARD;
                                                              Severity: Major
                                                              Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                                    return dir;
                                                                Severity: Major
                                                                Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                                      return dir;
                                                                  Severity: Major
                                                                  Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                        return dir;
                                                                    Severity: Major
                                                                    Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                      return dir;
                                                                      Severity: Major
                                                                      Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                            return s;
                                                                        Severity: Major
                                                                        Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                      return EntryPoint.UNKNOWN;
                                                                          Severity: Major
                                                                          Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                            return dir;
                                                                            Severity: Major
                                                                            Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                              return dir;
                                                                              Severity: Major
                                                                              Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                                    return dir;
                                                                                Severity: Major
                                                                                Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                                  return dir;
                                                                                  Severity: Major
                                                                                  Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                        return dir;
                                                                                    Severity: Major
                                                                                    Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                                          return dir;
                                                                                      Severity: Major
                                                                                      Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                            return dir;
                                                                                        Severity: Major
                                                                                        Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                  return EntryPoint.UNKNOWN;
                                                                                          Severity: Major
                                                                                          Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                                return s;
                                                                                            Severity: Major
                                                                                            Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                                  return dir;
                                                                                              Severity: Major
                                                                                              Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

                                                                                                                return dir;
                                                                                                Severity: Major
                                                                                                Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                                  Avoid too many return statements within this method.
                                                                                                  Open

                                                                                                                  return dir;
                                                                                                  Severity: Major
                                                                                                  Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                                    Avoid too many return statements within this method.
                                                                                                    Open

                                                                                                                        return s;
                                                                                                    Severity: Major
                                                                                                    Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                                      Avoid too many return statements within this method.
                                                                                                      Open

                                                                                                                          return dir;
                                                                                                      Severity: Major
                                                                                                      Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                                        Avoid too many return statements within this method.
                                                                                                        Open

                                                                                                                        return dir;
                                                                                                        Severity: Major
                                                                                                        Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                                          Avoid too many return statements within this method.
                                                                                                          Open

                                                                                                                              return s;
                                                                                                          Severity: Major
                                                                                                          Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                                            Avoid too many return statements within this method.
                                                                                                            Open

                                                                                                                                return s;
                                                                                                            Severity: Major
                                                                                                            Found in java/src/jmri/implementation/DefaultSection.java - About 30 mins to fix

                                                                                                              Method setNameFromActiveBlock has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                                                                                                              Open

                                                                                                                  @Override
                                                                                                                  public void setNameFromActiveBlock(Object value) {
                                                                                                                      boolean beenSet = false;
                                                                                                                      if (value == null || getState() == FREE || getState() == UNKNOWN) {
                                                                                                                          setNameInBlocks(value);
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java - About 25 mins to fix

                                                                                                              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

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

                                                                                                                      if ((containsBlock(aBlock.getBlock())) || (containsBlock(bBlock.getBlock()))) {
                                                                                                                          LayoutBlock exBlock = null;
                                                                                                                          if (aBlock == bBlock) {
                                                                                                                              if ((t.getTurnoutType() == LayoutTurnout.TurnoutType.DOUBLE_XOVER) && (cBlock == dBlock)) {
                                                                                                                                  exBlock = cBlock;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 day to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1225..1306

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

                                                                                                              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 ((containsBlock(dBlock.getBlock())) || (containsBlock(cBlock.getBlock()))) {
                                                                                                                          LayoutBlock exBlock = null;
                                                                                                                          if (dBlock == cBlock) {
                                                                                                                              if ((t.getTurnoutType() == LayoutTurnout.TurnoutType.DOUBLE_XOVER) && (bBlock == aBlock)) {
                                                                                                                                  exBlock = aBlock;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 day to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1143..1224

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

                                                                                                              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 (mReverseEntryPoints.size() > 0) {
                                                                                                                          for (int i = 0; i < mReverseEntryPoints.size(); i++) {
                                                                                                                              EntryPoint ep = mReverseEntryPoints.get(i);
                                                                                                                              if (!containsBlock(ep.getBlock())) {
                                                                                                                                  String s = "Entry Point Block, " + ep.getBlock().getDisplayName(USERSYS)
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 4 hrs to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2496..2522

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

                                                                                                              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 (mForwardEntryPoints.size() > 0) {
                                                                                                                          for (int i = 0; i < mForwardEntryPoints.size(); i++) {
                                                                                                                              EntryPoint ep = mForwardEntryPoints.get(i);
                                                                                                                              if (!containsBlock(ep.getBlock())) {
                                                                                                                                  String s = "Entry Point Block, " + ep.getBlock().getDisplayName(USERSYS)
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 4 hrs to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2523..2549

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

                                                                                                              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 ((!x.getSignalBName().isEmpty()) || (!x.getSignalDName().isEmpty())) {
                                                                                                                                      // have a signaled BD level crossing internal to this block
                                                                                                                                      if (!x.getSignalBName().isEmpty()) {
                                                                                                                                          // there is a signal at B in the level crossing
                                                                                                                                          TrackNode tn = new TrackNode(x, HitPointType.LEVEL_XING_B,
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 3 hrs to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1781..1807

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

                                                                                                              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 (!x.getSignalAName().isEmpty() || (!x.getSignalCName().isEmpty())) {
                                                                                                                                      // have a signaled AC level crossing internal to this block
                                                                                                                                      if (!x.getSignalAName().isEmpty()) {
                                                                                                                                          // there is a signal at A in the level crossing
                                                                                                                                          TrackNode tn = new TrackNode(x, HitPointType.LEVEL_XING_A,
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 3 hrs to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1839..1865

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

                                                                                                              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

                                                                                                                              } else if (blBlock == lBlock) {
                                                                                                                                  // have a level crossing with BD spanning a block boundary, with B in this Block
                                                                                                                                  int direction = getDirectionForBlocks(blBlock, dlBlock);
                                                                                                                                  if (direction != EntryPoint.UNKNOWN) {
                                                                                                                                      if (!x.getSignalDName().isEmpty()) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 3 hrs to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1808..1836

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

                                                                                                              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

                                                                                                                              } else if (alBlock == lBlock) {
                                                                                                                                  // have a level crossing with AC spanning a block boundary, with A in this Block
                                                                                                                                  int direction = getDirectionForBlocks(alBlock, clBlock);
                                                                                                                                  if (direction != EntryPoint.UNKNOWN) {
                                                                                                                                      if (!x.getSignalCName().isEmpty()) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 3 hrs to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1866..1894

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

                                                                                                              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

                                                                                                                                                          && (((TrackSegment) t.getConnectB()).getLayoutBlock().getBlock() == cBlock))) {
                                                                                                                                                      // diverging track segment is in this block
                                                                                                                                                      if (b2Head != null) {
                                                                                                                                                          if (!checkDirectionSensor(b2Head, direction,
                                                                                                                                                                  ConnectivityUtil.OVERALL, cUtil)) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2075..2099

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

                                                                                                              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

                                                                                                                                                          && (((TrackSegment) t.getConnectC()).getLayoutBlock().getBlock() == cBlock))) {
                                                                                                                                                      // continuing track segment is in this block
                                                                                                                                                      if (b2Head != null) {
                                                                                                                                                          if (!checkDirectionSensor(b1Head, direction,
                                                                                                                                                                  ConnectivityUtil.OVERALL, cUtil)) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2102..2126

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

                                                                                                              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

                                                                                                                                          if (((TrackSegment) t.getConnectD()).getLayoutBlock().getBlock() == cBlock) {
                                                                                                                                              if ((t.getTurnoutType() == LayoutTurnout.TurnoutType.DOUBLE_XOVER)
                                                                                                                                                      || (t.getTurnoutType() == LayoutTurnout.TurnoutType.LH_XOVER)) {
                                                                                                                                                  if (!placeSensorInCrossover(t.getSignalC1Name(), t.getSignalC2Name(),
                                                                                                                                                          t.getSignalB1Name(), t.getSignalB2Name(), altDirection, cUtil)) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2266..2279
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2280..2293
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2294..2307

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

                                                                                                              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

                                                                                                                                          if (((TrackSegment) t.getConnectA()).getLayoutBlock().getBlock() == cBlock) {
                                                                                                                                              if ((t.getTurnoutType() == LayoutTurnout.TurnoutType.DOUBLE_XOVER)
                                                                                                                                                      || (t.getTurnoutType() == LayoutTurnout.TurnoutType.RH_XOVER)) {
                                                                                                                                                  if (!placeSensorInCrossover(t.getSignalB1Name(), t.getSignalB2Name(),
                                                                                                                                                          t.getSignalC1Name(), t.getSignalC2Name(), altDirection, cUtil)) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2280..2293
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2294..2307
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2308..2321

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

                                                                                                              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

                                                                                                                                          if (((TrackSegment) t.getConnectB()).getLayoutBlock().getBlock() == cBlock) {
                                                                                                                                              if ((t.getTurnoutType() == LayoutTurnout.TurnoutType.DOUBLE_XOVER)
                                                                                                                                                      || (t.getTurnoutType() == LayoutTurnout.TurnoutType.LH_XOVER)) {
                                                                                                                                                  if (!placeSensorInCrossover(t.getSignalA1Name(), t.getSignalA2Name(),
                                                                                                                                                          t.getSignalD1Name(), t.getSignalD2Name(), direction, cUtil)) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2266..2279
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2294..2307
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2308..2321

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

                                                                                                              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

                                                                                                                                          if (((TrackSegment) t.getConnectC()).getLayoutBlock().getBlock() == cBlock) {
                                                                                                                                              if ((t.getTurnoutType() == LayoutTurnout.TurnoutType.DOUBLE_XOVER)
                                                                                                                                                      || (t.getTurnoutType() == LayoutTurnout.TurnoutType.RH_XOVER)) {
                                                                                                                                                  if (!placeSensorInCrossover(t.getSignalD1Name(), t.getSignalD2Name(),
                                                                                                                                                          t.getSignalA1Name(), t.getSignalA2Name(), direction, cUtil)) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2266..2279
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2280..2293
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2308..2321

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

                                                                                                              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 (t.getTurnoutType() == LayoutSlip.TurnoutType.SINGLE_SLIP) {
                                                                                                                                              if (!checkDirectionSensor(InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(t.getSignalC1Name()), direction, ConnectivityUtil.OVERALL, cUtil)) {
                                                                                                                                                  errorCount++;
                                                                                                                                              }
                                                                                                                                          } else {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2338..2349

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

                                                                                                              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 (t.getTurnoutType() == LayoutSlip.TurnoutType.SINGLE_SLIP) {
                                                                                                                                              if (!checkDirectionSensor(InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(t.getSignalB1Name()), altDirection, ConnectivityUtil.OVERALL, cUtil)) {
                                                                                                                                                  errorCount++;
                                                                                                                                              }
                                                                                                                                          } else {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2350..2361

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

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

                                                                                                                  @Override
                                                                                                                  @CheckForNull
                                                                                                                  public Sensor setReverseStoppingSensorName(String reverseSensor) {
                                                                                                                      if ((reverseSensor == null) || (reverseSensor.length() <= 0)) {
                                                                                                                          mReverseStoppingNamedSensor = null;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 297..315
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 396..414

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

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

                                                                                                                  @Override
                                                                                                                  public Sensor setForwardStoppingSensorName(String forwardSensor) {
                                                                                                                      if ((forwardSensor == null) || (forwardSensor.length() <= 0)) {
                                                                                                                          mForwardStoppingNamedSensor = null;
                                                                                                                          mForwardStoppingSensorName = "";
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 297..315
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 429..448

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

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

                                                                                                                  @Override
                                                                                                                  public Sensor setReverseBlockingSensorName(String reverseSensor) {
                                                                                                                      if ((reverseSensor == null) || (reverseSensor.length() <= 0)) {
                                                                                                                          mReverseBlockingNamedSensor = null;
                                                                                                                          mReverseBlockingSensorName = "";
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 396..414
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 429..448

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

                                                                                                              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 (containsBlock(aBlock.getBlock()) && (!containsBlock(cBlock.getBlock()))) {
                                                                                                                          // aBlock is in Section, cBlock is not
                                                                                                                          int dir = checkLists(mReverseEntryPoints, mForwardEntryPoints, cBlock);
                                                                                                                          if (dir != EntryPoint.UNKNOWN) {
                                                                                                                              return dir;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1067..1079

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

                                                                                                              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 (containsBlock(aBlock.getBlock()) && (!containsBlock(bBlock.getBlock()))) {
                                                                                                                          // aBlock is in Section, bBlock is not
                                                                                                                          int dir = checkLists(mReverseEntryPoints, mForwardEntryPoints, bBlock);
                                                                                                                          if (dir != EntryPoint.UNKNOWN) {
                                                                                                                              return dir;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1080..1092

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  public Sensor getForwardBlockingSensor() {
                                                                                                                      if (mForwardBlockingNamedSensor != null) {
                                                                                                                          return mForwardBlockingNamedSensor.getBean();
                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 322..340
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 375..394
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 455..474

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  @CheckForNull
                                                                                                                  public Sensor getReverseStoppingSensor() {
                                                                                                                      if (mReverseStoppingNamedSensor != null) {
                                                                                                                          return mReverseStoppingNamedSensor.getBean();
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 244..262
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 322..340
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 375..394

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  @CheckForNull
                                                                                                                  public Sensor getForwardStoppingSensor() {
                                                                                                                      if (mForwardStoppingNamedSensor != null) {
                                                                                                                          return mForwardStoppingNamedSensor.getBean();
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 244..262
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 322..340
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 455..474

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  public Sensor getReverseBlockingSensor() {
                                                                                                                      if (mReverseBlockingNamedSensor != null) {
                                                                                                                          return mReverseBlockingNamedSensor.getBean();
                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 244..262
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 375..394
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 455..474

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

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

                                                                                                                              case FREE:
                                                                                                                                  try {
                                                                                                                                      if ((getForwardBlockingSensor() != null) && (getForwardBlockingSensor().getState() != Sensor.ACTIVE)) {
                                                                                                                                          getForwardBlockingSensor().setKnownState(Sensor.ACTIVE);
                                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 160..171
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 172..183

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

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

                                                                                                                              case FORWARD:
                                                                                                                                  try {
                                                                                                                                      if ((getForwardBlockingSensor() != null) && (getForwardBlockingSensor().getState() != Sensor.INACTIVE)) {
                                                                                                                                          getForwardBlockingSensor().setState(Sensor.INACTIVE);
                                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 172..183
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 184..195

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

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

                                                                                                                              case REVERSE:
                                                                                                                                  try {
                                                                                                                                      if ((getReverseBlockingSensor() != null) && (getReverseBlockingSensor().getState() != Sensor.INACTIVE)) {
                                                                                                                                          getReverseBlockingSensor().setKnownState(Sensor.INACTIVE);
                                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 160..171
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 184..195

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

                                                                                                              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

                                                                                                                      } else if (getState() == REVERSE) {
                                                                                                                          for (Block b : mBlockEntries) {
                                                                                                                              if (b.getState() == Block.OCCUPIED) {
                                                                                                                                  beenSet = true;
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2601..2616

                                                                                                              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

                                                                                                                      } else if (getState() == FORWARD) {
                                                                                                                          for (Block b : mBlockEntries) {
                                                                                                                              if (b.getState() == Block.OCCUPIED) {
                                                                                                                                  beenSet = true;
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2616..2631

                                                                                                              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

                                                                                                                                                      && (((TrackSegment) t.getConnectC()).getLayoutBlock().getBlock() == cBlock))) {
                                                                                                                                                  // continuing track segment is in this block, normal continuing sense - or -
                                                                                                                                                  //  diverging track segment is in this block, reverse continuing sense.
                                                                                                                                                  if (a2Head == null) {
                                                                                                                                                      // single head at throat
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1984..2004

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

                                                                                                              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

                                                                                                                                                      && (((TrackSegment) t.getConnectB()).getLayoutBlock().getBlock() == cBlock))) {
                                                                                                                                                  // diverging track segment is in this block, normal continuing sense - or -
                                                                                                                                                  //  continuing track segment is in this block, reverse continuing sense.
                                                                                                                                                  if (a2Head == null) {
                                                                                                                                                      // single head at throat
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1961..1981

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

                                                                                                              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

                                                                                                                  private boolean connected(Block b1, Block b2) {
                                                                                                                      if ((b1 != null) && (b2 != null)) {
                                                                                                                          List<Path> paths = b1.getPaths();
                                                                                                                          for (int i = 0; i < paths.size(); i++) {
                                                                                                                              if (paths.get(i).getBlock() == b2) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/jmrit/beantable/SectionTableAction.java on lines 875..885
                                                                                                              java/src/jmri/jmrit/dispatcher/ActiveTrain.java on lines 970..980

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  @CheckForNull
                                                                                                                  public EntryPoint getExitPointToBlock(Block b, int dir) {
                                                                                                                      if (dir == REVERSE) {
                                                                                                                          for (EntryPoint ep : mForwardEntryPoints) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 928..945

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  @CheckForNull
                                                                                                                  public EntryPoint getEntryPointFromBlock(Block b, int dir) {
                                                                                                                      if (dir == FORWARD) {
                                                                                                                          for (EntryPoint ep : mForwardEntryPoints) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 956..973

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

                                                                                                              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

                                                                                                                                              } else if (((TrackSegment) t.getConnectB()).getLayoutBlock().getBlock() == cBlock) {
                                                                                                                                                  // continuing track segment is in this Block
                                                                                                                                                  if (a3Head != null) {
                                                                                                                                                      if (!checkDirectionSensor(a1Head, direction,
                                                                                                                                                              ConnectivityUtil.OVERALL, cUtil)) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2179..2192

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

                                                                                                              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

                                                                                                                                                  } else if (((TrackSegment) t.getConnectC()).getLayoutBlock().getBlock() == cBlock) {
                                                                                                                                                      // diverging track segment is in this Block
                                                                                                                                                      if (a2Head != null) {
                                                                                                                                                          if (!checkDirectionSensor(a2Head, direction,
                                                                                                                                                                  ConnectivityUtil.OVERALL, cUtil)) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2237..2250

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

                                                                                                              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

                                                                                                                              while ((tBlock == null) && (tn != null) && (!tn.reachedEndOfTrack())) {
                                                                                                                                  tn = cUtil.getNextNode(tn, 0);
                                                                                                                                  tBlock = (tn == null) ? null : cUtil.getExitBlockForTrackNode(tn, null);
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1632..1635

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

                                                                                                              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 (dir == REVERSE) {
                                                                                                                          for (EntryPoint ep : mForwardEntryPoints) {
                                                                                                                              if (s.containsBlock(ep.getFromBlock())) {
                                                                                                                                  return ep;
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 872..884

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

                                                                                                              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 (dir == FORWARD) {
                                                                                                                          for (EntryPoint ep : mForwardEntryPoints) {
                                                                                                                              if (s.containsBlock(ep.getFromBlock())) {
                                                                                                                                  return ep;
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 903..915

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

                                                                                                              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

                                                                                                                          while ((tBlock == null) && (tn != null) && (!tn.reachedEndOfTrack())) {
                                                                                                                              tn = cUtil.getNextNode(tn, 0);
                                                                                                                              tBlock = (tn == null) ? null : cUtil.getExitBlockForTrackNode(tn, null);
                                                                                                                          }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1646..1649

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

                                                                                                              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

                                                                                                                                              } else if (((t.getContinuingSense() == Turnout.CLOSED)
                                                                                                                                                      && (((TrackSegment) t.getConnectB()).getLayoutBlock().getBlock() == cBlock))
                                                                                                                                                      || ((t.getContinuingSense() == Turnout.THROWN)
                                                                                                                                                      && (((TrackSegment) t.getConnectC()).getLayoutBlock().getBlock() == cBlock))) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2099..2102
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2072..2075
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1981..1984

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

                                                                                                              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

                                                                                                                                                  if (((t.getContinuingSense() == Turnout.CLOSED)
                                                                                                                                                          && (((TrackSegment) t.getConnectB()).getLayoutBlock().getBlock() == cBlock))
                                                                                                                                                          || ((t.getContinuingSense() == Turnout.THROWN)
                                                                                                                                                          && (((TrackSegment) t.getConnectC()).getLayoutBlock().getBlock() == cBlock))) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2099..2102
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1981..1984
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1958..1961

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

                                                                                                              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

                                                                                                                                              } else if (((t.getContinuingSense() == Turnout.CLOSED)
                                                                                                                                                      && (((TrackSegment) t.getConnectC()).getLayoutBlock().getBlock() == cBlock))
                                                                                                                                                      || ((t.getContinuingSense() == Turnout.THROWN)
                                                                                                                                                      && (((TrackSegment) t.getConnectB()).getLayoutBlock().getBlock() == cBlock))) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2099..2102
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2072..2075
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1958..1961

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

                                                                                                              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

                                                                                                                                                  } else if (((t.getContinuingSense() == Turnout.CLOSED)
                                                                                                                                                          && (((TrackSegment) t.getConnectC()).getLayoutBlock().getBlock() == cBlock))
                                                                                                                                                          || ((t.getContinuingSense() == Turnout.THROWN)
                                                                                                                                                          && (((TrackSegment) t.getConnectB()).getLayoutBlock().getBlock() == cBlock))) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2072..2075
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1981..1984
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1958..1961

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  public void setAlternateColor(boolean set) {
                                                                                                                      for (Block b : mBlockEntries) {
                                                                                                                          String userName = b.getUserName();
                                                                                                                          if (userName != null) {
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2708..2719

                                                                                                              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

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

                                                                                                                  @Override
                                                                                                                  public void suppressNameUpdate(boolean set) {
                                                                                                                      for (Block b : mBlockEntries) {
                                                                                                                          String userName = b.getUserName();
                                                                                                                          if (userName != null) {
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 1 hr to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2572..2583

                                                                                                              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 ((aBlock == null) || (bBlock == null) || (cBlock == null) || (dBlock == null)) {
                                                                                                                          log.error("All blocks not assigned for track segments connecting to crossover turnout - {}.",
                                                                                                                                  t.getTurnout().getDisplayName(USERSYS));
                                                                                                                          return EntryPoint.UNKNOWN;
                                                                                                                      }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 55 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1328..1332

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

                                                                                                              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 ((aBlock == null) || (bBlock == null) || (cBlock == null) || (dBlock == null)) {
                                                                                                                          log.error("All blocks not assigned for track segments connecting to crossover turnout - {}.",
                                                                                                                                  t.getTurnout().getDisplayName(USERSYS));
                                                                                                                          return EntryPoint.UNKNOWN;
                                                                                                                      }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 55 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1133..1137

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

                                                                                                              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

                                                                                                                          while ((tBlock == null) && (tn != null) && (!tn.reachedEndOfTrack())) {
                                                                                                                              tn = cUtil.getNextNode(tn, 0);
                                                                                                                              tBlock = cUtil.getExitBlockForTrackNode(tn, exBlock);
                                                                                                                          }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 50 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1008..1011

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

                                                                                                              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

                                                                                                                              while ((tBlock == null) && (tn != null) && (!tn.reachedEndOfTrack())) {
                                                                                                                                  tn = cUtil.getNextNode(tn, 0);
                                                                                                                                  tBlock = cUtil.getExitBlockForTrackNode(tn, exBlock);
                                                                                                                              }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 50 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1000..1003

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

                                                                                                              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 (!connected(thisBlock, nextBlock)) {
                                                                                                                                  String s = "Sequential Blocks - " + thisBlock.getDisplayName(USERSYS)
                                                                                                                                          + ", " + nextBlock.getDisplayName(USERSYS)
                                                                                                                                          + " - are not connected in Section " + getDisplayName(USERSYS) + ".";
                                                                                                                                  return s;
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 50 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2483..2488

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

                                                                                                              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 (!connected(nextBlock, thisBlock)) {
                                                                                                                                  String s = "Sequential Blocks - " + thisBlock.getDisplayName(USERSYS)
                                                                                                                                          + ", " + nextBlock.getDisplayName(USERSYS)
                                                                                                                                          + " - Paths are not consistent - Section " + getDisplayName(USERSYS) + ".";
                                                                                                                                  return s;
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 50 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2477..2482

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

                                                                                                              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

                                                                                                                              if (nb.equals(getReverseStoppingSensor())) {
                                                                                                                                  PropertyChangeEvent e = new PropertyChangeEvent(this, "DoNotDelete", null, null);
                                                                                                                                  throw new PropertyVetoException(Bundle.getMessage("VetoBlockingSensor", nb.getBeanType(), Bundle.getMessage("Reverse"), Bundle.getMessage("Stopping"), getDisplayName()), e);
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 45 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2757..2760
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2761..2764
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2765..2768

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

                                                                                                              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

                                                                                                                              if (nb.equals(getReverseBlockingSensor())) {
                                                                                                                                  PropertyChangeEvent e = new PropertyChangeEvent(this, "DoNotDelete", null, null);
                                                                                                                                  throw new PropertyVetoException(Bundle.getMessage("VetoBlockingSensor", nb.getBeanType(), Bundle.getMessage("Reverse"), Bundle.getMessage("Blocking"), getDisplayName()), e);
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 45 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2757..2760
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2761..2764
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2769..2772

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

                                                                                                              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

                                                                                                                              if (nb.equals(getForwardStoppingSensor())) {
                                                                                                                                  PropertyChangeEvent e = new PropertyChangeEvent(this, "DoNotDelete", null, null);
                                                                                                                                  throw new PropertyVetoException(Bundle.getMessage("VetoBlockingSensor", nb.getBeanType(), Bundle.getMessage("Forward"), Bundle.getMessage("Stopping"), getDisplayName()), e);
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 45 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2757..2760
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2765..2768
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2769..2772

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

                                                                                                              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

                                                                                                                              if (nb.equals(getForwardBlockingSensor())) {
                                                                                                                                  PropertyChangeEvent e = new PropertyChangeEvent(this, "DoNotDelete", null, null);
                                                                                                                                  throw new PropertyVetoException(Bundle.getMessage("VetoBlockingSensor", nb.getBeanType(), Bundle.getMessage("Forward"), Bundle.getMessage("Blocking"), getDisplayName()), e); // NOI18N
                                                                                                                              }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 45 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2761..2764
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2765..2768
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2769..2772

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

                                                                                                              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 ((aBlock == bBlock) && (aBlock == cBlock) && (aBlock == dBlock)) {
                                                                                                                          log.error("Block setup problem - All track segments connecting to crossover turnout - {} are assigned to the same Block.",
                                                                                                                                  t.getTurnout().getDisplayName(USERSYS));
                                                                                                                          return EntryPoint.UNKNOWN;
                                                                                                                      }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 45 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1138..1142

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

                                                                                                              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 ((aBlock == bBlock) && (aBlock == cBlock) && (aBlock == dBlock)) {
                                                                                                                          log.error("Block setup problem - All track segments connecting to crossover turnout - {} are assigned to the same Block.",
                                                                                                                                  t.getTurnout().getDisplayName(USERSYS));
                                                                                                                          return EntryPoint.UNKNOWN;
                                                                                                                      }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 45 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1333..1337

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

                                                                                                              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 (int i = mReverseEntryPoints.size(); i > 0; i--) {
                                                                                                                          if (mReverseEntryPoints.get(i - 1) == ep) {
                                                                                                                              mReverseEntryPoints.remove(i - 1);
                                                                                                                          }
                                                                                                                      }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 40 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 811..815

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

                                                                                                              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 (int i = mForwardEntryPoints.size(); i > 0; i--) {
                                                                                                                          if (mForwardEntryPoints.get(i - 1) == ep) {
                                                                                                                              mForwardEntryPoints.remove(i - 1);
                                                                                                                          }
                                                                                                                      }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 40 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 816..820

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

                                                                                                              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 (t.getLayoutBlock().getBlock() == cBlock) {
                                                                                                                                                  // turnout is in this block, set direction sensors on b and c signal heads
                                                                                                                                                  // Note: need allocation to traverse this turnout
                                                                                                                                                  if (!checkDirectionSensor(bHead, altDirection,
                                                                                                                                                          ConnectivityUtil.OVERALL, cUtil)) {
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 40 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2157..2166
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1948..1958

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

                                                                                                              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 (((TrackSegment) t.getConnectA()).getLayoutBlock().getBlock() == cBlock) {
                                                                                                                                                  // throat Track Segment is in this Block
                                                                                                                                                  if (!checkDirectionSensor(bHead, altDirection,
                                                                                                                                                          ConnectivityUtil.OVERALL, cUtil)) {
                                                                                                                                                      errorCount++;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 40 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2213..2224
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2157..2166

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

                                                                                                              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 ((a2Head != null) && (a3Head != null)) {
                                                                                                                                                      if (!checkDirectionSensor(a2Head, direction,
                                                                                                                                                              ConnectivityUtil.OVERALL, cUtil)) {
                                                                                                                                                          errorCount++;
                                                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 40 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2213..2224
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1948..1958

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

                                                                                                              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

                                                                                                                      } else if (getState() == FORWARD) {
                                                                                                                          for (Block b : mBlockEntries) {
                                                                                                                              if (b.getState() == Block.OCCUPIED) {
                                                                                                                                  beenSet = true;
                                                                                                                              }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 40 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2675..2684

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

                                                                                                              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

                                                                                                                      } else if (getState() == REVERSE) {
                                                                                                                          for (Block b : mBlockEntries) {
                                                                                                                              if (b.getState() == Block.OCCUPIED) {
                                                                                                                                  beenSet = true;
                                                                                                                              }
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 40 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2666..2675

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  public boolean isForwardEntryPoint(EntryPoint ep) {
                                                                                                                      for (int i = 0; i < mForwardEntryPoints.size(); i++) {
                                                                                                                          if (ep == mForwardEntryPoints.get(i)) {
                                                                                                                              return true;
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 40 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 850..858

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  public boolean isReverseEntryPoint(EntryPoint ep) {
                                                                                                                      for (int i = 0; i < mReverseEntryPoints.size(); i++) {
                                                                                                                          if (ep == mReverseEntryPoints.get(i)) {
                                                                                                                              return true;
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 40 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 840..848

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

                                                                                                              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

                                                                                                                  @Override
                                                                                                                  public int getBlockSequenceNumber(Block b) {
                                                                                                                      for (int i = 0; i < mBlockEntries.size(); i++) {
                                                                                                                          if (b == mBlockEntries.get(i)) {
                                                                                                                              return i;
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 1 other location - About 35 mins to fix
                                                                                                              java/src/jmri/Conditional.java on lines 408..415

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

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

                                                                                                                      for (int j = 0; j < mReverseEntryPoints.size(); j++) {
                                                                                                                          if (mReverseEntryPoints.get(j).getFromBlock() == b.getBlock()) {
                                                                                                                              return EntryPoint.REVERSE;
                                                                                                                          }
                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 35 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1555..1559
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1560..1564
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1603..1607

                                                                                                              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

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

                                                                                                                      for (int i = 0; i < reverseList.size(); i++) {
                                                                                                                          if (reverseList.get(i).getFromBlock() == lBlock.getBlock()) {
                                                                                                                              return EntryPoint.REVERSE;
                                                                                                                          }
                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 35 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1555..1559
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1603..1607
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1608..1612

                                                                                                              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

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

                                                                                                                      for (int i = 0; i < mForwardEntryPoints.size(); i++) {
                                                                                                                          if (mForwardEntryPoints.get(i).getFromBlock() == b.getBlock()) {
                                                                                                                              return EntryPoint.FORWARD;
                                                                                                                          }
                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 35 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1555..1559
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1560..1564
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1608..1612

                                                                                                              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

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

                                                                                                                      for (int i = 0; i < forwardList.size(); i++) {
                                                                                                                          if (forwardList.get(i).getFromBlock() == lBlock.getBlock()) {
                                                                                                                              return EntryPoint.FORWARD;
                                                                                                                          }
                                                                                                                      }
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 35 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1560..1564
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1603..1607
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1608..1612

                                                                                                              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

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

                                                                                                                                          && ((t.getTurnoutType() == LayoutTurnout.TurnoutType.RH_TURNOUT)
                                                                                                                                          || (t.getTurnoutType() == LayoutTurnout.TurnoutType.LH_TURNOUT)
                                                                                                                                          || (t.getTurnoutType() == LayoutTurnout.TurnoutType.WYE_TURNOUT))) {
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 35 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 2253..2255
                                                                                                              java/src/jmri/jmrit/display/layoutEditor/LayoutEditorDialogs/LayoutTurnoutEditor.java on lines 483..485

                                                                                                              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

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

                                                                                                                                  } else if ((t.getTurnoutType() == LayoutTurnout.TurnoutType.RH_XOVER)
                                                                                                                                          || (t.getTurnoutType() == LayoutTurnout.TurnoutType.LH_XOVER)
                                                                                                                                          || (t.getTurnoutType() == LayoutTurnout.TurnoutType.DOUBLE_XOVER)) {
                                                                                                              Severity: Minor
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 2 other locations - About 35 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1902..1904
                                                                                                              java/src/jmri/jmrit/display/layoutEditor/LayoutEditorDialogs/LayoutTurnoutEditor.java on lines 483..485

                                                                                                              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

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

                                                                                                                      if (t.getLayoutBlock() != dBlock) {
                                                                                                                          //Block is not the same as that connected to D
                                                                                                                          int dir = checkLists(mReverseEntryPoints, mForwardEntryPoints, dBlock);
                                                                                                                          if (dir != EntryPoint.UNKNOWN) {
                                                                                                                              return dir;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 30 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1486..1492
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1493..1499
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1500..1506

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

                                                                                                                      if (t.getLayoutBlock() != cBlock) {
                                                                                                                          //Block is not the same as that connected to C
                                                                                                                          int dir = checkLists(mReverseEntryPoints, mForwardEntryPoints, cBlock);
                                                                                                                          if (dir != EntryPoint.UNKNOWN) {
                                                                                                                              return dir;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 30 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1486..1492
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1493..1499
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1507..1513

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

                                                                                                                      if (t.getLayoutBlock() != bBlock) {
                                                                                                                          //Block is not the same as that connected to B
                                                                                                                          int dir = checkLists(mReverseEntryPoints, mForwardEntryPoints, bBlock);
                                                                                                                          if (dir != EntryPoint.UNKNOWN) {
                                                                                                                              return dir;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 30 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1486..1492
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1500..1506
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1507..1513

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

                                                                                                                      if (t.getLayoutBlock() != aBlock) {
                                                                                                                          //Block is not the same as that connected to A
                                                                                                                          int dir = checkLists(mReverseEntryPoints, mForwardEntryPoints, aBlock);
                                                                                                                          if (dir != EntryPoint.UNKNOWN) {
                                                                                                                              return dir;
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/implementation/DefaultSection.java and 3 other locations - About 30 mins to fix
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1493..1499
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1500..1506
                                                                                                              java/src/jmri/implementation/DefaultSection.java on lines 1507..1513

                                                                                                              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

                                                                                                              There are no issues that match your filters.

                                                                                                              Category
                                                                                                              Status