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

Summary

Maintainability
F
2 wks
Test Coverage
F
7%

File PositionablePointView.java has 1551 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.display.layoutEditor;

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.Point2D;
Severity: Major
Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 4 days to fix

    Method showPopup has 486 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/PositionablePointView.java - About 2 days to fix

      PositionablePointView has 94 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class PositionablePointView extends LayoutTrackView {
      
          protected NamedBeanHandle<SignalHead> signalEastHeadNamed = null; // signal head for east (south) bound trains
          protected NamedBeanHandle<SignalHead> signalWestHeadNamed = null; // signal head for west (north) bound trains
      
      
      Severity: Major
      Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 1 day to fix

        Method showPopup has a Cognitive Complexity of 71 (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/PositionablePointView.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 checkForNonContiguousBlocks has a Cognitive Complexity of 52 (exceeds 20 allowed). Consider refactoring.
        Open

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

        Cognitive Complexity

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

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

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

        Further reading

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

            @Override
            public void collectContiguousTracksNamesInBlockNamed(@Nonnull String blockName,
                    @Nonnull Set<String> TrackNameSet) {
                if (!TrackNameSet.contains(getName())) {
                    TrackSegment ts1 = getConnect1();
        Severity: Minor
        Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 2 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

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

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

              public boolean replaceTrackConnection(@CheckForNull TrackSegment oldTrack, @CheckForNull TrackSegment newTrack) {
                  boolean result = false; // assume failure (pessimist!)
                  // trying to replace old track with null?
                  if (newTrack == null) {
                      // (yes) remove old connection
          Severity: Minor
          Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

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

              Method canRemove has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Override
                  public boolean canRemove() {
                      List<String> itemList = new ArrayList<>();
                      // A has two track segments, EB has one, EC has one plus optional link
              
              
              Severity: Minor
              Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 1 hr to fix

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

                    public void updateLink() {
                        if (editorCombo.getSelectedIndex() == 0 || linkPointsBox.getSelectedIndex() == -1) {
                            if (getLinkedPoint() != null && getConnect2() != null) {
                                String removeremote = null;
                                String removelocal = null;
                Severity: Minor
                Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 1 hr to fix

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

                      public void setEastBoundSignalMast(String signalMast) {
                          SignalMast mast = null;
                          if (signalMast != null && !signalMast.isEmpty()) {
                              mast = InstanceManager.getDefault(jmri.SignalMastManager.class).getSignalMast(signalMast);
                              if (mast == null) {
                  Severity: Minor
                  Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 1 hr to fix

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

                        public void setWestBoundSignalMast(String signalMast) {
                            SignalMast mast = null;
                            if (signalMast != null && !signalMast.isEmpty()) {
                                mast = InstanceManager.getDefault(jmri.SignalMastManager.class).getSignalMast(signalMast);
                                if (mast == null) {
                    Severity: Minor
                    Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 1 hr to fix

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

                          @Override
                          public void collectContiguousTracksNamesInBlockNamed(@Nonnull String blockName,
                                  @Nonnull Set<String> TrackNameSet) {
                              if (!TrackNameSet.contains(getName())) {
                                  TrackSegment ts1 = getConnect1();
                      Severity: Minor
                      Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 1 hr to fix

                        Method updatePointBox has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            void updatePointBox() {
                                linkPointsBox.removeAllItems();
                                pointList = new ArrayList<>();
                                if (editorCombo.getSelectedIndex() == 0) {
                                    linkPointsBox.setEnabled(false);
                        Severity: Minor
                        Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 1 hr to fix

                          Method reCheckBlockBoundary has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @Override
                              public void reCheckBlockBoundary() {
                                  if (getType() == PointType.END_BUMPER) {
                                      return;
                                  }
                          Severity: Minor
                          Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 1 hr to fix

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

                                void updatePointBox() {
                                    linkPointsBox.removeAllItems();
                                    pointList = new ArrayList<>();
                                    if (editorCombo.getSelectedIndex() == 0) {
                                        linkPointsBox.setEnabled(false);
                            Severity: Minor
                            Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 55 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

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

                                public boolean replaceTrackConnection(@CheckForNull TrackSegment oldTrack, @CheckForNull TrackSegment newTrack) {
                                    boolean result = false; // assume failure (pessimist!)
                                    // trying to replace old track with null?
                                    if (newTrack == null) {
                                        // (yes) remove old connection
                            Severity: Minor
                            Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 35 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

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

                                public void setEastBoundSignalMast(String signalMast) {
                                    SignalMast mast = null;
                                    if (signalMast != null && !signalMast.isEmpty()) {
                                        mast = InstanceManager.getDefault(jmri.SignalMastManager.class).getSignalMast(signalMast);
                                        if (mast == null) {
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 535..565
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 600..630
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 554..584

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 272.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                public void setWestBoundSignalMast(String signalMast) {
                                    SignalMast mast = null;
                                    if (signalMast != null && !signalMast.isEmpty()) {
                                        mast = InstanceManager.getDefault(jmri.SignalMastManager.class).getSignalMast(signalMast);
                                        if (mast == null) {
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 535..565
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 600..630
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 489..519

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 272.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if ((getConnect1() != null) || (getConnect2() != null)) {
                                        JMenu connectionsMenu = new JMenu(Bundle.getMessage("Connections")); // there is no pane opening (which is what ... implies)
                                        if (getConnect1() != null) {
                                            connectionsMenu.add(new AbstractAction(Bundle.getMessage("MakeLabel", "1") + getConnect1().getName()) {
                                                @Override
                            java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java on lines 687..720

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 240.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            if ((block1 != null) && (block1 == block2)) {
                                                jmi = popup.add(Bundle.getMessage("MakeLabel", Bundle.getMessage("BeanNameBlock")) + block1.getDisplayName());
                                            } else if ((block1 != null) && (block2 != null) && (block1 != block2)) {
                                                jmi = popup.add(Bundle.getMessage("BlockDivider"));
                                                jmi.setEnabled(false);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 822..832

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 190.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            if ((block1 != null) && (block1 == block2)) {
                                                jmi = popup.add(Bundle.getMessage("MakeLabel", Bundle.getMessage("BeanNameBlock")) + block1.getDisplayName());
                                            } else if ((block1 != null) && (block2 != null) && (block1 != block2)) {
                                                jmi = popup.add(Bundle.getMessage("BlockDivider"));
                                                jmi.setEnabled(false);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 773..783

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 190.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if (getConnect1() == null && getConnect2() == null) {
                                        //This is no longer a block boundary, therefore will remove signal masts and sensors if present
                                        if (westBoundSignalMastNamed != null) {
                                            removeSML(getWestBoundSignalMast());
                                        }
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 968..998

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 170.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                @CheckForNull
                                @CheckReturnValue
                                public SignalHead getWestBoundSignalHead() {
                                    if (getType() == PointType.EDGE_CONNECTOR) {
                                        int dir = getConnect1Dir();
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 313..336
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 382..405
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 267..290

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 153.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                @CheckForNull
                                @CheckReturnValue
                                public SignalHead getEastBoundSignalHead() {
                                    if (getType() == PointType.EDGE_CONNECTOR) {
                                        int dir = getConnect1Dir();
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 313..336
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 382..405
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 336..359

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 153.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                public void setWestBoundSignal(String signalName) {
                                    if (getType() == PointType.EDGE_CONNECTOR) {
                                        int dir = getConnect1Dir();
                                        if (dir == Path.WEST || dir == Path.NORTH || dir == Path.NORTH_WEST) {
                                            setWestBoundSignalName(signalName);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 338..356
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 407..425
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 292..310

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 146.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                public void setEastBoundSignal(String signalName) {
                                    if (getType() == PointType.EDGE_CONNECTOR) {
                                        int dir = getConnect1Dir();
                                        if (dir == Path.EAST || dir == Path.SOUTH || dir == Path.SOUTH_EAST) {
                                            setEastBoundSignalName(signalName);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 338..356
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 407..425
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 361..379

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 146.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                @Override
                                public void setConnection(HitPointType connectionType, LayoutTrack o, HitPointType type) throws jmri.JmriException {
                                    if ((type != HitPointType.TRACK) && (type != HitPointType.NONE)) {
                                        String errString = MessageFormat.format("{0}.setConnection({1}, {2}, {3}); unexpected type",
                                                getName(), connectionType, (o == null) ? "null" : o.getName(), type); //I18IN
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 912..926

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 144.

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

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

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                public void removeBeanReference(jmri.NamedBean nb) {
                                    if (nb == null) {
                                        return;
                                    }
                                    if (nb instanceof SignalMast) {
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 632..657

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 136.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                @CheckReturnValue
                                private NamedBeanHandle<SignalMast> getWestBoundSignalMastNamed() {
                                    if (getType() == PointType.EDGE_CONNECTOR) {
                                        int dir = getConnect1Dir();
                                        if (dir == Path.WEST || dir == Path.NORTH || dir == Path.NORTH_WEST) {
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 519..533
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 584..598
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 473..487

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 121.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                @CheckReturnValue
                                private NamedBeanHandle<SignalMast> getEastBoundSignalMastNamed() {
                                    if (getType() == PointType.EDGE_CONNECTOR) {
                                        int dir = getConnect1Dir();
                                        if (dir == Path.SOUTH || dir == Path.EAST || dir == Path.SOUTH_EAST) {
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 519..533
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 584..598
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 538..552

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 121.

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

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

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                            jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                TrackSegmentView ctv = layoutEditor.getTrackSegmentView(getConnect1());
                                                //prompt for length
                                                int newValue = QuickPromptUtil.promptForInteger(layoutEditor,
                                                        Bundle.getMessage("DecorationLengthMenuItemTitle"),
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1066..1080

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 100.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                TrackSegmentView ctv = layoutEditor.getTrackSegmentView(getConnect1());
                                                //prompt for width
                                                int newValue = QuickPromptUtil.promptForInteger(layoutEditor,
                                                        Bundle.getMessage("DecorationLineWidthMenuItemTitle"),
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1085..1099

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 100.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                        } else {
                                            AbstractAction ssaa = new AbstractAction(Bundle.getMessage("SetSignals")) {
                                                @Override
                                                public void actionPerformed(ActionEvent e) {
                                                    // bring up signals at level crossing tool dialog
                            java/src/jmri/jmrit/display/layoutEditor/LayoutSlipView.java on lines 575..594

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 92.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                @Override
                                public LayoutTrack getConnection(HitPointType connectionType) throws jmri.JmriException {
                                    LayoutTrack result = null;
                                    if (connectionType == HitPointType.POS_POINT) {
                                        result = getConnect1();
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 892..907

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 88.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                private void setEastBoundSignalName(@CheckForNull String signalHead) {
                                    if (signalHead == null || signalHead.isEmpty()) {
                                        signalEastHeadNamed = null;
                                        return;
                                    }
                            java/src/jmri/jmrit/display/layoutEditor/LevelXing.java on lines 199..211
                            java/src/jmri/jmrit/display/layoutEditor/LevelXing.java on lines 221..233
                            java/src/jmri/jmrit/display/layoutEditor/LevelXing.java on lines 243..255
                            java/src/jmri/jmrit/display/layoutEditor/LevelXing.java on lines 265..277
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 358..370
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 427..439
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 381..393

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 84.

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

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

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                private void setWestBoundSignalName(@CheckForNull String signalHead) {
                                    if (signalHead == null || signalHead.isEmpty()) {
                                        signalWestHeadNamed = null;
                                        return;
                                    }
                            java/src/jmri/jmrit/display/layoutEditor/LevelXing.java on lines 199..211
                            java/src/jmri/jmrit/display/layoutEditor/LevelXing.java on lines 221..233
                            java/src/jmri/jmrit/display/layoutEditor/LevelXing.java on lines 243..255
                            java/src/jmri/jmrit/display/layoutEditor/LevelXing.java on lines 265..277
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 358..370
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 427..439
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 312..324

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 84.

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

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

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                public ArrayList<String> getSegmentReferences(TrackSegment ts) {
                                    ArrayList<String> items = new ArrayList<>();
                            
                                    HitPointType type1 = ts.getType1();
                                    LayoutTrack conn1 = ts.getConnect1();
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 825..837

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 84.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                public void setEastBoundSensor(String sensorName) {
                                    if (sensorName == null || sensorName.isEmpty()) {
                                        eastBoundSensorNamed = null;
                                        return;
                                    }
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 458..470
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 489..500
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 443..454

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 80.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                public void setWestBoundSensor(String sensorName) {
                                    if (sensorName == null || sensorName.isEmpty()) {
                                        westBoundSensorNamed = null;
                                        return;
                                    }
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 458..470
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 489..500
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 412..424

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 80.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if (getConnect2() != null) {
                                        TrackSegmentView ctv2 = layoutEditor.getTrackSegmentView(getConnect2());
                                        if (getConnect2().getConnect1() == positionablePoint) {
                                            ctv2.setArrowEndStart(false);
                                            ctv2.setBumperEndStart(false);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 127..137
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 157..167

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 78.

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

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

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (getConnect1() != null) {
                                        TrackSegmentView ctv1 = layoutEditor.getTrackSegmentView(getConnect1());
                                        if (getConnect1().getConnect1() == positionablePoint) {
                                            ctv1.setArrowEndStart(false);
                                            ctv1.setBumperEndStart(false);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 138..148
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 157..167

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 78.

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

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

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (getConnect1() != null) {
                                        TrackSegmentView ctv1 = layoutEditor.getTrackSegmentView(getConnect1());
                                        if (getConnect1().getConnect1() == positionablePoint) {
                                            ctv1.setArrowEndStart(false);
                                            ctv1.setBumperEndStart(true);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 127..137
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 138..148

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 78.

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

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

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                                            jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                TrackSegmentView ctv = layoutEditor.getTrackSegmentView(getConnect1());
                                                Color newColor = JmriColorChooser.showDialog(null, "Choose a color", ctv.getBumperColor());
                                                if ((newColor != null) && !newColor.equals(ctv.getBumperColor())) {
                                                    ctv.setBumperColor(newColor);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 977..983

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 72.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                        if (ts1 != null) {
                                            String blk1 = ts1.getBlockName();
                                            // is this the blockName we're looking for?
                                            if (blk1.equals(blockName)) {
                                                // if we are added to the TrackNameSet
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1960..1974

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 72.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                TrackSegmentView ctv = layoutEditor.getTrackSegmentView(getConnect1());
                                                Color newColor = JmriColorChooser.showDialog(null, "Choose a color", ctv.getArrowColor());
                                                if ((newColor != null) && !newColor.equals(ctv.getArrowColor())) {
                                                    ctv.setArrowColor(newColor);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1053..1059

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 72.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            if (ts2 != null) {
                                                String blk2 = ts2.getBlockName();
                                                // is this the blockName we're looking for?
                                                if (blk2.equals(blockName)) {
                                                    // if we are added to the TrackNameSet
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1943..1956

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 72.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                @Override
                                public boolean isDisconnected(HitPointType connectionType) {
                                    boolean result = false;
                                    if (connectionType == HitPointType.POS_POINT) {
                                        result = ((getConnect1() == null) || (getConnect2() == null));
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 934..944

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 68.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                @Override
                                public List<HitPointType> checkForFreeConnections() {
                                    List<HitPointType> result = new ArrayList<>();
                            
                                    if ((getConnect1() == null)
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 1078..1087

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 61.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                TrackSegmentView ctv = layoutEditor.getTrackSegmentView(getConnect1());
                                                //prompt for arrow gap
                                                int newValue = QuickPromptUtil.promptForInt(layoutEditor,
                                                        Bundle.getMessage("DecorationGapMenuItemTitle"),
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 990..998
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1003..1011

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 58.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                TrackSegmentView ctv = layoutEditor.getTrackSegmentView(getConnect1());
                                                //prompt for arrow line width
                                                int newValue = QuickPromptUtil.promptForInt(layoutEditor,
                                                        Bundle.getMessage("DecorationLineWidthMenuItemTitle"),
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1003..1011
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1016..1024

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 58.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            jmi.addActionListener((java.awt.event.ActionEvent e3) -> {
                                                TrackSegmentView ctv = layoutEditor.getTrackSegmentView(getConnect1());
                                                //prompt for arrow length
                                                int newValue = QuickPromptUtil.promptForInt(layoutEditor,
                                                        Bundle.getMessage("DecorationLengthMenuItemTitle"),
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 990..998
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 1016..1024

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 58.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                void removeSML(SignalMast signalMast) {
                                    if (signalMast == null) {
                                        return;
                                    }
                                    if (jmri.InstanceManager.getDefault(LayoutBlockManager.class
                            java/src/jmri/jmrit/display/layoutEditor/LayoutTurnout.java on lines 2366..2376
                            java/src/jmri/jmrit/display/layoutEditor/LevelXing.java on lines 760..767
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 765..772

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 52.

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

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

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

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

                            Refactorings

                            Further Reading

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

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

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 46.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            if (TrackNameSet == null) {
                                                TrackNameSet = new LinkedHashSet<>();
                                                log.debug("*    Add track ''{}'' to trackNameSet for block ''{}''", getName(), blk1);
                                                TrackNameSet.add(getName());
                                                TrackNameSets.add(TrackNameSet);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 1140..1145

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 46.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                                if (TrackNameSet == null) {
                                                    TrackNameSet = new LinkedHashSet<>();
                                                    log.debug("*    Add track ''{}'' to TrackNameSet for block ''{}''", getName(), blk2);
                                                    TrackNameSets.add(TrackNameSet);
                                                    TrackNameSet.add(getName());
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 1173..1178

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 46.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                        switch (newType) {
                                            default:
                                            case ANCHOR: {
                                                setTypeAnchor();
                                                break;
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 112..126

                            Duplicated Code

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

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

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
                            Open

                                    if (ts2 != null) {
                                        for (String item : getSegmentReferences(ts2)) {
                                            // Do not add duplicates
                                            if (!itemList.contains(item)) {
                                                itemList.add(item);
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 788..795

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 42.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                        } else {
                                            log.error("{}.replaceTrackConnection({}, {}); Attempt to assign more than allowed number of connections",
                                                    getName(), (oldTrack == null) ? "null" : oldTrack.getName(), newTrack.getName());
                                            result = false;
                                        }
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 757..761
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 752..756
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 689..693

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 40.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    } else {
                                        log.warn("{}.replaceTrackConnection({}, {}); Already connected",
                                                getName(), (oldTrack == null) ? "null" : oldTrack.getName(), newTrack.getName());
                                        result = false;
                                    }
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 757..761
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePoint.java on lines 752..756
                            java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java on lines 684..688

                            Duplicated Code

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

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

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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