java/src/jmri/jmrit/operations/trains/Train.java

Summary

Maintainability
F
1 mo
Test Coverage
B
83%

File Train.java has 3083 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.operations.trains;

import java.awt.Color;
import java.beans.PropertyChangeListener;
import java.io.*;
Severity: Major
Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 wk to fix

    Train has 262 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Train extends PropertyChangeSupport implements Identifiable, PropertyChangeListener {
    
        /*
         * WARNING DO NOT LOAD CAR OR ENGINE MANAGERS WHEN Train.java IS CREATED IT
         * CAUSES A RECURSIVE LOOP AT LOAD TIME, SEE EXAMPLES BELOW CarManager
    Severity: Major
    Found in java/src/jmri/jmrit/operations/trains/Train.java - About 5 days to fix

      Method isServiceableDestination has a Cognitive Complexity of 109 (exceeds 20 allowed). Consider refactoring.
      Open

          private boolean isServiceableDestination(PrintWriter buildReport, Car car, RouteLocation rLoc,
                  List<RouteLocation> rLocations) {
              // need the car's length when building train
              int length = car.getTotalLength();
              // car can be a kernel so get total length
      Severity: Minor
      Found in java/src/jmri/jmrit/operations/trains/Train.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 store has 201 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public Element store() {
              Element e = new Element(Xml.TRAIN);
              e.setAttribute(Xml.ID, getId());
              e.setAttribute(Xml.NAME, getName());
              e.setAttribute(Xml.DESCRIPTION, getRawDescription());
      Severity: Major
      Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 day to fix

        Method store has a Cognitive Complexity of 64 (exceeds 20 allowed). Consider refactoring.
        Open

            public Element store() {
                Element e = new Element(Xml.TRAIN);
                e.setAttribute(Xml.ID, getId());
                e.setAttribute(Xml.NAME, getName());
                e.setAttribute(Xml.DESCRIPTION, getRawDescription());
        Severity: Minor
        Found in java/src/jmri/jmrit/operations/trains/Train.java - About 7 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 isServiceableDestination has 159 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private boolean isServiceableDestination(PrintWriter buildReport, Car car, RouteLocation rLoc,
                    List<RouteLocation> rLocations) {
                // need the car's length when building train
                int length = car.getTotalLength();
                // car can be a kernel so get total length
        Severity: Major
        Found in java/src/jmri/jmrit/operations/trains/Train.java - About 6 hrs to fix

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

              public boolean isServiceable(PrintWriter buildReport, Car car) {
                  setServiceStatus(NONE);
                  // check to see if train can carry car
                  if (!isTypeNameAccepted(car.getTypeName())) {
                      addLine(buildReport, Bundle.getMessage("trainCanNotServiceCarType",
          Severity: Major
          Found in java/src/jmri/jmrit/operations/trains/Train.java - About 3 hrs to fix

            Method isServiceable has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
            Open

                public boolean isServiceable(PrintWriter buildReport, Car car) {
                    setServiceStatus(NONE);
                    // check to see if train can carry car
                    if (!isTypeNameAccepted(car.getTypeName())) {
                        addLine(buildReport, Bundle.getMessage("trainCanNotServiceCarType",
            Severity: Minor
            Found in java/src/jmri/jmrit/operations/trains/Train.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 createTrainIcon has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
            Open

                public void createTrainIcon(RouteLocation rl) {
                    if (_trainIcon != null && _trainIcon.isActive()) {
                        _trainIcon.remove();
                    }
                    // if there's a panel specified, get it and place icon
            Severity: Minor
            Found in java/src/jmri/jmrit/operations/trains/Train.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 getExpectedTravelTimeInMinutes has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public int getExpectedTravelTimeInMinutes(RouteLocation routeLocation) {
                    int minutes = 0;
                    if (!isTrainEnRoute()) {
                        minutes += Integer.parseInt(getDepartureTimeMinute());
                        minutes += 60 * Integer.parseInt(getDepartureTimeHour());
            Severity: Minor
            Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

              Method getTrainWeight has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
              Open

                  public int getTrainWeight(RouteLocation routeLocation) {
                      int weight = 0;
                      Route route = getRoute();
                      if (route != null) {
                          for (RouteLocation rl : route.getLocationsBySequenceList()) {
              Severity: Minor
              Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

              Method getTrainLength has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
              Open

                  public int getTrainLength(RouteLocation routeLocation) {
                      int length = 0;
                      Route route = getRoute();
                      if (route != null) {
                          for (RouteLocation rl : route.getLocationsBySequenceList()) {
              Severity: Minor
              Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                  public boolean printManifest(boolean isPreview) {
                      if (isModified()) {
                          new TrainManifest(this);
                          try {
                              new JsonManifest(this).build();
              Severity: Minor
              Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                    public int getExpectedTravelTimeInMinutes(RouteLocation routeLocation) {
                        int minutes = 0;
                        if (!isTrainEnRoute()) {
                            minutes += Integer.parseInt(getDepartureTimeMinute());
                            minutes += 60 * Integer.parseInt(getDepartureTimeHour());
                Severity: Minor
                Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

                Cognitive Complexity

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

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

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

                Further reading

                Method createTrainIcon has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public void createTrainIcon(RouteLocation rl) {
                        if (_trainIcon != null && _trainIcon.isActive()) {
                            _trainIcon.remove();
                        }
                        // if there's a panel specified, get it and place icon
                Severity: Minor
                Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                      private String parseTime(int minutes) {
                          int hours = 0;
                          int days = 0;
                  
                          if (minutes >= 60) {
                  Severity: Minor
                  Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                        protected void moveTrainIcon(RouteLocation rl) {
                            // create train icon if at departure, if program has been restarted, or removed
                            if (rl == getTrainDepartsRouteLocation() || _trainIcon == null || !_trainIcon.isActive()) {
                                createTrainIcon(rl);
                            }
                    Severity: Minor
                    Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                          public boolean isBuiltDateAccepted(String date) {
                              if (getBuiltStartYear().equals(NONE) && getBuiltEndYear().equals(NONE)) {
                                  return true; // range dates not defined
                              }
                              int startYear = 0; // default start year;
                      Severity: Minor
                      Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                            public void updateTrainTableRowColor() {
                                if (!InstanceManager.getDefault(TrainManager.class).isRowColorManual()) {
                                    switch (getStatusCode()) {
                                        case CODE_TRAIN_RESET:
                                            String color = getTableRowColorNameReset();
                        Severity: Minor
                        Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                              private synchronized void runScripts(List<String> scripts) {
                                  if (scripts.size() > 0) {
                                      // save the current status
                                      setOldStatusCode(getStatusCode());
                                      setStatusCode(CODE_RUN_SCRIPTS);
                          Severity: Minor
                          Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                                @Override
                                public void propertyChange(java.beans.PropertyChangeEvent e) {
                                    if (Control.SHOW_PROPERTY) {
                                        log.debug("Train ({}) sees property change: ({}) old: ({}) new: ({})", getName(), e.getPropertyName(),
                                                e.getOldValue(), e.getNewValue());
                            Severity: Minor
                            Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                                  public int getTrainLength(RouteLocation routeLocation) {
                                      int length = 0;
                                      Route route = getRoute();
                                      if (route != null) {
                                          for (RouteLocation rl : route.getLocationsBySequenceList()) {
                              Severity: Minor
                              Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                                    protected void replaceRoad(String oldRoad, String newRoad) {
                                        if (newRoad != null) {
                                            if (deleteCarRoadName(oldRoad)) {
                                                addCarRoadName(newRoad);
                                            }
                                Severity: Minor
                                Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                                      public int getTrainWeight(RouteLocation routeLocation) {
                                          int weight = 0;
                                          Route route = getRoute();
                                          if (route != null) {
                                              for (RouteLocation rl : route.getLocationsBySequenceList()) {
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                if (rldest.getName().equals(car.getDestinationName()) &&
                                                        rldest.isDropAllowed() &&
                                                        rldest.getMaxCarMoves() > 0 &&
                                                        !isLocationSkipped(rldest.getId()) &&
                                                        ((car.getDestination().getTrainDirections() & rldest.getTrainDirection()) != 0 ||
                                    Severity: Critical
                                    Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                      if (!isAllowThroughCarsEnabled() &&
                                                              TrainCommon.splitString(getTrainDepartsName())
                                                                      .equals(rLoc.getSplitName()) &&
                                                              TrainCommon.splitString(getTrainTerminatesName())
                                                                      .equals(rldest.getSplitName()) &&
                                      Severity: Critical
                                      Found in java/src/jmri/jmrit/operations/trains/Train.java - About 1 hr to fix

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

                                            public boolean move(String locationName) {
                                                log.info("Move train ({}) to location ({})", getName(), locationName);
                                                if (getRoute() == null || getCurrentRouteLocation() == null) {
                                                    return false;
                                                }
                                        Severity: Minor
                                        Found in java/src/jmri/jmrit/operations/trains/Train.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

                                        Avoid too many return statements within this method.
                                        Open

                                                    return false;
                                        Severity: Major
                                        Found in java/src/jmri/jmrit/operations/trains/Train.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                          return isServiceableDestination(buildReport, car, rLoc, rLocations);
                                          Severity: Major
                                          Found in java/src/jmri/jmrit/operations/trains/Train.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                    return false;
                                            Severity: Major
                                            Found in java/src/jmri/jmrit/operations/trains/Train.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                                  return true;
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/Train.java - About 30 mins to fix

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

                                                    public int getNumberEmptyCarsInTrain(RouteLocation routeLocation) {
                                                        int number = 0;
                                                        Route route = getRoute();
                                                        if (route != null) {
                                                            for (RouteLocation rl : route.getLocationsBySequenceList()) {
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java - About 25 mins to fix

                                                Cognitive Complexity

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

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

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

                                                Further reading

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

                                                        if (e.getChild(Xml.TYPES) != null) {
                                                            List<Element> carTypes = e.getChild(Xml.TYPES).getChildren(Xml.CAR_TYPE);
                                                            String[] types = new String[carTypes.size()];
                                                            for (int i = 0; i < carTypes.size(); i++) {
                                                                Element type = carTypes.get(i);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 2 other locations - About 4 hrs to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 1488..1512
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2371..2395

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 286.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (e.getChild(Xml.CAR_LOADS) != null) {
                                                            List<Element> carLoads = e.getChild(Xml.CAR_LOADS).getChildren(Xml.CAR_LOAD);
                                                            String[] loads = new String[carLoads.size()];
                                                            for (int i = 0; i < carLoads.size(); i++) {
                                                                Element load = carLoads.get(i);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 3 hrs to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2400..2416
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3692..3708
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3757..3773

                                                Duplicated Code

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

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

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

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

                                                        if (e.getChild(Xml.CAR_OWNERS) != null) {
                                                            List<Element> carOwners = e.getChild(Xml.CAR_OWNERS).getChildren(Xml.CAR_OWNER);
                                                            String[] owners = new String[carOwners.size()];
                                                            for (int i = 0; i < carOwners.size(); i++) {
                                                                Element owner = carOwners.get(i);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 3 hrs to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2400..2416
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3692..3708
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3739..3755

                                                Duplicated Code

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

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

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

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

                                                        if (e.getChild(Xml.CAR_ROADS) != null) {
                                                            List<Element> carRoads = e.getChild(Xml.CAR_ROADS).getChildren(Xml.CAR_ROAD);
                                                            String[] roads = new String[carRoads.size()];
                                                            for (int i = 0; i < carRoads.size(); i++) {
                                                                Element road = carRoads.get(i);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 3 hrs to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2400..2416
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3739..3755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3757..3773

                                                Duplicated Code

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

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

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

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

                                                    public int getTrainWeight(RouteLocation routeLocation) {
                                                        int weight = 0;
                                                        Route route = getRoute();
                                                        if (route != null) {
                                                            for (RouteLocation rl : route.getLocationsBySequenceList()) {
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 2 hrs to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2096..2123

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 186.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public int getTrainLength(RouteLocation routeLocation) {
                                                        int length = 0;
                                                        Route route = getRoute();
                                                        if (route != null) {
                                                            for (RouteLocation rl : route.getLocationsBySequenceList()) {
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 2 hrs to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2134..2162

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 186.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (eRoute.getChild(Xml.SKIPS) != null) {
                                                                List<Element> skips = eRoute.getChild(Xml.SKIPS).getChildren(Xml.LOCATION);
                                                                String[] locs = new String[skips.size()];
                                                                for (int i = 0; i < skips.size(); i++) {
                                                                    Element loc = skips.get(i);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 2 other locations - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2421..2431
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3714..3724

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 126.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (e.getChild(Xml.LOCO_ROADS) != null) {
                                                            List<Element> locoRoads = e.getChild(Xml.LOCO_ROADS).getChildren(Xml.LOCO_ROAD);
                                                            String[] roads = new String[locoRoads.size()];
                                                            for (int i = 0; i < locoRoads.size(); i++) {
                                                                Element road = locoRoads.get(i);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 2 other locations - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2421..2431
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3631..3641

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 126.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (getThirdLegOptions() != NO_CABOOSE_OR_FRED) {
                                                            e.setAttribute(Xml.LEG3_OPTIONS, Integer.toString(getThirdLegOptions()));
                                                            e.setAttribute(Xml.LEG3_ENGINES, getThirdLegNumberEngines());
                                                            e.setAttribute(Xml.LEG3_ROAD, getThirdLegEngineRoad());
                                                            e.setAttribute(Xml.LEG3_MODEL, getThirdLegEngineModel());
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4218..4230

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 122.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (getSecondLegOptions() != NO_CABOOSE_OR_FRED) {
                                                            e.setAttribute(Xml.LEG2_OPTIONS, Integer.toString(getSecondLegOptions()));
                                                            e.setAttribute(Xml.LEG2_ENGINES, getSecondLegNumberEngines());
                                                            e.setAttribute(Xml.LEG2_ROAD, getSecondLegEngineRoad());
                                                            e.setAttribute(Xml.LEG2_MODEL, getSecondLegEngineModel());
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4231..4243

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 122.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        for (String type : types) {
                                                            // don't save types that have been deleted by user
                                                            if (InstanceManager.getDefault(EngineTypes.class).containsName(type)) {
                                                                Element eType = new Element(Xml.LOCO_TYPE);
                                                                eType.setAttribute(Xml.NAME, type);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 2 other locations - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 1593..1604
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2642..2653

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 102.

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

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

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

                                                        if (!getOwnerOption().equals(ALL_OWNERS)) {
                                                            e.setAttribute(Xml.CAR_OWNER_OPTION, getOwnerOption());
                                                            String[] owners = getOwnerNames();
                                                            // new way of saving car owners
                                                            Element eOwners = new Element(Xml.CAR_OWNERS);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 8 other locations - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2657..2668
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2671..2682
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2685..2696
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2698..2710
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2712..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4120..4131
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4133..4143
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4145..4156

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 94.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (!getCarRoadOption().equals(ALL_ROADS)) {
                                                            e.setAttribute(Xml.CAR_ROAD_OPTION, getCarRoadOption());
                                                            String[] roads = getCarRoadNames();
                                                            // new way of saving road names
                                                            Element eRoads = new Element(Xml.CAR_ROADS);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 8 other locations - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2657..2668
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2671..2682
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2685..2696
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2698..2710
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2712..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4133..4143
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4145..4156
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4158..4169

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 94.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (!getLocoRoadOption().equals(ALL_ROADS)) {
                                                            e.setAttribute(Xml.LOCO_ROAD_OPTION, getLocoRoadOption());
                                                            String[] roads = getLocoRoadNames();
                                                            Element eRoads = new Element(Xml.LOCO_ROADS);
                                                            for (String road : roads) {
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 8 other locations - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2657..2668
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2671..2682
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2685..2696
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2698..2710
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2712..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4120..4131
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4145..4156
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4158..4169

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 94.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (!getLoadOption().equals(ALL_LOADS)) {
                                                            e.setAttribute(Xml.CAR_LOAD_OPTION, getLoadOption());
                                                            String[] loads = getLoadNames();
                                                            // new way of saving car loads
                                                            Element eLoads = new Element(Xml.CAR_LOADS);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 8 other locations - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2657..2668
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2671..2682
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2685..2696
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2698..2710
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2712..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4120..4131
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4133..4143
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4158..4169

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 94.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public boolean isLoadNameAccepted(String load, String type) {
                                                        if (_loadOption.equals(ALL_LOADS)) {
                                                            return true;
                                                        }
                                                        if (_loadOption.equals(INCLUDE_LOADS)) {
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 2 other locations - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1112..1121
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1234..1243

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 85.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 ((a = e.getAttribute(Xml.TERMINATION_TRACK)) != null) {
                                                                Location location = InstanceManager.getDefault(LocationManager.class)
                                                                        .getLocationByName(getTrainTerminatesName());
                                                                if (location != null) {
                                                                    _terminationTrack = location.getTrackById(a.getValue());
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3948..3956

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 76.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                            if ((a = e.getAttribute(Xml.ROUTE_ID)) != null) {
                                                                setRoute(InstanceManager.getDefault(RouteManager.class).getRouteById(a.getValue()));
                                                            } else if ((a = e.getAttribute(Xml.ROUTE)) != null) {
                                                                setRoute(InstanceManager.getDefault(RouteManager.class).getRouteByName(a.getValue()));
                                                            }
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1389..1393

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 76.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                            if ((a = e.getAttribute(Xml.DEPARTURE_TRACK)) != null) {
                                                                Location location = InstanceManager.getDefault(LocationManager.class)
                                                                        .getLocationByName(getTrainDepartsName());
                                                                if (location != null) {
                                                                    _departureTrack = location.getTrackById(a.getValue());
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 1 hr to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3957..3965

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 76.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public void addTypeName(String type) {
                                                        // insert at start of list, sort later
                                                        if (type == null || _typeList.contains(type)) {
                                                            return;
                                                        }
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 2 other locations - About 55 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 743..751
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 886..894

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 64.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public Train(String id, String name) {
                                                        log.debug("New train ({}) id: {}", name, id);
                                                        _name = name;
                                                        _id = id;
                                                        // a new train accepts all types
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 55 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 116..124

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 63.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (rldest.getName().equals(car.getDestinationName()) &&
                                                                    rldest.isDropAllowed() &&
                                                                    rldest.getMaxCarMoves() > 0 &&
                                                                    !isLocationSkipped(rldest.getId()) &&
                                                                    ((car.getDestination().getTrainDirections() & rldest.getTrainDirection()) != 0 ||
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1679..1683

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 62.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (rLoc.getName().equals(car.getLocationName()) &&
                                                                    rLoc.isPickUpAllowed() &&
                                                                    rLoc.getMaxCarMoves() > 0 &&
                                                                    !isLocationSkipped(rLoc.getId()) &&
                                                                    ((car.getLocation().getTrainDirections() & rLoc.getTrainDirection()) != 0 || isLocalSwitcher())) {
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1741..1746

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 62.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 boolean addOwnerName(String owner) {
                                                        if (_ownerList.contains(owner)) {
                                                            return false;
                                                        }
                                                        _ownerList.add(owner);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1151..1159
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1252..1260
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1377..1385

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 60.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public boolean addLocoRoadName(String road) {
                                                        if (_locoRoadList.contains(road)) {
                                                            return false;
                                                        }
                                                        _locoRoadList.add(road);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1151..1159
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1377..1385
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1487..1495

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 60.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public boolean addLoadName(String load) {
                                                        if (_loadList.contains(load)) {
                                                            return false;
                                                        }
                                                        _loadList.add(load);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1151..1159
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1252..1260
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1487..1495

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 60.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public boolean addCarRoadName(String road) {
                                                        if (_carRoadList.contains(road)) {
                                                            return false;
                                                        }
                                                        _carRoadList.add(road);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1252..1260
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1377..1385
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1487..1495

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 60.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if ((a = e.getAttribute(Xml.REQUESTED_CARS)) != null) {
                                                            try {
                                                                _statusCarsRequested = Integer.parseInt(a.getValue());
                                                            } catch (NumberFormatException ee) {
                                                                log.error("Status cars requested ({}) isn't a valid number for train ({})", a.getValue(), getName());
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 5 other locations - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1376..1382
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 1030..1036
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3802..3808
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3818..3824
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3825..3831

                                                Duplicated Code

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

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

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

                                                        if ((a = e.getAttribute(Xml.LEG2_OPTIONS)) != null) {
                                                            try {
                                                                _leg2Options = Integer.parseInt(a.getValue());
                                                            } catch (NumberFormatException ee) {
                                                                log.error("Leg 2 options ({}) isn't a valid number for train ({})", a.getValue(), getName());
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 5 other locations - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1376..1382
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 1030..1036
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3802..3808
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3825..3831
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3883..3889

                                                Duplicated Code

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

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

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

                                                        if ((a = e.getAttribute(Xml.LEG3_OPTIONS)) != null) {
                                                            try {
                                                                _leg3Options = Integer.parseInt(a.getValue());
                                                            } catch (NumberFormatException ee) {
                                                                log.error("Leg 3 options ({}) isn't a valid number for train ({})", a.getValue(), getName());
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 5 other locations - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1376..1382
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 1030..1036
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3802..3808
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3818..3824
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3883..3889

                                                Duplicated Code

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

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

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

                                                        if ((a = e.getAttribute(Xml.REQUIRES)) != null) {
                                                            try {
                                                                _requires = Integer.parseInt(a.getValue());
                                                            } catch (NumberFormatException ee) {
                                                                log.error("Requires ({}) isn't a valid number for train ({})", a.getValue(), getName());
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 5 other locations - About 50 mins to fix
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1376..1382
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 1030..1036
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3818..3824
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3825..3831
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3883..3889

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 58.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public String[] getLocoTypeNames() {
                                                        List<String> list = new ArrayList<>();
                                                        for (String type : _typeList) {
                                                            if (InstanceManager.getDefault(EngineTypes.class).containsName(type)) {
                                                                list.add(type);
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 45 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1017..1025

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 55.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public String[] getCarTypeNames() {
                                                        List<String> list = new ArrayList<>();
                                                        for (String type : _typeList) {
                                                            if (InstanceManager.getDefault(CarTypes.class).containsName(type)) {
                                                                list.add(type);
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 45 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1027..1035

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 55.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                            if (getBuildScripts().size() > 0) {
                                                                for (String scriptPathname : getBuildScripts()) {
                                                                    Element em = new Element(Xml.BUILD);
                                                                    em.setAttribute(Xml.NAME, scriptPathname);
                                                                    es.addContent(em);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 45 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4183..4189
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4190..4196
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4198..4204

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 54.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                            if (getMoveScripts().size() > 0) {
                                                                for (String scriptPathname : getMoveScripts()) {
                                                                    Element em = new Element(Xml.MOVE);
                                                                    em.setAttribute(Xml.NAME, scriptPathname);
                                                                    es.addContent(em);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 45 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4176..4182
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4183..4189
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4198..4204

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 54.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (e.getPropertyName().equals(CarTypes.CARTYPES_NAME_CHANGED_PROPERTY) ||
                                                                e.getPropertyName().equals(CarTypes.CARTYPES_CHANGED_PROPERTY) ||
                                                                e.getPropertyName().equals(EngineTypes.ENGINETYPES_NAME_CHANGED_PROPERTY)) {
                                                            replaceType((String) e.getOldValue(), (String) e.getNewValue());
                                                        }
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 45 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 1698..1702

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 54.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                            if (getTerminationScripts().size() > 0) {
                                                                for (String scriptPathname : getTerminationScripts()) {
                                                                    Element et = new Element(Xml.TERMINATE);
                                                                    et.setAttribute(Xml.NAME, scriptPathname);
                                                                    es.addContent(et);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 45 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4176..4182
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4183..4189
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4190..4196

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 54.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                            if (getAfterBuildScripts().size() > 0) {
                                                                for (String scriptPathname : getAfterBuildScripts()) {
                                                                    Element em = new Element(Xml.AFTER_BUILD);
                                                                    em.setAttribute(Xml.NAME, scriptPathname);
                                                                    es.addContent(em);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 45 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4176..4182
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4190..4196
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4198..4204

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 54.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if ((e.getChild(Xml.MANIFEST_LOGO) != null)) {
                                                            if ((a = e.getChild(Xml.MANIFEST_LOGO).getAttribute(Xml.NAME)) != null) {
                                                                setManifestLogoPathName(a.getValue());
                                                            }
                                                        }
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 45 mins to fix
                                                java/src/jmri/jmrit/operations/setup/Setup.java on lines 2627..2631

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 54.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public void setBuildTrainNormalEnabled(boolean enable) {
                                                        boolean old = _buildNormal;
                                                        _buildNormal = enable;
                                                        if (old != enable) {
                                                            setDirtyAndFirePropertyChange("build train normal", old ? "true" : "false", enable ? "true" // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    public void setShowArrivalAndDepartureTimes(boolean enable) {
                                                        boolean old = _showTimes;
                                                        _showTimes = enable;
                                                        if (old != enable) {
                                                            setDirtyAndFirePropertyChange("showArrivalAndDepartureTimes", old ? "true" : "false", // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    public void setAllowReturnToStagingEnabled(boolean enable) {
                                                        boolean old = _allowCarsReturnStaging;
                                                        _allowCarsReturnStaging = enable;
                                                        if (old != enable) {
                                                            setDirtyAndFirePropertyChange("allow cars to return to staging", old ? "true" : "false", // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    public void setAllowLocalMovesEnabled(boolean enable) {
                                                        boolean old = _allowLocalMoves;
                                                        _allowLocalMoves = enable;
                                                        if (old != enable) {
                                                            setDirtyAndFirePropertyChange("allow local moves", old ? "true" : "false", enable ? "true" // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    public void setSendCarsWithCustomLoadsToStagingEnabled(boolean enable) {
                                                        boolean old = _sendCarsWithCustomLoadsToStaging;
                                                        _sendCarsWithCustomLoadsToStaging = enable;
                                                        if (old != enable) {
                                                            setDirtyAndFirePropertyChange("SendCarsWithCustomLoadsToStaging", old ? "true" : "false", // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    public void setAllowThroughCarsEnabled(boolean enable) {
                                                        boolean old = _allowThroughCars;
                                                        _allowThroughCars = enable;
                                                        if (old != enable) {
                                                            setDirtyAndFirePropertyChange("allow through cars", old ? "true" : "false", enable ? "true" // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    public void setBuildConsistEnabled(boolean enable) {
                                                        boolean old = _buildConsist;
                                                        _buildConsist = enable;
                                                        if (old != enable) {
                                                            setDirtyAndFirePropertyChange("TrainBuildConsist", old ? "true" : "false", // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    public void setServiceAllCarsWithFinalDestinationsEnabled(boolean enable) {
                                                        boolean old = _serviceAllCarsWithFinalDestinations;
                                                        _serviceAllCarsWithFinalDestinations = enable;
                                                        if (old != enable) {
                                                            setDirtyAndFirePropertyChange("TrainServiceAllCarsWithFinalDestinations", old ? "true" : "false", // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    protected void setBuildFailed(boolean status) {
                                                        boolean old = _buildFailed;
                                                        _buildFailed = status;
                                                        if (old != status) {
                                                            setDirtyAndFirePropertyChange("buildFailed", old ? "true" : "false", status ? "true" : "false"); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    public void setPrinted(boolean printed) {
                                                        boolean old = _printed;
                                                        _printed = printed;
                                                        if (old != printed) {
                                                            setDirtyAndFirePropertyChange("trainPrinted", old ? "true" : "false", printed ? "true" : "false"); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2730..2737
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024

                                                Duplicated Code

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

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

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

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

                                                    public void setSendCarsToTerminalEnabled(boolean enable) {
                                                        boolean old = _sendToTerminal;
                                                        _sendToTerminal = enable;
                                                        if (old != enable) {
                                                            setDirtyAndFirePropertyChange("send cars to terminal", old ? "true" : "false", enable ? "true" // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2717..2724
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2748..2755
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2761..2768
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2774..2781
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2793..2800
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2806..2813
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2819..2826
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2832..2839
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3018..3024
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3162..3168

                                                Duplicated Code

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

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

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

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

                                                    public boolean deleteLoadName(String load) {
                                                        if (_loadList.remove(load)) {
                                                            log.debug("train ({}) delete car load {}", getName(), load);
                                                            setDirtyAndFirePropertyChange(LOADS_CHANGED_PROPERTY, _loadList.size() + 1, _loadList.size());
                                                            return true;
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1168..1175
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1269..1276
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1505..1512

                                                Duplicated Code

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

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

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

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

                                                    public boolean deleteOwnerName(String owner) {
                                                        if (_ownerList.remove(owner)) {
                                                            log.debug("train ({}) delete car owner {}", getName(), owner);
                                                            setDirtyAndFirePropertyChange(OWNERS_CHANGED_PROPERTY, _ownerList.size() + 1, _ownerList.size());
                                                            return true;
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1168..1175
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1269..1276
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1394..1401

                                                Duplicated Code

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

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

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

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

                                                    public boolean deleteCarRoadName(String road) {
                                                        if (_carRoadList.remove(road)) {
                                                            log.debug("train ({}) delete car road {}", getName(), road);
                                                            setDirtyAndFirePropertyChange(ROADS_CHANGED_PROPERTY, _carRoadList.size() + 1, _carRoadList.size());
                                                            return true;
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1269..1276
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1394..1401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1505..1512

                                                Duplicated Code

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

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

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

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

                                                    public boolean deleteLocoRoadName(String road) {
                                                        if (_locoRoadList.remove(road)) {
                                                            log.debug("train ({}) delete engine road {}", getName(), road);
                                                            setDirtyAndFirePropertyChange(ROADS_CHANGED_PROPERTY, _locoRoadList.size() + 1, _locoRoadList.size());
                                                            return true;
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 3 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1168..1175
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1394..1401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1505..1512

                                                Duplicated Code

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

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

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

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

                                                    protected void setOwnerNames(String[] owners) {
                                                        if (owners.length > 0) {
                                                            Arrays.sort(owners);
                                                            for (String owner : owners) {
                                                                if (!owner.isEmpty()) {
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1346..1355

                                                Duplicated Code

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

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

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

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

                                                    protected void setLoadNames(String[] loads) {
                                                        if (loads.length > 0) {
                                                            Arrays.sort(loads);
                                                            for (String load : loads) {
                                                                if (!load.isEmpty()) {
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1455..1464

                                                Duplicated Code

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

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

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

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

                                                    public int getNumberCarsPickedUp(RouteLocation routeLocation) {
                                                        int number = 0;
                                                        for (Car rs : InstanceManager.getDefault(CarManager.class).getList(this)) {
                                                            if (rs.getRouteLocation() == routeLocation) {
                                                                number++;
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2071..2079

                                                Duplicated Code

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

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

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

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

                                                    public int getNumberCarsSetout(RouteLocation routeLocation) {
                                                        int number = 0;
                                                        for (Car rs : InstanceManager.getDefault(CarManager.class).getList(this)) {
                                                            if (rs.getRouteDestination() == routeLocation) {
                                                                number++;
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2055..2063

                                                Duplicated Code

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

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

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

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

                                                    public void setRequirements(int requires) {
                                                        int old = _requires;
                                                        _requires = requires;
                                                        if (old != requires) {
                                                            setDirtyAndFirePropertyChange(TRAIN_REQUIREMENTS_CHANGED_PROPERTY, Integer.toString(old),
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 10 other locations - About 40 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 212..218
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 227..233
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 311..318
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 405..411
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 422..428
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 625..632
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 915..922
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 176..183
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 203..209
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 249..255

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 48.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public boolean isCarRoadNameAccepted(String road) {
                                                        if (_carRoadOption.equals(ALL_ROADS)) {
                                                            return true;
                                                        }
                                                        if (_carRoadOption.equals(INCLUDE_ROADS)) {
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 6 other locations - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 989..998
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1094..1103
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1216..1225
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1284..1293
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1409..1418
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1520..1529

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 46.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public boolean isLocoRoadNameAccepted(String road) {
                                                        if (_locoRoadOption.equals(ALL_ROADS)) {
                                                            return true;
                                                        }
                                                        if (_locoRoadOption.equals(INCLUDE_ROADS)) {
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 6 other locations - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 989..998
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1094..1103
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1216..1225
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1183..1192
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1409..1418
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1520..1529

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 46.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public boolean isOwnerNameAccepted(String owner) {
                                                        if (_ownerOption.equals(ALL_OWNERS)) {
                                                            return true;
                                                        }
                                                        if (_ownerOption.equals(INCLUDE_OWNERS)) {
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 6 other locations - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 989..998
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1094..1103
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1216..1225
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1183..1192
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1284..1293
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1409..1418

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 46.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public boolean isLoadNameAccepted(String load) {
                                                        if (_loadOption.equals(ALL_LOADS)) {
                                                            return true;
                                                        }
                                                        if (_loadOption.equals(INCLUDE_LOADS)) {
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 6 other locations - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 989..998
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1094..1103
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1216..1225
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1183..1192
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1284..1293
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1520..1529

                                                Duplicated Code

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

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

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (isModified()) {
                                                            new TrainManifest(this);
                                                            try {
                                                                new JsonManifest(this).build();
                                                            } catch (IOException ex) {
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3070..3078

                                                Duplicated Code

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

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

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (isModified()) {
                                                            new TrainManifest(this);
                                                            try {
                                                                new JsonManifest(this).build();
                                                            } catch (IOException ex) {
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3145..3153

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 46.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public void deleteTypeName(String type) {
                                                        if (_typeList.remove(type)) {
                                                            log.debug("Train ({}) delete car type ({})", getName(), type);
                                                            setDirtyAndFirePropertyChange(TYPES_CHANGED_PROPERTY, _typeList.size() + 1, _typeList.size());
                                                        }
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 5 other locations - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 753..758
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 896..901
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 982..987
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1081..1086
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1203..1208

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 44.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (!getBuiltEndYear().equals(NONE)) {
                                                            try {
                                                                endYear = Integer.parseInt(getBuiltEndYear());
                                                            } catch (NumberFormatException e) {
                                                                log.debug("Train ({}) built end date not initialized, end: {}", getName(), getBuiltEndYear());
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1584..1590

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 44.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (!getRailroadName().equals(NONE)) {
                                                            Element r = new Element(Xml.RAIL_ROAD);
                                                            r.setAttribute(Xml.NAME, getRailroadName());
                                                            e.addContent(r);
                                                        }
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4212..4216

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 44.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (!getBuiltStartYear().equals(NONE)) {
                                                            try {
                                                                startYear = Integer.parseInt(getBuiltStartYear());
                                                            } catch (NumberFormatException e) {
                                                                log.debug("Train ({}) built start date not initialized, start: {}", getName(), getBuiltStartYear());
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1591..1597

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 44.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                        if (!getManifestLogoPathName().equals(NONE)) {
                                                            Element l = new Element(Xml.MANIFEST_LOGO);
                                                            l.setAttribute(Xml.NAME, getManifestLogoPathName());
                                                            e.addContent(l);
                                                        }
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 4207..4211

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 44.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public String[] getOwnerNames() {
                                                        String[] owners = _ownerList.toArray(new String[0]);
                                                        if (_ownerList.size() > 0) {
                                                            Arrays.sort(owners);
                                                        }
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 6 other locations - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 955..961
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1053..1059
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1175..1181
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1136..1142
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1237..1243
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1363..1369

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 43.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public String[] getLoadNames() {
                                                        String[] loads = _loadList.toArray(new String[0]);
                                                        if (_loadList.size() > 0) {
                                                            Arrays.sort(loads);
                                                        }
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 6 other locations - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 955..961
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1053..1059
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1175..1181
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1136..1142
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1237..1243
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1472..1478

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 43.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public String[] getCarRoadNames() {
                                                        String[] roads = _carRoadList.toArray(new String[0]);
                                                        if (_carRoadList.size() > 0) {
                                                            Arrays.sort(roads);
                                                        }
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 6 other locations - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 955..961
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1053..1059
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1175..1181
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1237..1243
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1363..1369
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1472..1478

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 43.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    public String[] getLocoRoadNames() {
                                                        String[] roads = _locoRoadList.toArray(new String[0]);
                                                        if (_locoRoadList.size() > 0) {
                                                            Arrays.sort(roads);
                                                        }
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 6 other locations - About 35 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 955..961
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1053..1059
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 1175..1181
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1136..1142
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1363..1369
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1472..1478

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 43.

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

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

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

                                                    public void setThirdLegEngineRoad(String road) {
                                                        String old = _leg3Road;
                                                        _leg3Road = road;
                                                        if (!old.equals(road)) {
                                                            setDirtyAndFirePropertyChange("trainEngineRoad", old, road); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setThirdLegNumberEngines(String number) {
                                                        String old = _leg3Engines;
                                                        _leg3Engines = number;
                                                        if (!old.equals(number)) {
                                                            setDirtyAndFirePropertyChange("trainNmberEngines", old, number); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setSecondLegEngineRoad(String road) {
                                                        String old = _leg2Road;
                                                        _leg2Road = road;
                                                        if (!old.equals(road)) {
                                                            setDirtyAndFirePropertyChange("trainEngineRoad", old, road); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setSecondLegCabooseRoad(String road) {
                                                        String old = _leg2CabooseRoad;
                                                        _leg2CabooseRoad = road;
                                                        if (!old.equals(road)) {
                                                            setDirtyAndFirePropertyChange("trainCabooseRoad", old, road); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setRailroadName(String name) {
                                                        String old = _railroadName;
                                                        _railroadName = name;
                                                        if (!old.equals(name)) {
                                                            setDirtyAndFirePropertyChange("trainRailroadName", old, name); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    protected void setBuildFailedMessage(String message) {
                                                        String old = _buildFailedMessage;
                                                        _buildFailedMessage = message;
                                                        if (!old.equals(message)) {
                                                            setDirtyAndFirePropertyChange("buildFailedMessage", old, message); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setSecondLegNumberEngines(String number) {
                                                        String old = _leg2Engines;
                                                        _leg2Engines = number;
                                                        if (!old.equals(number)) {
                                                            setDirtyAndFirePropertyChange("trainNmberEngines", old, number); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setNumberEngines(String number) {
                                                        String old = _numberEngines;
                                                        _numberEngines = number;
                                                        if (!old.equals(number)) {
                                                            setDirtyAndFirePropertyChange("trainNmberEngines", old, number); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setSecondLegEngineModel(String model) {
                                                        String old = _leg2Model;
                                                        _leg2Model = model;
                                                        if (!old.equals(model)) {
                                                            setDirtyAndFirePropertyChange("trainEngineModel", old, model); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setThirdLegCabooseRoad(String road) {
                                                        String old = _leg3CabooseRoad;
                                                        _leg3CabooseRoad = road;
                                                        if (!old.equals(road)) {
                                                            setDirtyAndFirePropertyChange("trainCabooseRoad", old, road); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setThirdLegEngineModel(String model) {
                                                        String old = _leg3Model;
                                                        _leg3Model = model;
                                                        if (!old.equals(model)) {
                                                            setDirtyAndFirePropertyChange("trainEngineModel", old, model); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setSwitchListStatus(String status) {
                                                        String old = _switchListStatus;
                                                        _switchListStatus = status;
                                                        if (!old.equals(status)) {
                                                            setDirtyAndFirePropertyChange("switch list train status", old, status); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setCabooseRoad(String road) {
                                                        String old = _cabooseRoad;
                                                        _cabooseRoad = road;
                                                        if (!old.equals(road)) {
                                                            setDirtyAndFirePropertyChange("trainCabooseRoad", old, road); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setEngineModel(String model) {
                                                        String old = _engineModel;
                                                        _engineModel = model;
                                                        if (!old.equals(model)) {
                                                            setDirtyAndFirePropertyChange("trainEngineModel", old, model); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setComment(String comment) {
                                                        String old = _comment;
                                                        _comment = comment;
                                                        if (!old.equals(comment)) {
                                                            setDirtyAndFirePropertyChange("trainComment", old, comment); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2295..2301
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setEngineRoad(String road) {
                                                        String old = _engineRoad;
                                                        _engineRoad = road;
                                                        if (!old.equals(road)) {
                                                            setDirtyAndFirePropertyChange("trainEngineRoad", old, road); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 40 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 57..63
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 79..85
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 250..256
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 262..268
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 415..421
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 673..679
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 776..782
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 64..70
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 48..54
                                                java/src/jmri/jmrit/operations/locations/schedules/Schedule.java on lines 70..76
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 168..174
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 245..251
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 261..267
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 278..284
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 320..326
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 876..882
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1082..1088
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1176..1182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 339..345
                                                java/src/jmri/jmrit/operations/rollingstock/engines/Engine.java on lines 47..53
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 83..89
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 136..142
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 152..158
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 266..272
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2239..2245
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2265..2271
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2282..2288
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2317..2323
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2339..2345
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2361..2367
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2378..2384
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2395..2401
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2424..2430
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2441..2447
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2458..2464
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2566..2572
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2692..2698
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3036..3042
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3537..3543
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 60..66

                                                Duplicated Code

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

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

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

                                                    public void setName(String name) {
                                                        String old = _name;
                                                        _name = name;
                                                        if (!old.equals(name)) {
                                                            setDirtyAndFirePropertyChange(NAME_CHANGED_PROPERTY, old, name);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 23 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 432..438
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 699..705
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 377..383
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 788..794
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 804..810
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 820..826
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2247..2253
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 46..52
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1251..1257
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 159..165
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 176..182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 188..194
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 272..278
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 65..71
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 345..351
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 255..261
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 270..276
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1542..1548
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1559..1565
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2210..2216
                                                java/src/jmri/jmrit/operations/trains/TrainManager.java on lines 181..187
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 42..48
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainScheduleManager.java on lines 58..64

                                                Duplicated Code

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

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

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

                                                    public void setTableRowColorNameReset(String colorName) {
                                                        String old = _tableRowColorResetName;
                                                        _tableRowColorResetName = colorName;
                                                        if (!old.equals(colorName)) {
                                                            setDirtyAndFirePropertyChange(TRAIN_ROW_COLOR_RESET_CHANGED_PROPERTY, old, colorName);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 23 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 432..438
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 699..705
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 377..383
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 788..794
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 804..810
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 820..826
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2247..2253
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 46..52
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1251..1257
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 159..165
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 176..182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 188..194
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 272..278
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 65..71
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 345..351
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 220..226
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 255..261
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1542..1548
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1559..1565
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2210..2216
                                                java/src/jmri/jmrit/operations/trains/TrainManager.java on lines 181..187
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 42..48
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainScheduleManager.java on lines 58..64

                                                Duplicated Code

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

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

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

                                                    public void setBuiltStartYear(String year) {
                                                        String old = _builtStartYear;
                                                        _builtStartYear = year;
                                                        if (!old.equals(year)) {
                                                            setDirtyAndFirePropertyChange(BUILT_YEAR_CHANGED_PROPERTY, old, year);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 23 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 432..438
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 699..705
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 377..383
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 788..794
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 804..810
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 820..826
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2247..2253
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 46..52
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1251..1257
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 159..165
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 176..182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 188..194
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 272..278
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 65..71
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 345..351
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 220..226
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 255..261
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 270..276
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1559..1565
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2210..2216
                                                java/src/jmri/jmrit/operations/trains/TrainManager.java on lines 181..187
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 42..48
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainScheduleManager.java on lines 58..64

                                                Duplicated Code

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

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

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

                                                    public void setBuiltEndYear(String year) {
                                                        String old = _builtEndYear;
                                                        _builtEndYear = year;
                                                        if (!old.equals(year)) {
                                                            setDirtyAndFirePropertyChange(BUILT_YEAR_CHANGED_PROPERTY, old, year);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 23 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 432..438
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 699..705
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 377..383
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 788..794
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 804..810
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 820..826
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2247..2253
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 46..52
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1251..1257
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 159..165
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 176..182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 188..194
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 272..278
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 65..71
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 345..351
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 220..226
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 255..261
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 270..276
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1542..1548
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2210..2216
                                                java/src/jmri/jmrit/operations/trains/TrainManager.java on lines 181..187
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 42..48
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainScheduleManager.java on lines 58..64

                                                Duplicated Code

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

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

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

                                                    public void setTableRowColorName(String colorName) {
                                                        String old = _tableRowColorName;
                                                        _tableRowColorName = colorName;
                                                        if (!old.equals(colorName)) {
                                                            setDirtyAndFirePropertyChange(TRAIN_ROW_COLOR_CHANGED_PROPERTY, old, colorName);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 23 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 432..438
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 699..705
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 377..383
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 788..794
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 804..810
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 820..826
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2247..2253
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 46..52
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1251..1257
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 159..165
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 176..182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 188..194
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 272..278
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 65..71
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 345..351
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 220..226
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 270..276
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1542..1548
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1559..1565
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2210..2216
                                                java/src/jmri/jmrit/operations/trains/TrainManager.java on lines 181..187
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 42..48
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainScheduleManager.java on lines 58..64

                                                Duplicated Code

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

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

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

                                                    public void setDescription(String description) {
                                                        String old = _description;
                                                        _description = description;
                                                        if (!old.equals(description)) {
                                                            setDirtyAndFirePropertyChange(DESCRIPTION_CHANGED_PROPERTY, old, description);
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 23 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 432..438
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 699..705
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 377..383
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 788..794
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 804..810
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 820..826
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2247..2253
                                                java/src/jmri/jmrit/operations/locations/divisions/Division.java on lines 46..52
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1251..1257
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 159..165
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 176..182
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 188..194
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 272..278
                                                java/src/jmri/jmrit/operations/routes/Route.java on lines 65..71
                                                java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 345..351
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 220..226
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 255..261
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 270..276
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1542..1548
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1559..1565
                                                java/src/jmri/jmrit/operations/trains/TrainManager.java on lines 181..187
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainSchedule.java on lines 42..48
                                                java/src/jmri/jmrit/operations/trains/schedules/TrainScheduleManager.java on lines 58..64

                                                Duplicated Code

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

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

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (eRowColor != null && (a = eRowColor.getAttribute(Xml.RESET_ROW_COLOR)) != null) {
                                                            _tableRowColorResetName = a.getValue().toLowerCase();
                                                        }
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3619..3621

                                                Duplicated Code

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

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

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (eRowColor != null && (a = eRowColor.getAttribute(Xml.NAME)) != null) {
                                                            _tableRowColorName = a.getValue().toLowerCase();
                                                        }
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 1 other location - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 3622..3624

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 42.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    protected void setTypeNames(String[] types) {
                                                        if (types.length > 0) {
                                                            Arrays.sort(types);
                                                            for (String type : types) {
                                                                _typeList.add(type);
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 2 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 729..736
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 966..973

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 42.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    protected void setTrainSkipsLocations(String[] locationIds) {
                                                        if (locationIds.length > 0) {
                                                            Arrays.sort(locationIds);
                                                            for (String id : locationIds) {
                                                                _skipLocationsList.add(id);
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 2 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 729..736
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 1043..1050

                                                Duplicated Code

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

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

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

                                                    public void setTerminationTrack(Track track) {
                                                        Track old = _terminationTrack;
                                                        _terminationTrack = track;
                                                        if (old != track) {
                                                            setDirtyAndFirePropertyChange("TerminationTrackChanged", old, track); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 20 other locations - About 30 mins to fix
                                                java/src/jmri/implementation/AbstractLight.java on lines 103..110
                                                java/src/jmri/implementation/AbstractLight.java on lines 140..147
                                                java/src/jmri/implementation/AbstractSignalMast.java on lines 101..110
                                                java/src/jmri/implementation/AbstractSignalMast.java on lines 121..129
                                                java/src/jmri/implementation/AbstractTurnout.java on lines 602..610
                                                java/src/jmri/implementation/AbstractVariableLight.java on lines 369..377
                                                java/src/jmri/implementation/DccSignalHead.java on lines 113..121
                                                java/src/jmri/implementation/DefaultRoute.java on lines 240..247
                                                java/src/jmri/implementation/DefaultSignalHead.java on lines 92..101
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 130..136
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 278..284
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 301..307
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 452..458
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 488..494
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 700..706
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1133..1139
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 753..759
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2536..2542
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2554..2560
                                                java/src/jmri/jmrix/can/cbus/node/CbusBasicNode.java on lines 185..191

                                                Duplicated Code

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

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

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

                                                    public void setThirdLegOptions(int options) {
                                                        int old = _leg3Options;
                                                        _leg3Options = options;
                                                        if (old != options) {
                                                            setDirtyAndFirePropertyChange("trainLegOptions", old, options); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 20 other locations - About 30 mins to fix
                                                java/src/jmri/implementation/AbstractLight.java on lines 103..110
                                                java/src/jmri/implementation/AbstractLight.java on lines 140..147
                                                java/src/jmri/implementation/AbstractSignalMast.java on lines 101..110
                                                java/src/jmri/implementation/AbstractSignalMast.java on lines 121..129
                                                java/src/jmri/implementation/AbstractTurnout.java on lines 602..610
                                                java/src/jmri/implementation/AbstractVariableLight.java on lines 369..377
                                                java/src/jmri/implementation/DccSignalHead.java on lines 113..121
                                                java/src/jmri/implementation/DefaultRoute.java on lines 240..247
                                                java/src/jmri/implementation/DefaultSignalHead.java on lines 92..101
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 130..136
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 278..284
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 301..307
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 452..458
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 488..494
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 700..706
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1133..1139
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 753..759
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 769..775
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2536..2542
                                                java/src/jmri/jmrix/can/cbus/node/CbusBasicNode.java on lines 185..191

                                                Duplicated Code

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

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

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

                                                    public void setDepartureTrack(Track track) {
                                                        Track old = _departureTrack;
                                                        _departureTrack = track;
                                                        if (old != track) {
                                                            setDirtyAndFirePropertyChange("DepartureTrackChanged", old, track); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 20 other locations - About 30 mins to fix
                                                java/src/jmri/implementation/AbstractLight.java on lines 103..110
                                                java/src/jmri/implementation/AbstractLight.java on lines 140..147
                                                java/src/jmri/implementation/AbstractSignalMast.java on lines 101..110
                                                java/src/jmri/implementation/AbstractSignalMast.java on lines 121..129
                                                java/src/jmri/implementation/AbstractTurnout.java on lines 602..610
                                                java/src/jmri/implementation/AbstractVariableLight.java on lines 369..377
                                                java/src/jmri/implementation/DccSignalHead.java on lines 113..121
                                                java/src/jmri/implementation/DefaultRoute.java on lines 240..247
                                                java/src/jmri/implementation/DefaultSignalHead.java on lines 92..101
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 130..136
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 278..284
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 301..307
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 452..458
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 488..494
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 700..706
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1133..1139
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 769..775
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2536..2542
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2554..2560
                                                java/src/jmri/jmrix/can/cbus/node/CbusBasicNode.java on lines 185..191

                                                Duplicated Code

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

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

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

                                                    public void setSecondLegOptions(int options) {
                                                        int old = _leg2Options;
                                                        _leg2Options = options;
                                                        if (old != options) {
                                                            setDirtyAndFirePropertyChange("trainLegOptions", old, options); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 20 other locations - About 30 mins to fix
                                                java/src/jmri/implementation/AbstractLight.java on lines 103..110
                                                java/src/jmri/implementation/AbstractLight.java on lines 140..147
                                                java/src/jmri/implementation/AbstractSignalMast.java on lines 101..110
                                                java/src/jmri/implementation/AbstractSignalMast.java on lines 121..129
                                                java/src/jmri/implementation/AbstractTurnout.java on lines 602..610
                                                java/src/jmri/implementation/AbstractVariableLight.java on lines 369..377
                                                java/src/jmri/implementation/DccSignalHead.java on lines 113..121
                                                java/src/jmri/implementation/DefaultRoute.java on lines 240..247
                                                java/src/jmri/implementation/DefaultSignalHead.java on lines 92..101
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 130..136
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 278..284
                                                java/src/jmri/jmrit/operations/automation/AutomationItem.java on lines 301..307
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 452..458
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 488..494
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 700..706
                                                java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 1133..1139
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 753..759
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 769..775
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2554..2560
                                                java/src/jmri/jmrix/can/cbus/node/CbusBasicNode.java on lines 185..191

                                                Duplicated Code

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

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

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

                                                    protected void setBuilt(boolean built) {
                                                        boolean old = _built;
                                                        _built = built;
                                                        if (old != built) {
                                                            setDirtyAndFirePropertyChange(BUILT_CHANGED_PROPERTY, old, built); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 7 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 112..118
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 642..648
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 1356..1362
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 505..511
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2821..2827
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 322..328
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2901..2907

                                                Duplicated Code

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

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

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

                                                    public void setBuildEnabled(boolean build) {
                                                        boolean old = _build;
                                                        _build = build;
                                                        if (old != build) {
                                                            setDirtyAndFirePropertyChange(BUILD_CHANGED_PROPERTY, old, build); // NOI18N
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/operations/trains/Train.java and 7 other locations - About 30 mins to fix
                                                java/src/jmri/jmrit/operations/automation/Automation.java on lines 112..118
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 642..648
                                                java/src/jmri/jmrit/operations/locations/Location.java on lines 1356..1362
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 505..511
                                                java/src/jmri/jmrit/operations/locations/Track.java on lines 2821..2827
                                                java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 322..328
                                                java/src/jmri/jmrit/operations/trains/Train.java on lines 2841..2847

                                                Duplicated Code

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

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

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