java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java

Summary

Maintainability
F
2 mos
Test Coverage
F
37%

Method trackSegmentLeadsTo has a Cognitive Complexity of 383 (exceeds 20 allowed). Consider refactoring.
Open

    private boolean trackSegmentLeadsTo(
            @CheckForNull TrackSegment trackSegment, @CheckForNull LayoutTrack layoutTrack) {
        if ((trackSegment == null) || (layoutTrack == null)) {
            log.error("Null argument on entry to trackSegmentLeadsTo");
            return false;
Severity: Minor
Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 wk 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 ConnectivityUtil.java has 2268 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.display.layoutEditor;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
Severity: Major
Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 6 days to fix

    Method getTrackNode has a Cognitive Complexity of 262 (exceeds 20 allowed). Consider refactoring.
    Open

        @CheckReturnValue
        @CheckForNull
        public TrackNode getTrackNode(
                @Nonnull LayoutTrack currentNode,
                HitPointType currentNodeType,
    Severity: Minor
    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 5 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 getTurnoutSetting has a Cognitive Complexity of 252 (exceeds 20 allowed). Consider refactoring.
    Open

        private Integer getTurnoutSetting(
                @Nonnull LayoutTurnout layoutTurnout, HitPointType cType, boolean suppress) {
            prevConnectTrack = layoutTurnout;
            int setting = Turnout.THROWN;
            LayoutTurnout.TurnoutType tType = layoutTurnout.getTurnoutType();
    Severity: Minor
    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 4 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 getTurnoutList has a Cognitive Complexity of 223 (exceeds 20 allowed). Consider refactoring.
    Open

        @Nonnull
        public List<LayoutTrackExpectedState<LayoutTurnout>> getTurnoutList(
                @CheckForNull Block currBlock,
                @CheckForNull Block prevBlock,
                @CheckForNull Block nextBlock,
    Severity: Minor
    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 4 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 getTurnoutSetting has 378 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private Integer getTurnoutSetting(
                @Nonnull LayoutTurnout layoutTurnout, HitPointType cType, boolean suppress) {
            prevConnectTrack = layoutTurnout;
            int setting = Turnout.THROWN;
            LayoutTurnout.TurnoutType tType = layoutTurnout.getTurnoutType();
    Severity: Major
    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 day to fix

      Method getTrackNode has 375 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @CheckReturnValue
          @CheckForNull
          public TrackNode getTrackNode(
                  @Nonnull LayoutTrack currentNode,
                  HitPointType currentNodeType,
      Severity: Major
      Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 day to fix

        Method getTurnoutList has 338 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Nonnull
            public List<LayoutTrackExpectedState<LayoutTurnout>> getTurnoutList(
                    @CheckForNull Block currBlock,
                    @CheckForNull Block prevBlock,
                    @CheckForNull Block nextBlock,
        Severity: Major
        Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 day to fix

          Method getExitBlockForTrackNode has a Cognitive Complexity of 99 (exceeds 20 allowed). Consider refactoring.
          Open

              @CheckReturnValue
              @CheckForNull
              public Block getExitBlockForTrackNode(
                      @CheckForNull TrackNode node,
                      @CheckForNull Block excludedBlock) {
          Severity: Minor
          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.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 trackSegmentLeadsTo has 331 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private boolean trackSegmentLeadsTo(
                      @CheckForNull TrackSegment trackSegment, @CheckForNull LayoutTrack layoutTrack) {
                  if ((trackSegment == null) || (layoutTrack == null)) {
                      log.error("Null argument on entry to trackSegmentLeadsTo");
                      return false;
          Severity: Major
          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 day to fix

            Method getExitBlockForTrackNode has 170 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @CheckReturnValue
                @CheckForNull
                public Block getExitBlockForTrackNode(
                        @CheckForNull TrackNode node,
                        @CheckForNull Block excludedBlock) {
            Severity: Major
            Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 6 hrs to fix

              Method addSensorToSignalHeadLogic has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring.
              Open

                  public boolean addSensorToSignalHeadLogic(
                          @CheckForNull String name,
                          @CheckForNull SignalHead sh,
                          int where) {
                      if (sh == null) {
              Severity: Minor
              Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 4 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 addSensorToSignalHeadLogic has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public boolean addSensorToSignalHeadLogic(
                          @CheckForNull String name,
                          @CheckForNull SignalHead sh,
                          int where) {
                      if (sh == null) {
              Severity: Major
              Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 3 hrs to fix

                Method removeSensorsFromSignalHeadLogic has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
                Open

                    public boolean removeSensorsFromSignalHeadLogic(
                            @CheckForNull List<String> names, @CheckForNull SignalHead sh) {
                        if (sh == null) {
                            log.error("Null signal head on entry to removeSensorsFromSignalHeadLogic");
                            return false;
                Severity: Minor
                Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.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

                ConnectivityUtil has 26 methods (exceeds 20 allowed). Consider refactoring.
                Open

                final public class ConnectivityUtil {
                
                    // constants
                    // operational instance variables
                    final private LayoutEditor layoutEditor;
                Severity: Minor
                Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 3 hrs to fix

                  Method getLayoutTurnoutsThisBlock has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring.
                  Open

                      @Nonnull
                      public List<LayoutTurnout> getLayoutTurnoutsThisBlock(@Nonnull Block block
                      ) {
                          List<LayoutTurnout> result = new ArrayList<>();
                          String userName = block.getUserName();
                  Severity: Minor
                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 2 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 getLayoutTurnoutsThisBlock has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Nonnull
                      public List<LayoutTurnout> getLayoutTurnoutsThisBlock(@Nonnull Block block
                      ) {
                          List<LayoutTurnout> result = new ArrayList<>();
                          String userName = block.getUserName();
                  Severity: Minor
                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

                    Method removeSensorsFromSignalHeadLogic has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public boolean removeSensorsFromSignalHeadLogic(
                                @CheckForNull List<String> names, @CheckForNull SignalHead sh) {
                            if (sh == null) {
                                log.error("Null signal head on entry to removeSensorsFromSignalHeadLogic");
                                return false;
                    Severity: Minor
                    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

                      Method getSignalHeadAtLevelXing has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          @CheckReturnValue
                          @CheckForNull
                          public SignalHead getSignalHeadAtLevelXing(@CheckForNull LevelXing x,
                                  @CheckForNull Block block, boolean facing) {
                              if ((x == null) || (block == null)) {
                      Severity: Minor
                      Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                    if (((bbLogic.getSensor1() != null) && (bbLogic.getSensor1()).equals(name))
                                            || ((bbLogic.getSensor2() != null) && (bbLogic.getSensor2()).equals(name))
                                            || ((bbLogic.getSensor3() != null) && (bbLogic.getSensor3()).equals(name))
                                            || ((bbLogic.getSensor4() != null) && (bbLogic.getSensor4()).equals(name))
                                            || ((bbLogic.getSensor5() != null) && (bbLogic.getSensor5()).equals(name))) {
                        Severity: Critical
                        Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if ((x.getConnectA() != null) && (((TrackSegment) x.getConnectA()).getLayoutBlock() != null)
                                                  && (x.getConnectB() != null) && (((TrackSegment) x.getConnectB()).getLayoutBlock() != null)
                                                  && (x.getConnectC() != null) && (((TrackSegment) x.getConnectC()).getLayoutBlock() != null)
                                                  && (x.getConnectD() != null) && (((TrackSegment) x.getConnectD()).getLayoutBlock() != null)
                                                  && (x.getLayoutBlockAC() != null) && (x.getLayoutBlockBD() != null)) {
                          Severity: Critical
                          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

                            Method layoutTurnoutHasRequiredSignals has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public boolean layoutTurnoutHasRequiredSignals(@Nonnull LayoutTurnout t) {
                                    switch (t.getLinkType()) {
                                        case NO_LINK:
                                            if ((t.isTurnoutTypeTurnout())) {
                                                return (!t.getSignalA1Name().isEmpty()
                            Severity: Minor
                            Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

                              Method layoutTurnoutHasRequiredSignals has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
                              Open

                                  public boolean layoutTurnoutHasRequiredSignals(@Nonnull LayoutTurnout t) {
                                      switch (t.getLinkType()) {
                                          case NO_LINK:
                                              if ((t.isTurnoutTypeTurnout())) {
                                                  return (!t.getSignalA1Name().isEmpty()
                              Severity: Minor
                              Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr 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 getLevelCrossingsThisBlock has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  @Nonnull
                                  public List<LevelXing> getLevelCrossingsThisBlock(@Nonnull Block block
                                  ) {
                                      List<LevelXing> result = new ArrayList<>();
                                      String userName = block.getUserName();
                              Severity: Minor
                              Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

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

                                    public boolean blockInternalToLevelXing(
                                            @CheckForNull LevelXing x,
                                            @CheckForNull Block block) {
                                        if ((x == null) || (block == null)) {
                                            return false;
                                Severity: Minor
                                Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

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

                                      @CheckReturnValue
                                      @CheckForNull
                                      public SignalMast getSignalMastAtAnchor(@CheckForNull PositionablePoint p,
                                              @CheckForNull Block block, boolean facing) {
                                          if ((p == null) || (block == null)) {
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

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

                                        @CheckReturnValue
                                        @CheckForNull
                                        public SignalHead getSignalHeadAtAnchor(@CheckForNull PositionablePoint p,
                                                @CheckForNull Block block, boolean facing) {
                                            if ((p == null) || (block == null)) {
                                    Severity: Minor
                                    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                      if (((cType == HitPointType.SLIP_A) && (ls.getLayoutBlock() != currLayoutBlock))
                                                              || ((cType == HitPointType.SLIP_B) && (ls.getLayoutBlockB() != currLayoutBlock))
                                                              || ((cType == HitPointType.SLIP_C) && (ls.getLayoutBlockC() != currLayoutBlock))
                                                              || ((cType == HitPointType.SLIP_D) && (ls.getLayoutBlockD() != currLayoutBlock))) {
                                                          //Slip is outside of the current block
                                      Severity: Critical
                                      Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 hr to fix

                                        Method getSignalHeadAtLevelXing has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                                        Open

                                            @CheckReturnValue
                                            @CheckForNull
                                            public SignalHead getSignalHeadAtLevelXing(@CheckForNull LevelXing x,
                                                    @CheckForNull Block block, boolean facing) {
                                                if ((x == null) || (block == null)) {
                                        Severity: Minor
                                        Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 35 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

                                        Avoid too many return statements within this method.
                                        Open

                                                                return null;
                                        Severity: Major
                                        Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                  return false;
                                          Severity: Major
                                          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                                    return null;
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                          return false;
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                                    return true;    //(Yes!) Leg A-C has next block
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                              return true;    //(yes!) done
                                                  Severity: Major
                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                                        return true;
                                                    Severity: Major
                                                    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                      return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalAName());
                                                      Severity: Major
                                                      Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                            return false;
                                                        Severity: Major
                                                        Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                                                  return true;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                                    return false;
                                                            Severity: Major
                                                            Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                                              return true;
                                                              Severity: Major
                                                              Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                                return false;
                                                                Severity: Major
                                                                Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                                                  return true;    //(Yes!) done
                                                                  Severity: Major
                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                                        return true;
                                                                    Severity: Major
                                                                    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                                          return true;
                                                                      Severity: Major
                                                                      Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                return null;
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                  return (new TrackNode(node, nodeType, nodeTrackSegment, hitEnd, currentNodeState));
                                                                          Severity: Major
                                                                          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                            return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalBName());
                                                                            Severity: Major
                                                                            Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                                                      return true;
                                                                              Severity: Major
                                                                              Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                                                    return true;
                                                                                Severity: Major
                                                                                Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                          return (((TrackSegment) x.getConnectD()).getLayoutBlock() != lBlock);
                                                                                  Severity: Major
                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                                            return true;
                                                                                    Severity: Major
                                                                                    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                                                      return true;
                                                                                      Severity: Major
                                                                                      Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                        return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalCName());
                                                                                        Severity: Major
                                                                                        Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                  return true;
                                                                                          Severity: Major
                                                                                          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                            return null;
                                                                                            Severity: Major
                                                                                            Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                              return true;
                                                                                              Severity: Major
                                                                                              Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

                                                                                                                            return null;
                                                                                                Severity: Major
                                                                                                Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                                  Avoid too many return statements within this method.
                                                                                                  Open

                                                                                                                                      return true;
                                                                                                  Severity: Major
                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                                    Avoid too many return statements within this method.
                                                                                                    Open

                                                                                                                    return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalDName());
                                                                                                    Severity: Major
                                                                                                    Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                                      Avoid too many return statements within this method.
                                                                                                      Open

                                                                                                                  return null;
                                                                                                      Severity: Major
                                                                                                      Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                                        Avoid too many return statements within this method.
                                                                                                        Open

                                                                                                                                            return true;
                                                                                                        Severity: Major
                                                                                                        Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                                          Avoid too many return statements within this method.
                                                                                                          Open

                                                                                                                                              return true;
                                                                                                          Severity: Major
                                                                                                          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                                            Avoid too many return statements within this method.
                                                                                                            Open

                                                                                                                                                return true;    //(Yes!) Leg B-C has next block
                                                                                                            Severity: Major
                                                                                                            Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                                              Avoid too many return statements within this method.
                                                                                                              Open

                                                                                                                                                  return true;    //(yes!) done!
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

                                                                                                                Avoid too many return statements within this method.
                                                                                                                Open

                                                                                                                                                        return true;
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 30 mins to fix

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

                                                                                                                      @CheckReturnValue
                                                                                                                      @CheckForNull
                                                                                                                      public SignalMast getSignalMastAtAnchor(@CheckForNull PositionablePoint p,
                                                                                                                              @CheckForNull Block block, boolean facing) {
                                                                                                                          if ((p == null) || (block == null)) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.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

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

                                                                                                                      @CheckReturnValue
                                                                                                                      @CheckForNull
                                                                                                                      public SignalHead getSignalHeadAtAnchor(@CheckForNull PositionablePoint p,
                                                                                                                              @CheckForNull Block block, boolean facing) {
                                                                                                                          if ((p == null) || (block == null)) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.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

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

                                                                                                                      @Nonnull
                                                                                                                      public List<LevelXing> getLevelCrossingsThisBlock(@Nonnull Block block
                                                                                                                      ) {
                                                                                                                          List<LevelXing> result = new ArrayList<>();
                                                                                                                          String userName = block.getUserName();
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.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

                                                                                                                                  case TURNOUT_C:
                                                                                                                                      if ((tType == LayoutTurnout.TurnoutType.RH_XOVER) || (tType == LayoutTurnout.TurnoutType.DOUBLE_XOVER)) {
                                                                                                                                          // entering at a throat of a double crossover or a right-handed crossover
                                                                                                                                          if ((nextLayoutBlock == layoutTurnout.getLayoutBlockD()) || ((layoutTurnout.getConnectD() != null)
                                                                                                                                                  && (nextLayoutBlock == ((TrackSegment) layoutTurnout.getConnectD()).getLayoutBlock()))) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2311..2362

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

                                                                                                                  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

                                                                                                                                  case TURNOUT_D:
                                                                                                                                      if ((tType == LayoutTurnout.TurnoutType.LH_XOVER) || (tType == LayoutTurnout.TurnoutType.DOUBLE_XOVER)) {
                                                                                                                                          // entering at a throat of a double crossover or a left-handed crossover
                                                                                                                                          if ((nextLayoutBlock == layoutTurnout.getLayoutBlockC()) || ((layoutTurnout.getConnectC() != null)
                                                                                                                                                  && (nextLayoutBlock == ((TrackSegment) layoutTurnout.getConnectC()).getLayoutBlock()))) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2259..2310

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

                                                                                                                  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

                                                                                                                                  case SLIP_B:
                                                                                                                                      if (nextLayoutBlock == layoutBlockD) {
                                                                                                                                          // exiting block at D
                                                                                                                                          prevConnectType = HitPointType.SLIP_D;
                                                                                                                                          setting = LayoutSlip.STATE_BD;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2059..2110

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

                                                                                                                  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

                                                                                                                                  case SLIP_C:
                                                                                                                                      if (nextLayoutBlock == layoutBlockA) {
                                                                                                                                          // exiting block at A
                                                                                                                                          prevConnectType = HitPointType.SLIP_A;
                                                                                                                                          setting = LayoutSlip.STATE_AC;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2006..2058

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

                                                                                                                  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

                                                                                                                      @CheckReturnValue
                                                                                                                      @CheckForNull
                                                                                                                      public SignalHead getSignalHeadAtAnchor(@CheckForNull PositionablePoint p,
                                                                                                                              @CheckForNull Block block, boolean facing) {
                                                                                                                          if ((p == null) || (block == null)) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 811..842

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

                                                                                                                  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

                                                                                                                      @CheckReturnValue
                                                                                                                      @CheckForNull
                                                                                                                      public SignalMast getSignalMastAtAnchor(@CheckForNull PositionablePoint p,
                                                                                                                              @CheckForNull Block block, boolean facing) {
                                                                                                                          if ((p == null) || (block == null)) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 767..798

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

                                                                                                                  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

                                                                                                                                  case SLIP_A:
                                                                                                                                      if (nextLayoutBlock == layoutBlockC) {
                                                                                                                                          // exiting block at C
                                                                                                                                          prevConnectType = HitPointType.SLIP_C;
                                                                                                                                          setting = LayoutSlip.STATE_AC;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2111..2149

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

                                                                                                                  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

                                                                                                                                  case SLIP_D:
                                                                                                                                      if (nextLayoutBlock == layoutBlockB) {
                                                                                                                                          // exiting block at B
                                                                                                                                          prevConnectType = HitPointType.SLIP_B;
                                                                                                                                          setting = LayoutSlip.STATE_BD;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1967..2005

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

                                                                                                                  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

                                                                                                                                          case TURNOUT_A:
                                                                                                                                              if ((lt.getLayoutBlock()) != currLayoutBlock) {
                                                                                                                                                  // connection is outside of the current block
                                                                                                                                                  trackSegment = null;
                                                                                                                                              } else if (lt.getLayoutBlockB() == nextLayoutBlock) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 394..428
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 429..463
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 464..498

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

                                                                                                                  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

                                                                                                                                          case TURNOUT_C:
                                                                                                                                              if ((lt.getLayoutBlockC()) != currLayoutBlock) {
                                                                                                                                                  // connection is outside of the current block
                                                                                                                                                  trackSegment = null;
                                                                                                                                              } else if (lt.getLayoutBlockD() == nextLayoutBlock) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 359..393
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 394..428
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 464..498

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

                                                                                                                  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

                                                                                                                                          case TURNOUT_B:
                                                                                                                                              if ((lt.getLayoutBlockB()) != currLayoutBlock) {
                                                                                                                                                  // connection is outside of the current block
                                                                                                                                                  trackSegment = null;
                                                                                                                                              } else if (lt.getLayoutBlock() == nextLayoutBlock) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 359..393
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 429..463
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 464..498

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

                                                                                                                  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

                                                                                                                                          case TURNOUT_D:
                                                                                                                                              if ((lt.getLayoutBlockD()) != currLayoutBlock) {
                                                                                                                                                  // connection is outside of the current block
                                                                                                                                                  trackSegment = null;
                                                                                                                                              } else if (lt.getLayoutBlockC() == nextLayoutBlock) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 359..393
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 394..428
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 429..463

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

                                                                                                                  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

                                                                                                                                              case TURNOUT_B:
                                                                                                                                                  if ((lt.getLayoutBlockB()) != currLayoutBlock) {
                                                                                                                                                      if (lt.getLayoutBlockB() == nextLayoutBlock) {
                                                                                                                                                          return true;
                                                                                                                                                      } else {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2511..2532
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2555..2576
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2577..2598

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

                                                                                                                  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

                                                                                                                                              case TURNOUT_C:
                                                                                                                                                  if ((lt.getLayoutBlockC()) != currLayoutBlock) {
                                                                                                                                                      if (lt.getLayoutBlockC() == nextLayoutBlock) {
                                                                                                                                                          return true;
                                                                                                                                                      } else {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2511..2532
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2533..2554
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2577..2598

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

                                                                                                                  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

                                                                                                                                              case TURNOUT_A:
                                                                                                                                                  if ((lt.getLayoutBlock()) != currLayoutBlock) {
                                                                                                                                                      if (lt.getLayoutBlock() == nextLayoutBlock) {
                                                                                                                                                          return true;
                                                                                                                                                      } else {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2533..2554
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2555..2576
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2577..2598

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

                                                                                                                  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

                                                                                                                                              case TURNOUT_D:
                                                                                                                                                  if ((lt.getLayoutBlockD()) != currLayoutBlock) {
                                                                                                                                                      if (lt.getLayoutBlockD() == nextLayoutBlock) {
                                                                                                                                                          return true;
                                                                                                                                                      } else {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2511..2532
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2533..2554
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2555..2576

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

                                                                                                                  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

                                                                                                                              case SLIP_B:
                                                                                                                                  ls = (LayoutSlip) node.getNode();
                                                                                                                                  tBlock = ((TrackSegment) ls.getConnectD()).getLayoutBlock().getBlock();
                                                                                                                                  if (ls.getTurnoutType() == LayoutSlip.TurnoutType.DOUBLE_SLIP) {
                                                                                                                                      //Double slip
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1885..1904

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

                                                                                                                  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

                                                                                                                              case SLIP_C:
                                                                                                                                  ls = (LayoutSlip) node.getNode();
                                                                                                                                  tBlock = ((TrackSegment) ls.getConnectA()).getLayoutBlock().getBlock();
                                                                                                                                  if (ls.getTurnoutType() == LayoutSlip.TurnoutType.DOUBLE_SLIP) {
                                                                                                                                      if ((tBlock != node.getTrackSegment().getLayoutBlock().getBlock())
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1864..1884

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

                                                                                                                  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 ((ls.getConnectA() != null) && (((TrackSegment) ls.getConnectA()).getLayoutBlock() == lBlock)) {
                                                                                                                                  result.add(ls);
                                                                                                                              } else if ((ls.getConnectB() != null) && (((TrackSegment) ls.getConnectB()).getLayoutBlock() == lBlock)) {
                                                                                                                                  result.add(ls);
                                                                                                                              } else if ((ls.getConnectC() != null) && (((TrackSegment) ls.getConnectC()).getLayoutBlock() == lBlock)) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 664..672

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

                                                                                                                  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 ((t.getConnectA() != null) && (((TrackSegment) t.getConnectA()).getLayoutBlock() == lBlock)) {
                                                                                                                                  result.add(t);
                                                                                                                              } else if ((t.getConnectB() != null) && (((TrackSegment) t.getConnectB()).getLayoutBlock() == lBlock)) {
                                                                                                                                  result.add(t);
                                                                                                                              } else if ((t.getConnectC() != null) && (((TrackSegment) t.getConnectC()).getLayoutBlock() == lBlock)) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 677..685

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

                                                                                                                  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

                                                                                                                                  case CONTINUING:
                                                                                                                                      if (((bbLogic.getWatchedSensor1() != null) && (bbLogic.getWatchedSensor1()).equals(name))
                                                                                                                                              || ((bbLogic.getWatchedSensor1Alt() != null) && (bbLogic.getWatchedSensor1Alt()).equals(name))) {
                                                                                                                                          blockBossLogicProvider.register(bbLogic);
                                                                                                                                          bbLogic.start();
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1131..1148

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

                                                                                                                  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

                                                                                                                                  case DIVERGING:
                                                                                                                                      if (((bbLogic.getWatchedSensor2() != null) && (bbLogic.getWatchedSensor2()).equals(name))
                                                                                                                                              || ((bbLogic.getWatchedSensor2Alt() != null) && (bbLogic.getWatchedSensor2Alt()).equals(name))) {
                                                                                                                                          blockBossLogicProvider.register(bbLogic);
                                                                                                                                          bbLogic.start();
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1149..1166

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

                                                                                                                  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

                                                                                                                                      case LayoutConnectivity.XOVER_BOUNDARY_AB: {
                                                                                                                                          setting = Turnout.CLOSED;
                                                                                                                                          if (((TrackSegment) xt.getConnectA() != null) && (currLayoutBlock == ((TrackSegment) xt.getConnectA()).getLayoutBlock())) {
                                                                                                                                              // block exits Xover at A
                                                                                                                                              trackSegment = (TrackSegment) xt.getConnectA();
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 191..203

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

                                                                                                                  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

                                                                                                                                      case LayoutConnectivity.XOVER_BOUNDARY_CD: {
                                                                                                                                          setting = Turnout.CLOSED;
                                                                                                                                          if (((TrackSegment) xt.getConnectC() != null) && (currLayoutBlock == ((TrackSegment) xt.getConnectC()).getLayoutBlock())) {
                                                                                                                                              // block exits Xover at C
                                                                                                                                              trackSegment = (TrackSegment) xt.getConnectC();
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 178..190

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      public boolean isInternalLevelXingBD(
                                                                                                                              @Nonnull LevelXing x, @Nonnull Block block) {
                                                                                                                          String userName = block.getUserName();
                                                                                                                          LayoutBlock lBlock = null;
                                                                                                                          if ((userName != null) && !userName.isEmpty()) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1010..1027

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      public boolean isInternalLevelXingAC(
                                                                                                                              @Nonnull LevelXing x, @Nonnull Block block) {
                                                                                                                          String userName = block.getUserName();
                                                                                                                          LayoutBlock lBlock = null;
                                                                                                                          if ((userName != null) && !userName.isEmpty()) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1042..1059

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

                                                                                                                  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

                                                                                                                                      case LayoutConnectivity.XOVER_BOUNDARY_BD: {
                                                                                                                                          if (((TrackSegment) xt.getConnectB() != null) && (currLayoutBlock == ((TrackSegment) xt.getConnectB()).getLayoutBlock())) {
                                                                                                                                              // block exits Xover at B
                                                                                                                                              trackSegment = (TrackSegment) xt.getConnectB();
                                                                                                                                              prevConnectType = HitPointType.TURNOUT_B;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 204..215

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

                                                                                                                                      case LayoutConnectivity.XOVER_BOUNDARY_AC: {
                                                                                                                                          if (((TrackSegment) xt.getConnectA() != null) && (currLayoutBlock == ((TrackSegment) xt.getConnectA()).getLayoutBlock())) {
                                                                                                                                              // block exits Xover at A
                                                                                                                                              trackSegment = (TrackSegment) xt.getConnectA();
                                                                                                                                              prevConnectType = HitPointType.TURNOUT_A;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 216..227

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

                                                                                                                              case SLIP_B: {
                                                                                                                                  if (currentNode instanceof LayoutSlip) {
                                                                                                                                      LayoutSlip ls = (LayoutSlip) currentNode;
                                                                                                                                      if (currentNodeState == TRACKNODE_CONTINUING) {
                                                                                                                                          nextTrackSegment = (TrackSegment) ls.getConnectD();
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1631..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 112.

                                                                                                                  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

                                                                                                                              case SLIP_C: {
                                                                                                                                  if (currentNode instanceof LayoutSlip) {
                                                                                                                                      LayoutSlip ls = (LayoutSlip) currentNode;
                                                                                                                                      if (currentNodeState == TRACKNODE_CONTINUING) {
                                                                                                                                          nextTrackSegment = (TrackSegment) ls.getConnectA();
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1612..1630

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

                                                                                                                  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

                                                                                                                                                  switch (currentNodeState) {
                                                                                                                                                      case TRACKNODE_CONTINUING:
                                                                                                                                                          if (lto.getContinuingSense() == Turnout.CLOSED) {
                                                                                                                                                              nextTrackSegment = (TrackSegment) lto.getConnectB();
                                                                                                                                                              //prevTrackType = LayoutEditor.HitPointType.TURNOUT_B;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1369..1391

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 110.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                                                  switch (currentNodeState) {
                                                                                                                                                      case TRACKNODE_CONTINUING:
                                                                                                                                                          if (lto.getContinuingSense() == Turnout.CLOSED) {
                                                                                                                                                              nextTrackSegment = (TrackSegment) lto.getConnectB();
                                                                                                                                                              //prevTrackType = LayoutEditor.HitPointType.TURNOUT_B;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1473..1495

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 110.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                                              case SLIP_D:
                                                                                                                                                  if (layoutBlockA == nextLayoutBlock) {
                                                                                                                                                      //Leg D-A has next currLayoutBlock
                                                                                                                                                      return true;
                                                                                                                                                  }
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2654..2672

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

                                                                                                                  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

                                                                                                                                              case SLIP_A:
                                                                                                                                                  if (layoutBlockC == nextLayoutBlock) {
                                                                                                                                                      //Leg A-D has next currLayoutBlock
                                                                                                                                                      return true;
                                                                                                                                                  }
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2731..2749

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

                                                                                                                  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 ((conType == HitPointType.LEVEL_XING_A) || (conType == HitPointType.LEVEL_XING_C)) {
                                                                                                                                          if (((LevelXing) conLayoutTrack).getLayoutBlockAC() != currLayoutBlock) {
                                                                                                                                              if (((LevelXing) conLayoutTrack).getLayoutBlockAC() == nextLayoutBlock) {
                                                                                                                                                  return true;
                                                                                                                                              } else {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2488..2500

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

                                                                                                                  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 (((LevelXing) conLayoutTrack).getLayoutBlockBD() != currLayoutBlock) {
                                                                                                                                              if (((LevelXing) conLayoutTrack).getLayoutBlockBD() == nextLayoutBlock) {
                                                                                                                                                  return true;
                                                                                                                                              } else {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2476..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 94.

                                                                                                                  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 ((lt.getTurnoutType() == LayoutTurnout.TurnoutType.LH_XOVER)
                                                                                                                                          || (lt.getTurnoutType() == LayoutTurnout.TurnoutType.DOUBLE_XOVER)) {
                                                                                                                                      tBlock = ((TrackSegment) lt.getConnectB()).getLayoutBlock().getBlock();
                                                                                                                                      if ((tBlock != node.getTrackSegment().getLayoutBlock().getBlock())
                                                                                                                                              && (tBlock != excludedBlock)) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1784..1791

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

                                                                                                                  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 ((lt.getTurnoutType() == LayoutTurnout.TurnoutType.LH_XOVER)
                                                                                                                                          || (lt.getTurnoutType() == LayoutTurnout.TurnoutType.DOUBLE_XOVER)) {
                                                                                                                                      tBlock = ((TrackSegment) lt.getConnectD()).getLayoutBlock().getBlock();
                                                                                                                                      if ((tBlock != node.getTrackSegment().getLayoutBlock().getBlock())
                                                                                                                                              && (tBlock != excludedBlock)) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1813..1820

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

                                                                                                                  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

                                                                                                                              case SLIP_A: {
                                                                                                                                  if (currentNode instanceof LayoutSlip) {
                                                                                                                                      LayoutSlip ls = (LayoutSlip) currentNode;
                                                                                                                                      if (currentNodeState == TRACKNODE_CONTINUING) {
                                                                                                                                          nextTrackSegment = (TrackSegment) ls.getConnectC();
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1650..1664

                                                                                                                  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

                                                                                                                              case SLIP_D: {
                                                                                                                                  if (currentNode instanceof LayoutSlip) {
                                                                                                                                      LayoutSlip ls = (LayoutSlip) currentNode;
                                                                                                                                      if (currentNodeState == TRACKNODE_CONTINUING) {
                                                                                                                                          nextTrackSegment = (TrackSegment) ls.getConnectB();
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1597..1611

                                                                                                                  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

                                                                                                                          for (EntryPoint ep : mReverseEntryPoints) {
                                                                                                                              if (((ep.getBlock() == block1) && (ep.getFromBlock() == block2))
                                                                                                                                      || ((ep.getBlock() == block2) && (ep.getFromBlock() == block1))) {
                                                                                                                                  return EntryPoint.REVERSE;
                                                                                                                              }
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 982..987

                                                                                                                  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

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

                                                                                                                          for (EntryPoint ep : mForwardEntryPoints) {
                                                                                                                              if (((ep.getBlock() == block1) && (ep.getFromBlock() == block2))
                                                                                                                                      || ((ep.getBlock() == block2) && (ep.getFromBlock() == block1))) {
                                                                                                                                  return EntryPoint.FORWARD;
                                                                                                                              }
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 988..993

                                                                                                                  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

                                                                                                                              if ((trackSegment != null) && (trackSegment.getLayoutBlock() != currLayoutBlock)) {
                                                                                                                                  // continuing track segment is not in this block
                                                                                                                                  trackSegment = null;
                                                                                                                              } else if (trackSegment == null) {
                                                                                                                                  if (!suppress) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2153..2161

                                                                                                                  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

                                                                                                                                  if (lt.getTurnoutType() != LayoutTurnout.TurnoutType.LH_XOVER) {
                                                                                                                                      tBlock = ((TrackSegment) lt.getConnectA()).getLayoutBlock().getBlock();
                                                                                                                                      if ((tBlock != node.getTrackSegment().getLayoutBlock().getBlock())
                                                                                                                                              && (tBlock != excludedBlock)) {
                                                                                                                                          block = tBlock;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1770..1776

                                                                                                                  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

                                                                                                                              if ((trackSegment != null) && (trackSegment.getLayoutBlock() != currLayoutBlock)) {
                                                                                                                                  // continuing track segment is not in this block
                                                                                                                                  trackSegment = null;
                                                                                                                              } else if (trackSegment == null) {
                                                                                                                                  if (!suppress) {
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2369..2377

                                                                                                                  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

                                                                                                                                  } else if (lt.getTurnoutType() != LayoutTurnout.TurnoutType.LH_XOVER) {
                                                                                                                                      tBlock = ((TrackSegment) lt.getConnectC()).getLayoutBlock().getBlock();
                                                                                                                                      if ((tBlock != node.getTrackSegment().getLayoutBlock().getBlock())
                                                                                                                                              && (tBlock != excludedBlock)) {
                                                                                                                                          block = tBlock;
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1795..1801

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

                                                                                                                              case LEVEL_XING_B:
                                                                                                                                  x = (LevelXing) node.getNode();
                                                                                                                                  tBlock = ((TrackSegment) x.getConnectD()).getLayoutBlock().getBlock();
                                                                                                                                  if (tBlock != node.getTrackSegment().getLayoutBlock().getBlock()) {
                                                                                                                                      block = tBlock;
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 2 other locations - About 50 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1836..1842
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1843..1849

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

                                                                                                                              case LEVEL_XING_D:
                                                                                                                                  x = (LevelXing) node.getNode();
                                                                                                                                  tBlock = ((TrackSegment) x.getConnectB()).getLayoutBlock().getBlock();
                                                                                                                                  if (tBlock != node.getTrackSegment().getLayoutBlock().getBlock()) {
                                                                                                                                      block = tBlock;
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 2 other locations - About 50 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1829..1835
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1836..1842

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

                                                                                                                              case LEVEL_XING_C:
                                                                                                                                  x = (LevelXing) node.getNode();
                                                                                                                                  tBlock = ((TrackSegment) x.getConnectA()).getLayoutBlock().getBlock();
                                                                                                                                  if (tBlock != node.getTrackSegment().getLayoutBlock().getBlock()) {
                                                                                                                                      block = tBlock;
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 2 other locations - About 50 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1829..1835
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1843..1849

                                                                                                                  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 ((currentNodeType == HitPointType.TURNOUT_A)
                                                                                                                                                          && (!(lt.getTurnoutType() == LayoutTurnout.TurnoutType.LH_XOVER))) {
                                                                                                                                                      nextTrackSegment = (TrackSegment) lt.getConnectC();
                                                                                                                                                      //prevTrackType = LayoutEditor.HitPointType.TURNOUT_C;
                                                                                                                                                  } else {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 50 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1515..1522

                                                                                                                  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

                                                                                                                                                  } else if ((currentNodeType == HitPointType.TURNOUT_B)
                                                                                                                                                          && (!(lt.getTurnoutType() == LayoutTurnout.TurnoutType.RH_XOVER))) {
                                                                                                                                                      nextTrackSegment = (TrackSegment) lt.getConnectD();
                                                                                                                                                      //prevTrackType = LayoutEditor.HitPointType.TURNOUT_D;
                                                                                                                                                  } else {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 50 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1438..1445

                                                                                                                  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

                                                                                                                                      } else if ((layoutTurnout.getConnectC() != null) && (currLayoutBlock == ((TrackSegment) layoutTurnout.getConnectC()).getLayoutBlock())
                                                                                                                                              && (layoutTurnout.getConnectB() != null) && (currLayoutBlock != ((TrackSegment) layoutTurnout.getConnectB()).getLayoutBlock())) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 50 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2184..2185

                                                                                                                  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

                                                                                                                                      else if ((layoutTurnout.getConnectB() != null) && (currLayoutBlock == ((TrackSegment) layoutTurnout.getConnectB()).getLayoutBlock())
                                                                                                                                              && (layoutTurnout.getConnectC() != null) && (currLayoutBlock != ((TrackSegment) layoutTurnout.getConnectC()).getLayoutBlock())) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 50 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2190..2191

                                                                                                                  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

                                                                                                                                              } else {
                                                                                                                                                  switch (currentNodeState) {
                                                                                                                                                      case TRACKNODE_CONTINUING:
                                                                                                                                                          nextTrackSegment = (TrackSegment) lt.getConnectC();
                                                                                                                                                          //prevTrackType = LayoutEditor.HitPointType.TURNOUT_C;
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 45 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1336..1350

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

                                                                                                                                              if (lt.getContinuingSense() == Turnout.CLOSED) {
                                                                                                                                                  switch (currentNodeState) {
                                                                                                                                                      case TRACKNODE_CONTINUING:
                                                                                                                                                          nextTrackSegment = (TrackSegment) lt.getConnectB();
                                                                                                                                                          //prevTrackType = LayoutEditor.HitPointType.TURNOUT_B;
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 45 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1350..1364

                                                                                                                  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 (((TrackSegment) x.getConnectA()).getLayoutBlock() == lBlock) {
                                                                                                                              if (facing) {
                                                                                                                                  return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalCName());
                                                                                                                              } else {
                                                                                                                                  return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalAName());
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 3 other locations - About 45 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 899..905
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 906..912
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 913..919

                                                                                                                  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

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

                                                                                                                          if (((TrackSegment) x.getConnectB()).getLayoutBlock() == lBlock) {
                                                                                                                              if (facing) {
                                                                                                                                  return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalDName());
                                                                                                                              } else {
                                                                                                                                  return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalBName());
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 3 other locations - About 45 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 892..898
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 906..912
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 913..919

                                                                                                                  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

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

                                                                                                                          if (((TrackSegment) x.getConnectD()).getLayoutBlock() == lBlock) {
                                                                                                                              if (facing) {
                                                                                                                                  return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalBName());
                                                                                                                              } else {
                                                                                                                                  return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalDName());
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 3 other locations - About 45 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 892..898
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 899..905
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 906..912

                                                                                                                  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

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

                                                                                                                          if (((TrackSegment) x.getConnectC()).getLayoutBlock() == lBlock) {
                                                                                                                              if (facing) {
                                                                                                                                  return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalAName());
                                                                                                                              } else {
                                                                                                                                  return InstanceManager.getDefault(jmri.SignalHeadManager.class).getSignalHead(x.getSignalCName());
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 3 other locations - About 45 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 892..898
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 899..905
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 913..919

                                                                                                                  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

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

                                                                                                                                                      case TRACKNODE_CONTINUING:
                                                                                                                                                          if (lto.getContinuingSense() == Turnout.CLOSED) {
                                                                                                                                                              nextTrackSegment = (TrackSegment) lto.getConnectB();
                                                                                                                                                              //prevTrackType = LayoutEditor.HitPointType.TURNOUT_B;
                                                                                                                                                          } else {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 45 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1414..1423

                                                                                                                  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

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

                                                                                                                                                      case TRACKNODE_DIVERGING_2ND_3WAY:
                                                                                                                                                          if (lto.getContinuingSense() == Turnout.CLOSED) {
                                                                                                                                                              nextTrackSegment = (TrackSegment) lto.getConnectC();
                                                                                                                                                              //prevTrackType = LayoutEditor.HitPointType.TURNOUT_C;
                                                                                                                                                          } else {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 45 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1395..1404

                                                                                                                  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 (layoutTurnout.getContinuingSense() != Turnout.CLOSED) {
                                                                                                                                  if (setting == Turnout.THROWN) {
                                                                                                                                      setting = Turnout.CLOSED;
                                                                                                                                  } else if (setting == Turnout.CLOSED) {
                                                                                                                                      setting = Turnout.THROWN;
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 35 mins to fix
                                                                                                                  java/src/jmri/jmrix/nce/NceSensorManager.java on lines 362..368

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

                                                                                                                          if ((x.getConnectA() == null) || (x.getConnectB() == null)
                                                                                                                                  || (x.getConnectC() == null) || (x.getConnectD() == null)) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 35 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 945..946

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

                                                                                                                          if ((x.getConnectA() == null) || (x.getConnectB() == null)
                                                                                                                                  || (x.getConnectC() == null) || (x.getConnectD() == null)) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 35 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 887..888

                                                                                                                  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

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

                                                                                                                                  .filter((lt) -> ((lt.getLayoutBlock() == currLayoutBlock)
                                                                                                                                  || (lt.getLayoutBlockB() == currLayoutBlock)
                                                                                                                                  || (lt.getLayoutBlockC() == currLayoutBlock)
                                                                                                                                  || (lt.getLayoutBlockD() == currLayoutBlock)))
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 35 mins to fix
                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1706..1707

                                                                                                                  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

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

                                                                                                                                      case LEVEL_XING_C: {
                                                                                                                                          if (((LevelXing) cObject).getLayoutBlockAC() != currLayoutBlock) {
                                                                                                                                              // outside of block
                                                                                                                                              trackSegment = null;
                                                                                                                                          } else {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 35 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 336..345

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 44.

                                                                                                                  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

                                                                                                                                      case LEVEL_XING_D: {
                                                                                                                                          if (((LevelXing) cObject).getLayoutBlockBD() != currLayoutBlock) {
                                                                                                                                              // outside of block
                                                                                                                                              trackSegment = null;
                                                                                                                                          } else {
                                                                                                                  Severity: Minor
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 1 other location - About 35 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 325..334

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

                                                                                                                  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

                                                                                                                              case LEVEL_XING_B:
                                                                                                                                  if (currentNode instanceof LevelXing) {
                                                                                                                                      nextTrackSegment = (TrackSegment) ((LevelXing) currentNode).getConnectD();
                                                                                                                                      //prevTrackType = LayoutEditor.HitPointType.LEVEL_XING_D;
                                                                                                                                  } else {
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 3 other locations - About 30 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1565..1572
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1581..1588
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1589..1596

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 40.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                              case LEVEL_XING_C:
                                                                                                                                  if (currentNode instanceof LevelXing) {
                                                                                                                                      nextTrackSegment = (TrackSegment) ((LevelXing) currentNode).getConnectA();
                                                                                                                                      //prevTrackType = LayoutEditor.HitPointType.LEVEL_XING_A;
                                                                                                                                  } else {
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 3 other locations - About 30 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1565..1572
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1573..1580
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1589..1596

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 40.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                              case LEVEL_XING_A:
                                                                                                                                  if (currentNode instanceof LevelXing) {
                                                                                                                                      nextTrackSegment = (TrackSegment) ((LevelXing) currentNode).getConnectC();
                                                                                                                                      //prevTrackType = LayoutEditor.HitPointType.LEVEL_XING_C;
                                                                                                                                  } else {
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 3 other locations - About 30 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1573..1580
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1581..1588
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1589..1596

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 40.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                              case LEVEL_XING_D:
                                                                                                                                  if (currentNode instanceof LevelXing) {
                                                                                                                                      nextTrackSegment = (TrackSegment) ((LevelXing) currentNode).getConnectB();
                                                                                                                                      //prevTrackType = LayoutEditor.HitPointType.LEVEL_XING_B;
                                                                                                                                  } else {
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java and 3 other locations - About 30 mins to fix
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1565..1572
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1573..1580
                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 1581..1588

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 40.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  There are no issues that match your filters.

                                                                                                                  Category
                                                                                                                  Status