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

Summary

Maintainability
F
1 mo
Test Coverage
F
45%

File TrackSegmentView.java has 2919 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.display.layoutEditor;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.geom.*;
Severity: Major
Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 wk to fix

    TrackSegmentView has 190 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class TrackSegmentView extends LayoutTrackView {
    
        public TrackSegmentView(@Nonnull TrackSegment track, @Nonnull LayoutEditor layoutEditor) {
            super(track, layoutEditor);
    
    
    Severity: Major
    Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 3 days to fix

      Method showPopup has 615 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          @Nonnull
          protected JPopupMenu showPopup(@Nonnull JmriMouseEvent mouseEvent) {
              if (popupMenu != null) {
                  popupMenu.removeAll();
      Severity: Major
      Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 3 days to fix

        Method drawDecorations has a Cognitive Complexity of 119 (exceeds 20 allowed). Consider refactoring.
        Open

            @Override
            protected void drawDecorations(Graphics2D g2) {
        
                log.trace("TrackSegmentView: drawDecorations arrowStyle {}", arrowStyle);
        // get end points and calculate start/stop angles (in radians)
        Severity: Minor
        Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 2 days to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method setDecorations has a Cognitive Complexity of 100 (exceeds 20 allowed). Consider refactoring.
        Open

            @Override
            public void setDecorations(@Nonnull Map<String, String> decorations) {
                Color defaultTrackColor = layoutEditor.getDefaultTrackColorColor();
                super.setDecorations(decorations);
                if (decorations != null) {
        Severity: Minor
        Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.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 drawDecorations has 331 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            protected void drawDecorations(Graphics2D g2) {
        
                log.trace("TrackSegmentView: drawDecorations arrowStyle {}", arrowStyle);
        // get end points and calculate start/stop angles (in radians)
        Severity: Major
        Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 day to fix

          Method setDecorations has 199 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public void setDecorations(@Nonnull Map<String, String> decorations) {
                  Color defaultTrackColor = layoutEditor.getDefaultTrackColorColor();
                  super.setDecorations(decorations);
                  if (decorations != null) {
          Severity: Major
          Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 7 hrs to fix

            Method drawArrow has 137 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private int drawArrow(
                        Graphics2D g2,
                        Point2D ep,
                        double angleRAD,
                        boolean dirOut,
            Severity: Major
            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 5 hrs to fix

              Method showPopup has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring.
              Open

                  @Override
                  @Nonnull
                  protected JPopupMenu showPopup(@Nonnull JmriMouseEvent mouseEvent) {
                      if (popupMenu != null) {
                          popupMenu.removeAll();
              Severity: Minor
              Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 5 hrs to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                  @Override
                  public Map<String, String> getDecorations() {
                      if (decorations == null) {
                          decorations = new HashMap<>();
                      } // if (decorathions != null)
              Severity: Minor
              Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.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 getPointReferences has 98 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public ArrayList<String> getPointReferences(HitPointType type, LayoutTrack conn) {
                      ArrayList<String> result = new ArrayList<>();
              
                      if (type == HitPointType.POS_POINT && conn instanceof PositionablePoint) {
                          PositionablePoint pt = (PositionablePoint) conn;
              Severity: Major
              Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 3 hrs to fix

                Method getDecorations has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    public Map<String, String> getDecorations() {
                        if (decorations == null) {
                            decorations = new HashMap<>();
                        } // if (decorathions != null)
                Severity: Major
                Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 3 hrs to fix

                  Method calculateTrackSegmentAngle has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected void calculateTrackSegmentAngle() {
                          Point2D pt1, pt2;
                          if (isFlip()) {
                              pt1 = layoutEditor.getCoords(getConnect2(), getType2());
                              pt2 = layoutEditor.getCoords(getConnect1(), getType1());
                  Severity: Major
                  Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 2 hrs to fix

                    Method splitTrackSegment has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public void splitTrackSegment() {
                            // create a new anchor
                            Point2D p = getCentreSeg();
                            PositionablePoint newAnchor = layoutEditor.addAnchor(p);
                            // link it to me
                    Severity: Major
                    Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 2 hrs to fix

                      Method getPointReferences has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
                      Open

                          public ArrayList<String> getPointReferences(HitPointType type, LayoutTrack conn) {
                              ArrayList<String> result = new ArrayList<>();
                      
                              if (type == HitPointType.POS_POINT && conn instanceof PositionablePoint) {
                                  PositionablePoint pt = (PositionablePoint) conn;
                      Severity: Minor
                      Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.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 getCentreSeg has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public Point2D getCentreSeg() {
                              Point2D result = MathUtil.zeroPoint2D;
                      
                              if ((getConnect1() != null) && (getConnect2() != null)) {
                                  // get the end points
                      Severity: Minor
                      Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 hr to fix

                        Method findHitPointType has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @Override
                            protected HitPointType findHitPointType(Point2D hitPoint, boolean useRectangles, boolean requireUnconnected) {
                                HitPointType result = HitPointType.NONE;  // assume point not on connection
                        
                                if (!requireUnconnected) {
                        Severity: Minor
                        Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 hr to fix

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

                              void changeType(int choice) {
                                  switch (choice) {
                                      case 0: // plain track segment (line)
                                          setArc(false);
                                          setAngle(0.0D);
                          Severity: Minor
                          Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 hr to fix

                            Method draw2 has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Override
                                protected void draw2(Graphics2D g2, boolean isMain, float railDisplacement) {
                            //   if (getName().equals("T5")) {
                            //       log.debug("STOP");
                            //   }
                            Severity: Minor
                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 hr to fix

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

                                  public void setCircle(boolean boo) {
                                      if (circle != boo) {
                                          circle = boo;
                                          if (circle) {
                                              // if it was a bezier
                              Severity: Minor
                              Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 hr to fix

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

                                    protected void showBezierPopUp(JmriMouseEvent e, HitPointType hitPointType) {
                                        int bezierControlPointIndex = hitPointType.bezierPointIndex();
                                        if (popupMenu != null) {
                                            popupMenu.removeAll();
                                        } else {
                                Severity: Minor
                                Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 hr to fix

                                  Method checkForNonContiguousBlocks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      @Override
                                      public void checkForNonContiguousBlocks(
                                              @Nonnull HashMap<String, List<Set<String>>> blockNamesToTrackNameSetsMap) {
                                          /*
                                          * For each (non-null) blocks of this track do:
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 hr to fix

                                    Method reCalculateTrackSegmentAngle has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected void reCalculateTrackSegmentAngle(double x, double y) {
                                            if (!isBezier()) {
                                                double pt2x;
                                                double pt2y;
                                                double pt1x;
                                    Severity: Minor
                                    Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 hr to fix

                                      Method findHitPointType has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                                      Open

                                          @Override
                                          protected HitPointType findHitPointType(Point2D hitPoint, boolean useRectangles, boolean requireUnconnected) {
                                              HitPointType result = HitPointType.NONE;  // assume point not on connection
                                      
                                              if (!requireUnconnected) {
                                      Severity: Minor
                                      Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.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

                                      Consider simplifying this complex logical expression.
                                      Open

                                              if (hasEC1 || hasEC2) {
                                                  JMenu arrowsMenu = new JMenu(Bundle.getMessage("ArrowsMenuTitle"));
                                                  decorationsMenu.setToolTipText(Bundle.getMessage("ArrowsMenuToolTip"));
                                                  decorationsMenu.add(arrowsMenu);
                                      
                                      
                                      Severity: Critical
                                      Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 1 hr to fix

                                        Method getCentreSeg has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
                                        Open

                                            public Point2D getCentreSeg() {
                                                Point2D result = MathUtil.zeroPoint2D;
                                        
                                                if ((getConnect1() != null) && (getConnect2() != null)) {
                                                    // get the end points
                                        Severity: Minor
                                        Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 55 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 setCircle has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
                                        Open

                                            public void setCircle(boolean boo) {
                                                if (circle != boo) {
                                                    circle = boo;
                                                    if (circle) {
                                                        // if it was a bezier
                                        Severity: Minor
                                        Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 45 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

                                        Consider simplifying this complex logical expression.
                                        Open

                                                    if (hasEB1 && hasEB2) {
                                                        JMenu endBumperEndMenu = new JMenu(Bundle.getMessage("DecorationEndMenuTitle"));
                                                        endBumperEndMenu.setToolTipText(Bundle.getMessage("DecorationEndMenuToolTip"));
                                                        endBumperMenu.add(endBumperEndMenu);
                                        
                                        
                                        Severity: Major
                                        Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 40 mins to fix

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

                                              private void addNumericMenuItem(@Nonnull JMenu menu,
                                                      @Nonnull String titleKey, @Nonnull String toolTipKey,
                                                      @Nonnull Supplier<Integer> val,
                                                      @Nonnull Consumer<Integer> set,
                                                      @CheckForNull Predicate<Integer> predicate) {
                                          Severity: Minor
                                          Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 35 mins to fix

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

                                                private int drawArrow(
                                                        Graphics2D g2,
                                                        Point2D ep,
                                                        double angleRAD,
                                                        boolean dirOut,
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.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

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

                                                public ArrayList<String> getPointReferences(HitPointType type, LayoutTrack conn) {
                                                    ArrayList<String> result = new ArrayList<>();
                                            
                                                    if (type == HitPointType.POS_POINT && conn instanceof PositionablePoint) {
                                                        PositionablePoint pt = (PositionablePoint) conn;
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegment.java on lines 404..508

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

                                            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 (key.equals("bridge")) {
                                                                String bridgeValue = entry.getValue();
                                                                //<decoration name="bridge" value="both;linewidth=2;deckwidth=8" />
                                                                // right/left default true; in/out default false
                                                                boolean hasLeft = true, hasRight = true, hasEntry = false, hasExit = false;
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3157..3207

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

                                            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 (key.equals("tunnel")) {
                                                                String tunnelValue = entry.getValue();
                                                                //<decoration name="tunnel" value="both;linewidth=2;floorwidth=8" />
                                                                // right/left default true; in/out default false
                                                                boolean hasLeft = true, hasRight = true, hasIn = false, hasOut = false;
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3059..3109

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

                                            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 (tunnelSideLeft) {
                                                                p1 = new Point2D.Double(0.0, 0.0);
                                                                p2 = new Point2D.Double(0.0, -halfFloorWidth);
                                                                p3 = new Point2D.Double(0.0, -halfEntranceWidth);
                                                                p4 = new Point2D.Double(-halfEntranceWidth - halfFloorWidth, -halfEntranceWidth);
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2554..2579

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

                                            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 (tunnelSideRight) {
                                                                p1 = new Point2D.Double(0.0, 0.0);
                                                                p2 = new Point2D.Double(0.0, +halfFloorWidth);
                                                                p3 = new Point2D.Double(0.0, +halfEntranceWidth);
                                                                p4 = new Point2D.Double(-halfEntranceWidth - halfFloorWidth, +halfEntranceWidth);
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2580..2605

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

                                            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 (tunnelSideRight) {
                                                                p1 = new Point2D.Double(0.0, 0.0);
                                                                p2 = new Point2D.Double(0.0, +halfFloorWidth);
                                                                p3 = new Point2D.Double(0.0, +halfEntranceWidth);
                                                                p4 = new Point2D.Double(halfEntranceWidth + halfFloorWidth, +halfEntranceWidth);
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2634..2659

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

                                            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 (tunnelSideLeft) {
                                                                p1 = new Point2D.Double(0.0, 0.0);
                                                                p2 = new Point2D.Double(0.0, -halfFloorWidth);
                                                                p3 = new Point2D.Double(0.0, -halfEntranceWidth);
                                                                p4 = new Point2D.Double(halfEntranceWidth + halfFloorWidth, -halfEntranceWidth);
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2608..2633

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

                                            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 (hasEC1 && hasEC2) {
                                                            JMenu arrowsEndMenu = new JMenu(Bundle.getMessage("DecorationEndMenuTitle"));
                                                            arrowsEndMenu.setToolTipText(Bundle.getMessage("DecorationEndMenuToolTip"));
                                                            arrowsMenu.add(arrowsEndMenu);
                                            
                                            
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1071..1111

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

                                            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 (hasEB1 && hasEB2) {
                                                            JMenu endBumperEndMenu = new JMenu(Bundle.getMessage("DecorationEndMenuTitle"));
                                                            endBumperEndMenu.setToolTipText(Bundle.getMessage("DecorationEndMenuToolTip"));
                                                            endBumperMenu.add(endBumperEndMenu);
                                            
                                            
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 804..844

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

                                            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 ((getConnect1() != null) || (getConnect2() != null)) {
                                                        JMenu connectionsMenu = new JMenu(Bundle.getMessage("Connections")); // there is no pane opening (which is what ... implies)
                                                        if (getConnect1() != null) {
                                                            connectionsMenu.add(new AbstractAction(Bundle.getMessage("MakeLabel", "1") + getConnect1().getName()) {
                                                                @Override
                                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 839..872

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

                                            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 (bridgeHasExit) {
                                                            if (bridgeSideRight) {
                                                                p1 = new Point2D.Double(+bridgeApproachWidth, +bridgeApproachWidth + halfWidth);
                                                                p2 = new Point2D.Double(0.0, +halfWidth);
                                                                p1P = MathUtil.add(MathUtil.rotateRAD(p1, stopAngleRAD), ep2);
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2406..2421

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

                                            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 (bridgeHasEntry) {
                                                            if (bridgeSideRight) {
                                                                p1 = new Point2D.Double(-bridgeApproachWidth, +bridgeApproachWidth + halfWidth);
                                                                p2 = new Point2D.Double(0.0, +halfWidth);
                                                                p1P = MathUtil.add(MathUtil.rotateRAD(p1, startAngleRAD), ep1);
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2422..2437

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

                                            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 (isBezier()) {
                                                            Point2D[] points = getBezierPoints();
                                                            if (bridgeSideLeft) {
                                                                MathUtil.drawBezier(g2, points, -halfWidth);
                                                            }
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2511..2534

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

                                            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 (isBezier()) {
                                                            Point2D[] points = getBezierPoints();
                                                            if (tunnelSideRight) {
                                                                MathUtil.drawBezier(g2, points, +halfWidth);
                                                            }
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2374..2398

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

                                            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 (dirOut) {
                                                                p1 = new Point2D.Double(offset, 0.0);
                                                                p2 = new Point2D.Double(offset + (2 * arrowLength), -arrowLength);
                                                                p3 = new Point2D.Double(offset + (3 * arrowLength), 0.0);
                                                                p4 = new Point2D.Double(offset + (2 * arrowLength), +arrowLength);
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2806..2816

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

                                            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 (dirOut) {
                                                                p1 = new Point2D.Double(offset, 0.0);
                                                                p2 = new Point2D.Double(offset + (2 * arrowLength), -arrowLength);
                                                                p3 = new Point2D.Double(offset + (3 * arrowLength), 0.0);
                                                                p4 = new Point2D.Double(offset + (2 * arrowLength), +arrowLength);
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2782..2792

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

                                            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 (dirOut) {
                                                                p1 = new Point2D.Double(offset, -arrowLength);
                                                                p2 = new Point2D.Double(offset + arrowLength, 0.0);
                                                                p3 = new Point2D.Double(offset, +arrowLength);
                                                            } else {
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2706..2714

                                            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

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

                                                            if (dirOut) {
                                                                p1 = new Point2D.Double(offset, -arrowLength);
                                                                p2 = new Point2D.Double(offset + arrowLength, 0.0);
                                                                p3 = new Point2D.Double(offset, +arrowLength);
                                                            } else {
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2755..2763

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

                                                public void setArrowDirIn(boolean newVal) {
                                                    if (arrowDirIn != newVal) {
                                                        arrowDirIn = newVal;
                                                        if (!arrowDirIn && !arrowDirOut) {
                                                            arrowStyle = 0;
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3258..3269
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3276..3287
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3312..3323

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

                                            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

                                                public void setArrowDirOut(boolean newVal) {
                                                    if (arrowDirOut != newVal) {
                                                        arrowDirOut = newVal;
                                                        if (!arrowDirIn && !arrowDirOut) {
                                                            arrowStyle = 0;
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3258..3269
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3276..3287
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3294..3305

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

                                            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

                                                public void setArrowEndStop(boolean newVal) {
                                                    if (arrowEndStop != newVal) {
                                                        arrowEndStop = newVal;
                                                        if (!arrowEndStart && !arrowEndStop) {
                                                            arrowStyle = 0;
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3258..3269
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3294..3305
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3312..3323

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

                                            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

                                                public void setArrowEndStart(boolean newVal) {
                                                    if (arrowEndStart != newVal) {
                                                        arrowEndStart = newVal;
                                                        if (!arrowEndStart && !arrowEndStop) {
                                                            arrowStyle = 0;
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3276..3287
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3294..3305
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3312..3323

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

                                            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 (bumperEndStart) {
                                                            p1P = MathUtil.add(MathUtil.rotateRAD(p1, startAngleRAD), ep1);
                                                            p2P = MathUtil.add(MathUtil.rotateRAD(p2, startAngleRAD), ep1);
                                                            // draw cross tie
                                                            g2.draw(new Line2D.Double(p1P, p2P));
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 50 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2474..2479

                                            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

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

                                                        if (bumperEndStop) {
                                                            p1P = MathUtil.add(MathUtil.rotateRAD(p1, stopAngleRAD), ep2);
                                                            p2P = MathUtil.add(MathUtil.rotateRAD(p2, stopAngleRAD), ep2);
                                                            // draw cross tie
                                                            g2.draw(new Line2D.Double(p1P, p2P));
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 50 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2468..2473

                                            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

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

                                                        if (bridgeHasEntry && !bridgeHasExit) {
                                                            bridgeValues.add("entry");
                                                        } else if (!bridgeHasEntry && bridgeHasExit) {
                                                            bridgeValues.add("exit");
                                                        } else if (bridgeHasEntry && bridgeHasExit) {
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 50 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2958..2964

                                            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

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

                                                        if (tunnelHasEntry && !tunnelHasExit) {
                                                            tunnelValues.add("entry");
                                                        } else if (!tunnelHasEntry && tunnelHasExit) {
                                                            tunnelValues.add("exit");
                                                        } else if (tunnelHasEntry && tunnelHasExit) {
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 50 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2909..2915

                                            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

                                                public void setArc(boolean boo) {
                                                    if (arc != boo) {
                                                        arc = boo;
                                                        if (arc) {
                                                            circle = false;
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 50 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 260..270

                                            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

                                                public void setBezier(boolean bool) {
                                                    if (bezier != bool) {
                                                        bezier = bool;
                                                        if (bezier) {
                                                            arc = false;
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 50 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 168..178

                                            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 (isBezier()) {
                                                        info = info + " (" + Bundle.getMessage("Bezier") + ")";
                                                    } else {
                                                        info = info + " (" + Bundle.getMessage("Line") + ")";
                                                    }
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 665..669

                                            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 (isCircle()) {
                                                            info = info + " (" + Bundle.getMessage("Circle") + ")";
                                                        } else {
                                                            info = info + " (" + Bundle.getMessage("Ellipse") + ")";
                                                        }
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 670..674

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 56.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                            if (tunnelSideRight) {
                                                                Rectangle2D tRectangle2D = MathUtil.inset(cRectangle2D, +halfWidth);
                                                                g2.draw(new Arc2D.Double(tRectangle2D.getX(), tRectangle2D.getY(),
                                                                        tRectangle2D.getWidth(), tRectangle2D.getHeight(),
                                                                        startAngleDEG, extentAngleDEG, Arc2D.OPEN));
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2362..2367
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2368..2373
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2504..2509

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

                                                            if (tunnelSideLeft) {
                                                                Rectangle2D tRectangle2D = MathUtil.inset(cRectangle2D, -halfWidth);
                                                                g2.draw(new Arc2D.Double(tRectangle2D.getX(), tRectangle2D.getY(),
                                                                        tRectangle2D.getWidth(), tRectangle2D.getHeight(),
                                                                        startAngleDEG, extentAngleDEG, Arc2D.OPEN));
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2362..2367
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2368..2373
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2498..2503

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

                                                            if (bridgeSideRight) {
                                                                Rectangle2D tRectangle2D = MathUtil.inset(cRectangle2D, +halfWidth);
                                                                g2.draw(new Arc2D.Double(tRectangle2D.getX(), tRectangle2D.getY(),
                                                                        tRectangle2D.getWidth(), tRectangle2D.getHeight(),
                                                                        startAdj, tmpAngle, Arc2D.OPEN));
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2362..2367
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2498..2503
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2504..2509

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

                                                            if (bridgeSideLeft) {
                                                                Rectangle2D tRectangle2D = MathUtil.inset(cRectangle2D, -halfWidth);
                                                                g2.draw(new Arc2D.Double(tRectangle2D.getX(), tRectangle2D.getY(),
                                                                        tRectangle2D.getWidth(), tRectangle2D.getHeight(),
                                                                        startAdj, tmpAngle, Arc2D.OPEN));
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2368..2373
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2498..2503
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2504..2509

                                            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

                                                        jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                            Color newColor = JmriColorChooser.showDialog(null, "Choose a color", arrowColor);
                                                            if ((newColor != null) && !newColor.equals(arrowColor)) {
                                                                setArrowColor(newColor);
                                                            }
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1023..1028
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1129..1134
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1264..1269

                                            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

                                                    jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                        Color newColor = JmriColorChooser.showDialog(null, "Choose a color", tunnelColor);
                                                        if ((newColor != null) && !newColor.equals(tunnelColor)) {
                                                            setTunnelColor(newColor);
                                                        }
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 888..893
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1023..1028
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1129..1134

                                            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

                                                    jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                        Color newColor = JmriColorChooser.showDialog(null, "Choose a color", bridgeColor);
                                                        if ((newColor != null) && !newColor.equals(bridgeColor)) {
                                                            setBridgeColor(newColor);
                                                        }
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 888..893
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1129..1134
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1264..1269

                                            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

                                                        jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                            Color newColor = JmriColorChooser.showDialog(null, "Choose a color", bumperColor);
                                                            if ((newColor != null) && !newColor.equals(bumperColor)) {
                                                                setBumperColor(newColor);
                                                            }
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 45 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 888..893
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1023..1028
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1264..1269

                                            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 (getType1() == HitPointType.POS_POINT) {
                                                        PositionablePoint pp = (PositionablePoint) getConnect1();
                                                        if (pp.getType() == PositionablePoint.PointType.EDGE_CONNECTOR) {
                                                            hasEC1 = true;
                                                        }
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 35 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 767..772
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1053..1058
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1060..1065

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

                                                    if (getType2() == HitPointType.POS_POINT) {
                                                        PositionablePoint pp = (PositionablePoint) getConnect2();
                                                        if (pp.getType() == PositionablePoint.PointType.EDGE_CONNECTOR) {
                                                            hasEC2 = true;
                                                        }
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 35 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 760..765
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1053..1058
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1060..1065

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

                                                    if (getType2() == HitPointType.POS_POINT) {
                                                        PositionablePoint pp = (PositionablePoint) getConnect2();
                                                        if (pp.getType() == PositionablePoint.PointType.END_BUMPER) {
                                                            hasEB2 = true;
                                                        }
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 35 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 760..765
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 767..772
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1053..1058

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

                                                    if (getType1() == HitPointType.POS_POINT) {
                                                        PositionablePoint pp = (PositionablePoint) getConnect1();
                                                        if (pp.getType() == PositionablePoint.PointType.END_BUMPER) {
                                                            hasEB1 = true;
                                                        }
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 35 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 760..765
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 767..772
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1060..1065

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

                                                public void setTunnelColor(Color newVal) {
                                                    if (tunnelColor != newVal) {
                                                        tunnelColor = newVal;
                                                        JmriColorChooser.addRecentColor(newVal);
                                                        layoutEditor.redrawPanel();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3330..3337
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3438..3445
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3520..3527

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                    if (trackSegment.isMainline()) {
                                                        tieLength = ltdo.getMainTieLength();
                                                        tieWidth = ltdo.getMainTieWidth();
                                                        railWidth = ltdo.getMainRailWidth();
                                                        railGap = ltdo.getMainRailGap();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/SensorTextEdit.java on lines 160..165
                                            java/src/jmri/jmrit/display/SlipTurnoutTextEdit.java on lines 182..187
                                            java/src/jmri/jmrit/operations/trains/TrainManifest.java on lines 334..339

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                public void setArrowLineWidth(int newVal) {
                                                    if (arrowLineWidth != newVal) {
                                                        arrowLineWidth = MathUtil.pin(newVal, 1, MAX_ARROW_LINE_WIDTH);
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3357..3363
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3370..3376
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3534..3540

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                public void setBridgeColor(Color newVal) {
                                                    if (bridgeColor != newVal) {
                                                        bridgeColor = newVal;
                                                        JmriColorChooser.addRecentColor(newVal);
                                                        layoutEditor.redrawPanel();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3330..3337
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3520..3527
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3654..3661

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                public void setBumperLineWidth(int newVal) {
                                                    if (bumperLineWidth != newVal) {
                                                        bumperLineWidth = MathUtil.pin(newVal, 1, MAX_BUMPER_LINE_WIDTH);
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3344..3350
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3357..3363
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3370..3376

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                public void setArrowLength(int newVal) {
                                                    if (arrowLength != newVal) {
                                                        arrowLength = MathUtil.pin(newVal, 2, MAX_ARROW_LENGTH);
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3344..3350
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3370..3376
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3534..3540

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                public void setArrowGap(int newVal) {
                                                    if (arrowGap != newVal) {
                                                        arrowGap = MathUtil.pin(newVal, 0, MAX_ARROW_GAP);
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3344..3350
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3357..3363
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3534..3540

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                public void setArrowColor(Color newVal) {
                                                    if (arrowColor != newVal) {
                                                        arrowColor = newVal;
                                                        JmriColorChooser.addRecentColor(newVal);
                                                        layoutEditor.redrawPanel();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3438..3445
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3520..3527
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3654..3661

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                public void setBumperColor(Color newVal) {
                                                    if (bumperColor != newVal) {
                                                        bumperColor = newVal;
                                                        JmriColorChooser.addRecentColor(newVal);
                                                        layoutEditor.redrawPanel();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 3 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3330..3337
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3438..3445
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3654..3661

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                        jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                            // prompt for arrow line width
                                                            int newValue = QuickPromptUtil.promptForInt(layoutEditor,
                                                                    Bundle.getMessage("DecorationLineWidthMenuItemTitle"),
                                                                    Bundle.getMessage("DecorationLineWidthMenuItemTitle"),
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 2 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 912..919
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 924..931

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                        jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                            // prompt for arrow length
                                                            int newValue = QuickPromptUtil.promptForInt(layoutEditor,
                                                                    Bundle.getMessage("DecorationLengthMenuItemTitle"),
                                                                    Bundle.getMessage("DecorationLengthMenuItemTitle"),
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 2 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 900..907
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 924..931

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                        jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                            // prompt for arrow gap
                                                            int newValue = QuickPromptUtil.promptForInt(layoutEditor,
                                                                    Bundle.getMessage("DecorationGapMenuItemTitle"),
                                                                    Bundle.getMessage("DecorationGapMenuItemTitle"),
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 2 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 900..907
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 912..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 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                        } else {
                                                            pt1x = getTmpPt1().getX();
                                                            pt1y = getTmpPt1().getY();
                                                            pt2x = getTmpPt2().getX();
                                                            pt2y = getTmpPt2().getY();
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2031..2036

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                        if (isFlip()) {
                                                            pt1x = getTmpPt2().getX();
                                                            pt1y = getTmpPt2().getY();
                                                            pt2x = getTmpPt1().getX();
                                                            pt2y = getTmpPt1().getY();
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 2036..2041

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                                if ((getType2() == HitPointType.POS_POINT) && (((PositionablePoint) getConnect2()).getType() == PositionablePoint.PointType.END_BUMPER)) {
                                                                    setBumperEndStop(enableCheckBoxMenuItem.isSelected());
                                                                }
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1117..1119

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                                if ((getType1() == HitPointType.POS_POINT) && (((PositionablePoint) getConnect1()).getType() == PositionablePoint.PointType.END_BUMPER)) {
                                                                    setBumperEndStart(enableCheckBoxMenuItem.isSelected());
                                                                }
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 1 other location - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1120..1122

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 42.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                public void setBridgeLineWidth(int newVal) {
                                                    if (bridgeLineWidth != newVal) {
                                                        bridgeLineWidth = Math.max(MIN_BRIDGE_LINE_WIDTH, newVal);   // don't let value be less than MIN
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 6 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3452..3458
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3478..3484
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3548..3554
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3668..3674
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3681..3687
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3694..3700

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

                                                public void setTunnelEntranceWidth(int newVal) {
                                                    if (tunnelEntranceWidth != newVal) {
                                                        tunnelEntranceWidth = Math.max(MIN_TUNNEL_ENTRANCE_WIDTH, newVal);   // don't let value be less than 1
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 6 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3452..3458
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3465..3471
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3478..3484
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3548..3554
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3668..3674
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3681..3687

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

                                                public void setBumperLength(int newVal) {
                                                    if (bumperLength != newVal) {
                                                        bumperLength = Math.max(MIN_BUMPER_LENGTH, newVal);   // don't let value be less than MIN
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 6 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3452..3458
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3465..3471
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3478..3484
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3668..3674
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3681..3687
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3694..3700

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

                                                public void setTunnelLineWidth(int newVal) {
                                                    if (tunnelLineWidth != newVal) {
                                                        tunnelLineWidth = Math.max(MIN_TUNNEL_LINE_WIDTH, newVal);   // don't let value be less than MIN
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 6 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3452..3458
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3465..3471
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3478..3484
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3548..3554
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3668..3674
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3694..3700

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

                                                public void setTunnelFloorWidth(int newVal) {
                                                    if (tunnelFloorWidth != newVal) {
                                                        tunnelFloorWidth = Math.max(MIN_TUNNEL_FLOOR_WIDTH, newVal);   // don't let value be less than MIN
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 6 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3452..3458
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3465..3471
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3478..3484
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3548..3554
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3681..3687
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3694..3700

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

                                                public void setBridgeDeckWidth(int newVal) {
                                                    if (bridgeDeckWidth != newVal) {
                                                        bridgeDeckWidth = Math.max(MIN_BRIDGE_DECK_WIDTH, newVal);   // don't let value be less than MIN
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 6 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3465..3471
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3478..3484
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3548..3554
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3668..3674
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3681..3687
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3694..3700

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

                                                public void setBridgeApproachWidth(int newVal) {
                                                    if (bridgeApproachWidth != newVal) {
                                                        bridgeApproachWidth = Math.max(MIN_BRIDGE_APPROACH_WIDTH, newVal);   // don't let value be less than MIN
                                                        layoutEditor.redrawPanel();
                                                        layoutEditor.setDirty();
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 6 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3452..3458
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3465..3471
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3548..3554
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3668..3674
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3681..3687
                                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 3694..3700

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

                                                    if ((!getBlockName().isEmpty()) && (jmri.InstanceManager.getDefault(LayoutBlockManager.class).isAdvancedRoutingEnabled())) {
                                                        popupMenu.add(new AbstractAction(Bundle.getMessage("ViewBlockRouting")) {
                                                            @Override
                                                            public void actionPerformed(ActionEvent e) {
                                                                AbstractAction routeTableAction = new LayoutBlockRouteTableAction("ViewRouting", getLayoutBlock());
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java and 4 other locations - About 30 mins to fix
                                            java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 626..634
                                            java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1866..1874
                                            java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 828..836
                                            java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 820..828

                                            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