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

Summary

Maintainability
F
1 mo
Test Coverage
F
45%

File LayoutTurnoutView.java has 2474 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.display.layoutEditor;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
Severity: Major
Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 6 days to fix

    Method draw1 has a Cognitive Complexity of 297 (exceeds 20 allowed). Consider refactoring.
    Open

        @Override
        protected void draw1(Graphics2D g2, boolean isMain, boolean isBlock) {
            if (isBlock && getLayoutBlock() == null) {
                // Skip the block layer if there is no block assigned.
                return;
    Severity: Minor
    Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 5 days to fix

    Cognitive Complexity

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

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

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

    Further reading

    LayoutTurnoutView has 180 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class LayoutTurnoutView extends LayoutTrackView {
    
        public LayoutTurnoutView(@Nonnull LayoutTurnout turnout,
                @Nonnull Point2D c, double rot,
                @Nonnull LayoutEditor layoutEditor) {
    Severity: Major
    Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 3 days to fix

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

          @Override
          protected void draw2(Graphics2D g2, boolean isMain, float railDisplacement) {
              TurnoutType type = getTurnoutType();
      
              Point2D pA = getCoordsA();
      Severity: Major
      Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 2 days to fix

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

            @Override
            @Nonnull
            protected JPopupMenu showPopup(@Nonnull JmriMouseEvent mouseEvent) {
                if (popup != null) {
                    popup.removeAll();
        Severity: Minor
        Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.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 draw2 has a Cognitive Complexity of 96 (exceeds 20 allowed). Consider refactoring.
        Open

            @Override
            protected void draw2(Graphics2D g2, boolean isMain, float railDisplacement) {
                TurnoutType type = getTurnoutType();
        
                Point2D pA = getCoordsA();
        Severity: Minor
        Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.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 showPopup has 318 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method draw1 has 311 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              protected void draw1(Graphics2D g2, boolean isMain, boolean isBlock) {
                  if (isBlock && getLayoutBlock() == null) {
                      // Skip the block layer if there is no block assigned.
                      return;
          Severity: Major
          Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 1 day to fix

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

                void setTrackSegmentBlock(HitPointType pointType, boolean isAutomatic) {
                    TrackSegment trkSeg;
                    Point2D pointCoord;
                    LayoutBlock blockA = getLayoutBlock();
                    LayoutBlock blockB = getLayoutBlock();
            Severity: Minor
            Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 6 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

            Method setTrackSegmentBlock has 110 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                void setTrackSegmentBlock(HitPointType pointType, boolean isAutomatic) {
                    TrackSegment trkSeg;
                    Point2D pointCoord;
                    LayoutBlock blockA = getLayoutBlock();
                    LayoutBlock blockB = getLayoutBlock();
            Severity: Major
            Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 4 hrs to fix

              Method setUpDefaultSize has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected void setUpDefaultSize() {
                      // remove the overall scale factor
                      double bX = dispB.getX() / layoutEditor.gContext.getXScale();
                      double bY = dispB.getY() / layoutEditor.gContext.getYScale();
                      double cX = dispA.getX() / layoutEditor.gContext.getXScale();
              Severity: Major
              Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 3 hrs to fix

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

                    @Override
                    protected HitPointType findHitPointType(@Nonnull Point2D hitPoint, boolean useRectangles, boolean requireUnconnected) {
                        HitPointType result = HitPointType.NONE;  // assume point not on connection
                        // note: optimization here: instead of creating rectangles for all the
                        // points to check below, we create a rectangle for the test point
                Severity: Major
                Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 2 hrs to fix

                  Method setCoordsA has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public void setCoordsA(@Nonnull Point2D p) {
                          pointA = p;
                          if (version == 2) {
                              reCalculateCenter();
                          }
                  Severity: Minor
                  Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 1 hr to fix

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

                        @Override
                        protected void drawEditControls(Graphics2D g2) {
                            Point2D pt = getCoordsA();
                            if (isTurnoutTypeXover() || isTurnoutTypeSlip()) {
                                if (getConnectA() == null) {
                    Severity: Minor
                    Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 1 hr to fix

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

                          public void setCoordsC(Point2D p) {
                              pointC = p;
                              if (version == 2) {
                                  reCalculateCenter();
                              }
                      Severity: Minor
                      Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 1 hr to fix

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

                            public void setCoordsB(Point2D p) {
                                pointB = p;
                                double x = getCoordsCenter().getX() - p.getX();
                                double y = getCoordsCenter().getY() - p.getY();
                                dispB = new Point2D.Double(-x, -y);
                        Severity: Minor
                        Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 1 hr to fix

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

                              @Override
                              protected HitPointType findHitPointType(@Nonnull Point2D hitPoint, boolean useRectangles, boolean requireUnconnected) {
                                  HitPointType result = HitPointType.NONE;  // assume point not on connection
                                  // note: optimization here: instead of creating rectangles for all the
                                  // points to check below, we create a rectangle for the test point
                          Severity: Minor
                          Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.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 setCoordsD has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public void setCoordsD(Point2D p) {
                                  pointD = p;
                          
                                  // only used for crossovers
                                  double x = getCoordsCenter().getX() - p.getX();
                          Severity: Minor
                          Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 1 hr to fix

                            Avoid too many return statements within this method.
                            Open

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

                              Avoid too many return statements within this method.
                              Open

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

                                Avoid too many return statements within this method.
                                Open

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

                                  Avoid too many return statements within this method.
                                  Open

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

                                    Avoid too many return statements within this method.
                                    Open

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

                                      Avoid too many return statements within this method.
                                      Open

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

                                        Avoid too many return statements within this method.
                                        Open

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

                                          Avoid too many return statements within this method.
                                          Open

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

                                            Avoid too many return statements within this method.
                                            Open

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

                                              Avoid too many return statements within this method.
                                              Open

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

                                                Avoid too many return statements within this method.
                                                Open

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

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

                                                              if ((getConnectA() != null) || (getConnectB() != null)
                                                                      || (getConnectC() != null) || (getConnectD() != null)) {
                                                                  JMenu connectionsMenu = new JMenu(Bundle.getMessage("Connections")); // there is no pane opening (which is what ... implies)
                                                                  if (getConnectA() != null) {
                                                                      connectionsMenu.add(new AbstractAction(Bundle.getMessage("MakeLabel", "A") + getConnectA().getName()) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 428..492
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 705..769

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

                                                  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 (state == INCONSISTENT) {
                                                                  if (isMain == mainlineA) {
                                                                      g2.setColor(colorA);
                                                                      g2.draw(new Line2D.Double(pA, pAM));
                                                                  }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2154..2192

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 278.

                                                  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 (state != Turnout.THROWN && state != INCONSISTENT) { // unknown or continuing path - not crossed over
                                                                  if (isMain == mainlineA) {
                                                                      g2.setColor(colorA);
                                                                      g2.draw(new Line2D.Double(pA, pABM));
                                                                  }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2242..2280

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

                                                  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 (isMain == mainlineD) {
                                                                      g2.draw(new Line2D.Double(pCDR, pDR));
                                                                      g2.draw(new Line2D.Double(pKRtA, pVRtC));
                                                                      g2.draw(new Line2D.Double(pDFR, pCDL));
                                                                      g2.draw(new Line2D.Double(pDFR, pKR));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2633..2657
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2658..2682
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2683..2707

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

                                                  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 (isMain == mainlineB) {
                                                                      g2.draw(new Line2D.Double(pABL, pBL));
                                                                      g2.draw(new Line2D.Double(pKLtC, pVLtA));
                                                                      g2.draw(new Line2D.Double(pBFL, pABR));
                                                                      g2.draw(new Line2D.Double(pBFL, pKL));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2633..2657
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2683..2707
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2708..2732

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

                                                  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 (isMain == mainlineA) {
                                                                      g2.draw(new Line2D.Double(pAL, pABL));
                                                                      g2.draw(new Line2D.Double(pVRtB, pKLtD));
                                                                      g2.draw(new Line2D.Double(pAFL, pABR));
                                                                      g2.draw(new Line2D.Double(pAFL, pKL));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2658..2682
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2683..2707
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2708..2732

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

                                                  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 (isMain == mainlineC) {
                                                                      g2.draw(new Line2D.Double(pCR, pCDR));
                                                                      g2.draw(new Line2D.Double(pKRtB, pVLtD));
                                                                      g2.draw(new Line2D.Double(pCFR, pCDL));
                                                                      g2.draw(new Line2D.Double(pCFR, pKR));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2633..2657
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2658..2682
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2708..2732

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

                                                  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 (isMain == mainlineA) {
                                                                      g2.draw(new Line2D.Double(pAL, pABL));
                                                                      GeneralPath path = new GeneralPath();
                                                                      path.moveTo(pAR.getX(), pAR.getY());
                                                                      path.lineTo(pAPR.getX(), pAPR.getY());
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2831..2853
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2933..2955
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2960..2982

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

                                                  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 (isMain == mainlineD) {
                                                                      g2.draw(new Line2D.Double(pDR, pDCR));
                                                                      GeneralPath path = new GeneralPath();
                                                                      path.moveTo(pDL.getX(), pDL.getY());
                                                                      path.lineTo(pDPL.getX(), pDPL.getY());
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2804..2826
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2831..2853
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2933..2955

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

                                                  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 (isMain == mainlineB) {
                                                                      g2.draw(new Line2D.Double(pBL, pBAL));
                                                                      GeneralPath path = new GeneralPath();
                                                                      path.moveTo(pBR.getX(), pBR.getY());
                                                                      path.lineTo(pBPR.getX(), pBPR.getY());
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2804..2826
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2831..2853
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2960..2982

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

                                                  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 (isMain == mainlineC) {
                                                                      g2.draw(new Line2D.Double(pCR, pCDR));
                                                                      GeneralPath path = new GeneralPath();
                                                                      path.moveTo(pCL.getX(), pCL.getY());
                                                                      path.lineTo(pCPL.getX(), pCPL.getY());
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2804..2826
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2933..2955
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2960..2982

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

                                                  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

                                                                  rotateItem.addActionListener((ActionEvent event) -> {
                                                                      boolean entering = true;
                                                                      boolean error = false;
                                                                      String newAngle = "";
                                                                      while (entering) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 541..572

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 206.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  if (isMain == mainlineB) {
                                                                      g2.draw(new Line2D.Double(pF, pBL));
                                                                      GeneralPath path = new GeneralPath();
                                                                      path.moveTo(pAPR.getX(), pAPR.getY());
                                                                      path.quadTo(pMR.getX(), pMR.getY(), pFR.getX(), pFR.getY());
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2440..2458

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 150.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  if (isMain == mainlineC) {
                                                                      g2.draw(new Line2D.Double(pF, pCR));
                                                                      GeneralPath path = new GeneralPath();
                                                                      path.moveTo(pAPL.getX(), pAPL.getY());
                                                                      path.quadTo(pML.getX(), pML.getY(), pFL.getX(), pFL.getY());
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2467..2485

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 150.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (getTurnoutType() == TurnoutType.RH_XOVER) {
                                                                  x = xi - (0.333333 * (-x - xi));
                                                                  y = yi - (0.333333 * (-y - yi));
                                                              } else if (getTurnoutType() == TurnoutType.LH_XOVER) {
                                                                  x = xi - (3.0 * (-x - xi));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1269..1275
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1406..1412

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (getTurnoutType() == TurnoutType.RH_XOVER) {
                                                                  x = xi - (0.333333 * (-x - xi));
                                                                  y = yi - (0.333333 * (-y - yi));
                                                              } else if (getTurnoutType() == TurnoutType.LH_XOVER) {
                                                                  x = xi - (3.0 * (-x - xi));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1370..1376
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1406..1412

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (getTurnoutType() == TurnoutType.LH_XOVER) {
                                                                  x = xi - (0.333333 * (-x - xi));
                                                                  y = yi - (0.333333 * (-y - yi));
                                                              } else if (getTurnoutType() == TurnoutType.RH_XOVER) {
                                                                  x = xi - (3.0 * (-x - xi));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1269..1275
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1370..1376

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

                                                  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 (!isBlock || drawUnselectedLeg) {
                                                                      if (isMain == mainlineA) {
                                                                          g2.setColor(colorA);
                                                                          g2.draw(new Line2D.Double(pAF, pM));
                                                                      }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 850..867

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 122.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              } else if (getTurnoutType() == TurnoutType.RH_XOVER) {
                                                                  double distDC = Math.hypot(bX + cX, bY + cY);
                                                                  layoutEditor.setXOverShort(Math.round((0.25 * distDC) + 0.1));
                                                                  layoutEditor.setXOverLong(Math.round((0.75 * distDC) + 0.1));
                                                                  double hwid = Math.sqrt((lenC * lenC) - (0.5625 * distDC * distDC));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 917..923

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

                                                  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 (getTurnoutType() == TurnoutType.LH_XOVER) {
                                                                  double distDC = Math.hypot(bX + cX, bY + cY);
                                                                  layoutEditor.setXOverShort(Math.round((0.25 * distDC) + 0.1));
                                                                  layoutEditor.setXOverLong(Math.round((0.75 * distDC) + 0.1));
                                                                  double hwid = Math.sqrt((lenC * lenC) - (0.0625 * distDC * distDC));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 911..917

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

                                                  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 ((dispB.getX() + x) != 0.0) {
                                                                  a = (dispB.getY() + y) / (dispB.getX() + x);
                                                                  b = -y + (a * x);
                                                                  xi = -b / (a + (1.0 / a));
                                                                  yi = (a * xi) + b;
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1400..1405

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 110.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if ((dispA.getX() + x) != 0.0) {
                                                                  a = (dispA.getY() + y) / (dispA.getX() + x);
                                                                  b = -y + (a * x);
                                                                  xi = -b / (a + (1.0 / a));
                                                                  yi = (a * xi) + b;
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1263..1268

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 110.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (state == UNKNOWN || (getContinuingSense() == state && state != INCONSISTENT)) { // unknown or continuing path
                                                                  // draw center<===>B
                                                                  if (isMain == mainlineB) {
                                                                      g2.setColor(colorB);
                                                                      g2.draw(new Line2D.Double(pM, pB));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2304..2316

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 106.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (state == UNKNOWN || (getContinuingSense() != state && state != INCONSISTENT)) { // unknown or diverting path
                                                                  // draw center<===>C
                                                                  if (isMain == mainlineC) {
                                                                      g2.setColor(colorC);
                                                                      g2.draw(new Line2D.Double(pM, pC));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2290..2302

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 106.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              case SLIP_C:
                                                                  if (signalC1HeadNamed != null) {
                                                                      return;
                                                                  }
                                                                  if (signalC2HeadNamed != null) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1036..1054
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1076..1094

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              case SLIP_D:
                                                                  if (signalD1HeadNamed != null) {
                                                                      return;
                                                                  }
                                                                  if (signalD2HeadNamed != null) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1036..1054
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1056..1074

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              case SLIP_B:
                                                                  if (signalB1HeadNamed != null) {
                                                                      return;
                                                                  }
                                                                  if (signalB2HeadNamed != null) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1056..1074
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1076..1094

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                      @Override
                                                      @Nonnull
                                                      public Point2D getCoordsForConnectionType(HitPointType connectionType) {
                                                          Point2D result = getCoordsCenter();
                                                          switch (connectionType) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 312..335

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

                                                  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

                                                              if (getTurnout() == null) {
                                                                  jmi = popup.add(Bundle.getMessage("NoTurnout"));
                                                              } else {
                                                                  String stateString = getTurnoutStateString(getTurnout().getKnownState());
                                                                  stateString = String.format(" (%s)", stateString);
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 384..390
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 393..399

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

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

                                                          if (!requireUnconnected || (getConnectA() == null)) {
                                                              p = getCoordsA();
                                                              distance = MathUtil.distance(p, hitPoint);
                                                              if (distance < minDistance) {
                                                                  minDistance = distance;
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1181..1189
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1192..1200
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1204..1212
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 547..555
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 558..566
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 569..577
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 580..588

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

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

                                                          if (!requireUnconnected || (getConnectB() == null)) {
                                                              p = getCoordsB();
                                                              distance = MathUtil.distance(p, hitPoint);
                                                              if (distance < minDistance) {
                                                                  minDistance = distance;
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1170..1178
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1192..1200
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1204..1212
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 547..555
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 558..566
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 569..577
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 580..588

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

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

                                                              if (!requireUnconnected || (getConnectD() == null)) {
                                                                  p = getCoordsD();
                                                                  distance = MathUtil.distance(p, hitPoint);
                                                                  if (distance < minDistance) {
                                                                      minDistance = distance;
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1170..1178
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1181..1189
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1192..1200
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 547..555
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 558..566
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 569..577
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 580..588

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

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

                                                          if (!requireUnconnected || (getConnectC() == null)) {
                                                              p = getCoordsC();
                                                              distance = MathUtil.distance(p, hitPoint);
                                                              if (distance < minDistance) {
                                                                  minDistance = distance;
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1170..1178
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1181..1189
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1204..1212
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 547..555
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 558..566
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 569..577
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 580..588

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

                                                  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 (isMain == mainlineD) {
                                                                      g2.setColor(colorD);
                                                                      g2.draw(new Line2D.Double(pD, pDM));
                                                                      g2.draw(new Line2D.Double(pDM, pM));
                                                                      if (!isBlock || drawUnselectedLeg) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2079..2086
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2087..2094
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2095..2102

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

                                                  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 (isMain == mainlineB) {
                                                                      g2.setColor(colorB);
                                                                      g2.draw(new Line2D.Double(pB, pBM));
                                                                      g2.draw(new Line2D.Double(pBM, pM));
                                                                      if (!isBlock || drawUnselectedLeg) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2079..2086
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2095..2102
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2103..2110

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 66.

                                                  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 (isMain == mainlineA) {
                                                                      g2.setColor(colorA);
                                                                      g2.draw(new Line2D.Double(pA, pAM));
                                                                      g2.draw(new Line2D.Double(pAM, pM));
                                                                      if (!isBlock || drawUnselectedLeg) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2087..2094
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2095..2102
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2103..2110

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 66.

                                                  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 (isMain == mainlineC) {
                                                                      g2.setColor(colorC);
                                                                      g2.draw(new Line2D.Double(pC, pCM));
                                                                      g2.draw(new Line2D.Double(pCM, pM));
                                                                      if (!isBlock || drawUnselectedLeg) {
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2079..2086
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2087..2094
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2103..2110

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 66.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                          if (!requireUnconnected) {
                                                              p = getCoordsCenter();
                                                              distance = MathUtil.distance(p, hitPoint);
                                                              if (distance < minDistance) {
                                                                  minDistance = distance;
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurntableView.java on lines 533..542
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 536..544

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

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

                                                                      if ((getLayoutBlockC() != null) && (getLayoutBlockC() != getLayoutBlock())) {
                                                                          jmi = popup.add(Bundle.getMessage("MakeLabel", Bundle.getMessage("Block_ID", "C")) + getLayoutBlockC().getDisplayName());
                                                                          jmi.setEnabled(false);
                                                                      }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 413..416
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 417..420
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 421..424
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1609..1612
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1617..1620

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 60.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                      if ((getLayoutBlockB() != null) && (getLayoutBlockB() != getLayoutBlock())) {
                                                                          jmi = popup.add(Bundle.getMessage("MakeLabel", Bundle.getMessage("Block_ID", "B")) + getLayoutBlockB().getDisplayName());
                                                                          jmi.setEnabled(false);
                                                                      }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 413..416
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 417..420
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 421..424
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1613..1616
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1617..1620

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 60.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                      if ((getLayoutBlockD() != null) && (getLayoutBlockD() != getLayoutBlock())) {
                                                                          jmi = popup.add(Bundle.getMessage("MakeLabel", Bundle.getMessage("Block_ID", "D")) + getLayoutBlockD().getDisplayName());
                                                                          jmi.setEnabled(false);
                                                                      }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 413..416
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 417..420
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 421..424
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1609..1612
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1613..1616

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 60.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  if (isMain == mainlineB) {
                                                                      g2.draw(new Line2D.Double(pMR, pBR));
                                                                      g2.draw(new Line2D.Double(pF, pBL));
                                                                      if (getContinuingSense() == state) {  // straight path
                                                  //                         g2.draw(new Line2D.Double(pSL, pFPL));  Offset problem
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java and 1 other location - About 45 mins to fix
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2394..2402

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 56.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  if (isMain == mainlineB) {
                                                                      g2.draw(new Line2D.Double(pML, pBL));
                                                                      g2.draw(new Line2D.Double(pF, pBR));
                                                                      if (getContinuingSense() == state) {  // unknown or diverting path
                                                  //                         g2.draw(new Line2D.Double(pSR, pFPR));
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java and 1 other location - About 45 mins to fix
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2431..2439

                                                  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 (isMain == mainlineC) {
                                                                      g2.setColor(colorC);
                                                                      g2.draw(new Line2D.Double(pC, pCDM));
                                                                      if (!isBlock || drawUnselectedLeg) {
                                                                          g2.draw(new Line2D.Double(pCF, pM));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2049..2055
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2056..2062
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2070..2076

                                                  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 (isMain == mainlineA) {
                                                                      g2.setColor(colorA);
                                                                      g2.draw(new Line2D.Double(pA, pABM));
                                                                      if (!isBlock || drawUnselectedLeg) {
                                                                          g2.draw(new Line2D.Double(pAF, pM));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2056..2062
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2063..2069
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2070..2076

                                                  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 (isMain == mainlineD) {
                                                                      g2.setColor(colorD);
                                                                      g2.draw(new Line2D.Double(pD, pCDM));
                                                                      if (!isBlock || drawUnselectedLeg) {
                                                                          g2.draw(new Line2D.Double(pDF, pM));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2049..2055
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2056..2062
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2063..2069

                                                  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 (isMain == mainlineB) {
                                                                      g2.setColor(colorB);
                                                                      g2.draw(new Line2D.Double(pB, pABM));
                                                                      if (!isBlock || drawUnselectedLeg) {
                                                                          g2.draw(new Line2D.Double(pBF, pM));
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2049..2055
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2063..2069
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2070..2076

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 54.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              } else if (getTurnoutType() == TurnoutType.RH_XOVER) {
                                                                  x = xi - (3.0 * (x - xi));
                                                                  y = yi - (3.0 * (y - yi));
                                                              }
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java and 1 other location - About 40 mins to fix
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1326..1329

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 50.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (getTurnoutType() == TurnoutType.LH_XOVER) {
                                                                  x = xi - (0.333333 * (x - xi));
                                                                  y = yi - (0.333333 * (y - yi));
                                                              } else if (getTurnoutType() == TurnoutType.RH_XOVER) {
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java and 1 other location - About 40 mins to fix
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1329..1332

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 50.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                          if ((useRectangles && !r.contains(minPoint))
                                                                  || (!useRectangles && (minDistance > circleRadius))) {
                                                              result = HitPointType.NONE;
                                                          }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurntableView.java on lines 555..558
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 589..592
                                                  java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1610..1613

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 46.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  || (getTurnoutType() == TurnoutType.WYE_TURNOUT)) {
                                                              // adjust to maintain rectangle or wye shape
                                                              double oldLength = MathUtil.length(dispB);
                                                              double newLength = Math.hypot(x, y);
                                                              dispB = MathUtil.multiply(dispB, newLength / oldLength);
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1302..1307
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1388..1393

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 46.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  || (getTurnoutType() == TurnoutType.WYE_TURNOUT)) {
                                                              // adjust to maintain rectangle or wye shape
                                                              double oldLength = MathUtil.length(dispA);
                                                              double newLength = Math.hypot(x, y);
                                                              dispA = MathUtil.multiply(dispA, newLength / oldLength);
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1346..1351
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1388..1393

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 46.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                          if (getTurnoutType() == TurnoutType.DOUBLE_XOVER) {
                                                              // adjust to maintain rectangle
                                                              double oldLength = MathUtil.length(dispA);
                                                              double newLength = Math.hypot(x, y);
                                                              dispA = MathUtil.multiply(dispA, newLength / oldLength);
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1302..1307
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 1346..1351

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 46.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                      popup.add(new AbstractAction(Bundle.getMessage("SetSensors")) {
                                                                          @Override
                                                                          public void actionPerformed(ActionEvent e) {
                                                                              LayoutEditorToolBarPanel letbp = getLayoutEditorToolBarPanel();
                                                                              layoutEditor.getLETools().setSensorsAtTurnoutFromMenu(
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java and 1 other location - About 35 mins to fix
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 874..883

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 46.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              popup.add(new AbstractAction(Bundle.getMessage("ButtonDelete")) {
                                                                  @Override
                                                                  public void actionPerformed(ActionEvent e) {
                                                                      if (canRemove() && removeInlineLogixNG()
                                                                              && layoutEditor.removeLayoutTurnout(turnout)) {
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java and 1 other location - About 35 mins to fix
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 526..536

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 44.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                      if (!isBlock || drawUnselectedLeg) {
                                                                          if (isMain == mainlineA) {
                                                                              g2.setColor(colorA);
                                                                              g2.draw(new Line2D.Double(pA, pAM));
                                                                          }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2229..2234
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2200..2205
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2211..2216

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 42.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                      if (!isBlock || drawUnselectedLeg) {
                                                                          if (isMain == mainlineC) {
                                                                              g2.setColor(colorC);
                                                                              g2.draw(new Line2D.Double(pC, pCM));
                                                                          }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2218..2223
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2200..2205
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2211..2216

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 42.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                      if (!isBlock || drawUnselectedLeg) {
                                                                          if (isMain == mainlineB) {
                                                                              g2.setColor(colorB);
                                                                              g2.draw(new Line2D.Double(pBM, pB));
                                                                          }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2218..2223
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2229..2234
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2211..2216

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 42.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                      if (!isBlock || drawUnselectedLeg) {
                                                                          if (isMain == mainlineD) {
                                                                              g2.setColor(colorD);
                                                                              g2.draw(new Line2D.Double(pDM, pD));
                                                                          }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2218..2223
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2229..2234
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java on lines 2200..2205

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 42.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  for (int i = 0; i < 4; i++) {
                                                                      if (boundaryBetween[i] != null) {
                                                                          blockBoundaries = true;
                                                  
                                                                      }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 599..603
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 858..862

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 42.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                          } else if (!viewAdditionalMenu.isEmpty()) {
                                                              setAdditionalViewPopUpMenu(popup);
                                                              addCommonPopupItems(mouseEvent, popup);
                                                              popup.show(mouseEvent.getComponent(), mouseEvent.getX(), mouseEvent.getY());
                                                          }
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 640..644
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 889..893

                                                  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

                                                              double tan = Math.sqrt(((temX * temX) + (temY * temY))
                                                                      / ((temXx * temXx) + (temYy * temYy)));
                                                  java/src/jmri/implementation/DefaultConditional.java on lines 552..553
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutBlock.java on lines 846..847

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

                                                                          if (map.size() == 1) {
                                                                              popup.add(new AbstractAction(Bundle.getMessage("ViewBlockRouting")) {
                                                                                  @Override
                                                                                  public void actionPerformed(ActionEvent e) {
                                                                                      AbstractAction routeTableAction = new LayoutBlockRouteTableAction("ViewRouting", getLayoutBlock());
                                                  java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 626..634
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 828..836
                                                  java/src/jmri/jmrit/display/layoutEditor/LevelXingView.java on lines 820..828
                                                  java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 1364..1372

                                                  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