java/src/jmri/jmrit/operations/locations/Track.java

Summary

Maintainability
F
3 wks
Test Coverage
B
80%

File Track.java has 2022 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.operations.locations;

import java.util.*;

import org.jdom2.Attribute;
Severity: Major
Found in java/src/jmri/jmrit/operations/locations/Track.java - About 5 days to fix

    Track has 189 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Track extends PropertyChangeSupport {
    
        public static final String NONE = "";
    
        protected String _id = NONE;
    Severity: Major
    Found in java/src/jmri/jmrit/operations/locations/Track.java - About 3 days to fix

      Method store has 156 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public Element store() {
              Element e = new Element(Xml.TRACK);
              e.setAttribute(Xml.ID, getId());
              e.setAttribute(Xml.NAME, getName());
              e.setAttribute(Xml.TRACK_TYPE, getTrackType());
      Severity: Major
      Found in java/src/jmri/jmrit/operations/locations/Track.java - About 6 hrs to fix

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

            public Element store() {
                Element e = new Element(Xml.TRACK);
                e.setAttribute(Xml.ID, getId());
                e.setAttribute(Xml.NAME, getName());
                e.setAttribute(Xml.TRACK_TYPE, getTrackType());
        Severity: Minor
        Found in java/src/jmri/jmrit/operations/locations/Track.java - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method scheduleNext has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public String scheduleNext(Car car) {
                // clean up the car's final destination if sent to that destination and
                // there isn't a schedule
                if (getScheduleId().equals(NONE) &&
                        car.getDestination() != null &&
        Severity: Major
        Found in java/src/jmri/jmrit/operations/locations/Track.java - About 2 hrs to fix

          Method isRollingStockAccepted has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public String isRollingStockAccepted(RollingStock rs) {
                  // first determine if rolling stock can be move to the new location
                  // note that there's code that checks for certain issues by checking the
                  // first word of the status string returned
                  if (!isTypeNameAccepted(rs.getTypeName())) {
          Severity: Major
          Found in java/src/jmri/jmrit/operations/locations/Track.java - About 2 hrs to fix

            Method checkPickups has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
            Open

                public String checkPickups() {
                    String status = PICKUP_OKAY;
                    S1: for (String carType : InstanceManager.getDefault(CarTypes.class).getNames()) {
                        if (!isTypeNameAccepted(carType)) {
                            continue;
            Severity: Minor
            Found in java/src/jmri/jmrit/operations/locations/Track.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 copyTrack has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public Track copyTrack(String newName, Location newLocation) {
                    Track newTrack = newLocation.addTrack(newName, getTrackType());
                    newTrack.clearTypeNames(); // all types are accepted by a new track
            
                    newTrack.setAddCustomLoadsAnySpurEnabled(isAddCustomLoadsAnySpurEnabled());
            Severity: Minor
            Found in java/src/jmri/jmrit/operations/locations/Track.java - About 1 hr to fix

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

                  public String isRollingStockAccepted(RollingStock rs) {
                      // first determine if rolling stock can be move to the new location
                      // note that there's code that checks for certain issues by checking the
                      // first word of the status string returned
                      if (!isTypeNameAccepted(rs.getTypeName())) {
              Severity: Minor
              Found in java/src/jmri/jmrit/operations/locations/Track.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 checkPickups has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public String checkPickups() {
                      String status = PICKUP_OKAY;
                      S1: for (String carType : InstanceManager.getDefault(CarTypes.class).getNames()) {
                          if (!isTypeNameAccepted(carType)) {
                              continue;
              Severity: Minor
              Found in java/src/jmri/jmrit/operations/locations/Track.java - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                        if (currentSi != null &&
                                (currentSi.getSetoutTrainScheduleId().equals(ScheduleItem.NONE) ||
                                        InstanceManager.getDefault(TrainScheduleManager.class).getTrainScheduleActiveId()
                                                .equals(currentSi.getSetoutTrainScheduleId())) &&
                                car.getTypeName().equals(currentSi.getTypeName()) &&
                Severity: Critical
                Found in java/src/jmri/jmrit/operations/locations/Track.java - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                                          if (rLoc.getName().equals(getLocation().getName()) &&
                                                  rLoc.isPickUpAllowed() &&
                                                  rLoc.getMaxCarMoves() > 0 &&
                                                  !train.isLocationSkipped(rLoc.getId()) &&
                                                  ((getTrainDirections() & rLoc.getTrainDirection()) != 0 || train.isLocalSwitcher()) &&
                  Severity: Critical
                  Found in java/src/jmri/jmrit/operations/locations/Track.java - About 1 hr to fix

                    Method scheduleNext has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
                    Open

                        public String scheduleNext(Car car) {
                            // clean up the car's final destination if sent to that destination and
                            // there isn't a schedule
                            if (getScheduleId().equals(NONE) &&
                                    car.getDestination() != null &&
                    Severity: Minor
                    Found in java/src/jmri/jmrit/operations/locations/Track.java - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Avoid too many return statements within this method.
                    Open

                            return OKAY;
                    Severity: Major
                    Found in java/src/jmri/jmrit/operations/locations/Track.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return OKAY;
                      Severity: Major
                      Found in java/src/jmri/jmrit/operations/locations/Track.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return OKAY;
                        Severity: Major
                        Found in java/src/jmri/jmrit/operations/locations/Track.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return Bundle.getMessage("lengthIssue",
                                              LENGTH, length, Setup.getLengthUnit().toLowerCase(), getAvailableTrackSpace(), getLength());
                          Severity: Major
                          Found in java/src/jmri/jmrit/operations/locations/Track.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return Bundle.getMessage("capacityIssue",
                                                    CAPACITY, length, Setup.getLengthUnit().toLowerCase(), getLength());
                            Severity: Major
                            Found in java/src/jmri/jmrit/operations/locations/Track.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return OKAY;
                              Severity: Major
                              Found in java/src/jmri/jmrit/operations/locations/Track.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return getSchedule().searchSchedule(car, this);
                                Severity: Major
                                Found in java/src/jmri/jmrit/operations/locations/Track.java - About 30 mins to fix

                                  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/locations/Track.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/trains/Train.java on lines 3654..3679

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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/locations/Track.java and 3 other locations - About 3 hrs to fix
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 3688..3704
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 3735..3751
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 3753..3769

                                  Duplicated Code

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

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

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

                                          if (e.getChild(Xml.DROP_IDS) != null) {
                                              List<Element> dropIds = e.getChild(Xml.DROP_IDS).getChildren(Xml.DROP_ID);
                                              String[] ids = new String[dropIds.size()];
                                              for (int i = 0; i < dropIds.size(); i++) {
                                                  Element dropId = dropIds.get(i);
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 2 other locations - About 2 hrs to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2451..2466
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2472..2487

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 176.

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

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

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

                                  See codeclimate-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.PICKUP_IDS) != null) {
                                              List<Element> pickupIds = e.getChild(Xml.PICKUP_IDS).getChildren(Xml.PICKUP_ID);
                                              String[] ids = new String[pickupIds.size()];
                                              for (int i = 0; i < pickupIds.size(); i++) {
                                                  Element pickupId = pickupIds.get(i);
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 2 other locations - About 2 hrs to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2430..2445
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2472..2487

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 176.

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

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

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

                                  See codeclimate-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.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/locations/Track.java and 2 other locations - About 2 hrs to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2430..2445
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2451..2466

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 176.

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

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

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

                                  See codeclimate-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.CAR_SHIP_LOADS) != null) {
                                              List<Element> carLoads = e.getChild(Xml.CAR_SHIP_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/locations/Track.java and 2 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 3627..3637
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 3710..3720

                                  Duplicated Code

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

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

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

                                      public String getLoadOptionString() {
                                          String s;
                                          if (getLoadOption().equals(Track.INCLUDE_LOADS)) {
                                              s = Bundle.getMessage("AcceptOnly") + " " + getLoadNames().length + " " + Bundle.getMessage("Loads");
                                          } else if (getLoadOption().equals(Track.EXCLUDE_LOADS)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 2 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 932..942
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1135..1145

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 119.

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

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

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

                                  See codeclimate-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 String getShipLoadOptionString() {
                                          String s;
                                          if (getShipLoadOption().equals(Track.INCLUDE_LOADS)) {
                                              s = Bundle.getMessage("ShipOnly") + " " + getShipLoadNames().length + " " + Bundle.getMessage("Loads");
                                          } else if (getShipLoadOption().equals(Track.EXCLUDE_LOADS)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 2 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 932..942
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1013..1023

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 119.

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

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

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

                                  See codeclimate-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 String getRoadOptionString() {
                                          String s;
                                          if (getRoadOption().equals(Track.INCLUDE_ROADS)) {
                                              s = Bundle.getMessage("AcceptOnly") + " " + getRoadNames().length + " " + Bundle.getMessage("Roads");
                                          } else if (getRoadOption().equals(Track.EXCLUDE_ROADS)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 2 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1013..1023
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1135..1145

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 119.

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

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

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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/locations/Track.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/trains/Train.java on lines 4102..4113

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (!getRoadOption().equals(ALL_ROADS)) {
                                              e.setAttribute(Xml.CAR_ROAD_OPTION, getRoadOption());
                                              String[] roads = getRoadNames();
                                              // new way of saving road names
                                              Element eRoads = new Element(Xml.CAR_ROADS);
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 8 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2668..2679
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2682..2693
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2695..2707
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2709..2721
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4116..4127
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4129..4139
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4141..4152
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4154..4165

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (!getShipLoadOption().equals(ALL_LOADS)) {
                                              e.setAttribute(Xml.CAR_SHIP_LOAD_OPTION, getShipLoadOption());
                                              String[] loads = getShipLoadNames();
                                              // new way of saving car loads using elements
                                              Element eLoads = new Element(Xml.CAR_SHIP_LOADS);
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 8 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2654..2665
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2668..2679
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2695..2707
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2709..2721
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4116..4127
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4129..4139
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4141..4152
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4154..4165

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 using elements
                                              Element eLoads = new Element(Xml.CAR_LOADS);
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 8 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2654..2665
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2682..2693
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2695..2707
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2709..2721
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4116..4127
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4129..4139
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4141..4152
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4154..4165

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (!getPickupOption().equals(ANY)) {
                                              e.setAttribute(Xml.PICKUP_OPTION, getPickupOption());
                                              // build list of pickup ids for this track
                                              String[] pickupIds = getPickupIds();
                                              // new way of saving pick up ids using elements
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 8 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2654..2665
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2668..2679
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2682..2693
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2695..2707
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4116..4127
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4129..4139
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4141..4152
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4154..4165

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (!getDropOption().equals(ANY)) {
                                              e.setAttribute(Xml.DROP_OPTION, getDropOption());
                                              // build list of drop ids for this track
                                              String[] dropIds = getDropIds();
                                              // new way of saving drop ids using elements
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 8 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2654..2665
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2668..2679
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2682..2693
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2709..2721
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4116..4127
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4129..4139
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4141..4152
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 4154..4165

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 isLoadNameAndCarTypeAccepted(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/locations/Track.java and 2 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1234..1243
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 1427..1436

                                  Duplicated Code

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

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

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

                                      public boolean isLoadNameAndCarTypeShipped(String load, String type) {
                                          if (_shipLoadOption.equals(ALL_LOADS)) {
                                              return true;
                                          }
                                          if (_shipLoadOption.equals(INCLUDE_LOADS)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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/trains/Train.java on lines 1427..1436

                                  Duplicated Code

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

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

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

                                      public boolean isPickupTrainAccepted(Train train) {
                                          if (getPickupOption().equals(ANY)) {
                                              return true;
                                          }
                                          if (getPickupOption().equals(TRAINS)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1335..1348

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 80.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      public boolean isDropTrainAccepted(Train train) {
                                          if (getDropOption().equals(ANY)) {
                                              return true;
                                          }
                                          if (getDropOption().equals(TRAINS)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1403..1416

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 80.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      public void setPool(Pool pool) {
                                          Pool old = _pool;
                                          _pool = pool;
                                          if (old != pool) {
                                              if (old != null) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 786..798

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 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 4 locations. Consider refactoring.
                                  Open

                                      public void deleteRS(RollingStock rs) {
                                          setNumberRS(getNumberRS() - 1);
                                          if (rs.getClass() == Car.class) {
                                              setNumberCars(getNumberCars() - 1);
                                          } else if (rs.getClass() == Engine.class) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 3 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 566..574
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 576..584
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 700..708

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 70.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              if (e.getChild(Xml.COMMENTS).getChild(Xml.PRINT_SWITCH_LISTS) != null &&
                                                      (a = e.getChild(Xml.COMMENTS).getChild(Xml.PRINT_SWITCH_LISTS).getAttribute(Xml.COMMENT)) != null) {
                                                  _printCommentSwitchList = a.getValue().equals(Xml.TRUE);
                                              }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2598..2601

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 70.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              if (e.getChild(Xml.COMMENTS).getChild(Xml.PRINT_MANIFEST) != null &&
                                                      (a = e.getChild(Xml.COMMENTS).getChild(Xml.PRINT_MANIFEST).getAttribute(Xml.COMMENT)) != null) {
                                                  _printCommentManifest = a.getValue().equals(Xml.TRUE);
                                              }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2602..2605

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 70.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      public void addRS(RollingStock rs) {
                                          setNumberRS(getNumberRS() + 1);
                                          if (rs.getClass() == Car.class) {
                                              setNumberCars(getNumberCars() + 1);
                                          } else if (rs.getClass() == Engine.class) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 3 other locations - About 1 hr to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 566..574
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 576..584
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 710..718

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 70.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              if (e.getChild(Xml.COMMENTS).getChild(Xml.PICKUP) != null &&
                                                      (a = e.getChild(Xml.COMMENTS).getChild(Xml.PICKUP).getAttribute(Xml.COMMENT)) != null) {
                                                  _commentPickup = a.getValue();
                                              }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 3 other locations - About 55 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2582..2585
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2586..2589
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2594..2597

                                  Duplicated Code

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

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

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

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

                                              if (e.getChild(Xml.COMMENTS).getChild(Xml.TRACK) != null &&
                                                      (a = e.getChild(Xml.COMMENTS).getChild(Xml.TRACK).getAttribute(Xml.COMMENT)) != null) {
                                                  _comment = a.getValue();
                                              }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 3 other locations - About 55 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2586..2589
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2590..2593
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2594..2597

                                  Duplicated Code

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

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

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

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

                                              if (e.getChild(Xml.COMMENTS).getChild(Xml.SETOUT) != null &&
                                                      (a = e.getChild(Xml.COMMENTS).getChild(Xml.SETOUT).getAttribute(Xml.COMMENT)) != null) {
                                                  _commentSetout = a.getValue();
                                              }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 3 other locations - About 55 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2582..2585
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2586..2589
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2590..2593

                                  Duplicated Code

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

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

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

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

                                              if (e.getChild(Xml.COMMENTS).getChild(Xml.BOTH) != null &&
                                                      (a = e.getChild(Xml.COMMENTS).getChild(Xml.BOTH).getAttribute(Xml.COMMENT)) != null) {
                                                  _commentBoth = a.getValue();
                                              }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 3 other locations - About 55 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2582..2585
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2590..2593
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2594..2597

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 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/locations/Track.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/trains/Train.java on lines 1057..1065

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 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 boolean isPickupRouteAccepted(Route route) {
                                          if (getPickupOption().equals(ANY) ||
                                                  getPickupOption().equals(TRAINS) ||
                                                  getPickupOption().equals(EXCLUDE_TRAINS)) {
                                              return true;
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1350..1358

                                  Duplicated Code

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

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

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

                                      public boolean isDropRouteAccepted(Route route) {
                                          if (getDropOption().equals(ANY) || getDropOption().equals(TRAINS) || getDropOption().equals(EXCLUDE_TRAINS)) {
                                              return true;
                                          }
                                          if (getDropOption().equals(EXCLUDE_ROUTES)) {
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1418..1428

                                  Duplicated Code

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

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

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

                                      public void deleteReservedInRoute(Car car) {
                                          int old = _reservedEnRoute;
                                          _numberCarsEnRoute--;
                                          _reservedEnRoute = old - car.getTotalLength();
                                          if (old != _reservedEnRoute) {
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 447..455

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 60.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      public void addReservedInRoute(Car car) {
                                          int old = _reservedEnRoute;
                                          _numberCarsEnRoute++;
                                          _reservedEnRoute = old + car.getTotalLength();
                                          if (old != _reservedEnRoute) {
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 457..465

                                  Duplicated Code

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

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

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

                                      public void setLoadSwapEnabled(boolean enable) {
                                          boolean old = isLoadSwapEnabled();
                                          if (enable) {
                                              _loadOptions = _loadOptions | SWAP_GENERIC_LOADS;
                                          } else {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 7 other locations - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2021..2029
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2040..2048
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2059..2067
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2079..2087
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2099..2107
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2122..2130
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2136..2144

                                  Duplicated Code

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

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

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

                                      public void setAddCustomLoadsAnySpurEnabled(boolean enable) {
                                          boolean old = isAddCustomLoadsAnySpurEnabled();
                                          if (enable) {
                                              _loadOptions = _loadOptions | GENERATE_CUSTOM_LOADS_ANY_SPUR;
                                          } else {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 7 other locations - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2001..2009
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2021..2029
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2040..2048
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2059..2067
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2099..2107
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2122..2130
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2136..2144

                                  Duplicated Code

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

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

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

                                      public void setLoadEmptyEnabled(boolean enable) {
                                          boolean old = isLoadEmptyEnabled();
                                          if (enable) {
                                              _loadOptions = _loadOptions | EMPTY_GENERIC_LOADS;
                                          } else {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 7 other locations - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2001..2009
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2040..2048
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2059..2067
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2079..2087
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2099..2107
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2122..2130
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2136..2144

                                  Duplicated Code

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

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

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

                                      public void setDisableLoadChangeEnabled(boolean enable) {
                                          boolean old = isDisableLoadChangeEnabled();
                                          if (enable) {
                                              _loadOptions = _loadOptions | DISABLE_LOAD_CHANGE;
                                          } else {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 7 other locations - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2001..2009
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2021..2029
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2040..2048
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2059..2067
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2079..2087
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2099..2107
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2136..2144

                                  Duplicated Code

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

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

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

                                      public void setAddCustomLoadsEnabled(boolean enable) {
                                          boolean old = isAddCustomLoadsEnabled();
                                          if (enable) {
                                              _loadOptions = _loadOptions | GENERATE_CUSTOM_LOADS;
                                          } else {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 7 other locations - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2001..2009
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2021..2029
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2040..2048
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2079..2087
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2099..2107
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2122..2130
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2136..2144

                                  Duplicated Code

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

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

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

                                      public void setAddCustomLoadsAnyStagingTrackEnabled(boolean enable) {
                                          boolean old = isAddCustomLoadsAnyStagingTrackEnabled();
                                          if (enable) {
                                              _loadOptions = _loadOptions | GENERATE_CUSTOM_LOADS_ANY_STAGING_TRACK;
                                          } else {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 7 other locations - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2001..2009
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2021..2029
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2040..2048
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2059..2067
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2079..2087
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2122..2130
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2136..2144

                                  Duplicated Code

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

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

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

                                      public void setBlockCarsEnabled(boolean enable) {
                                          boolean old = isBlockCarsEnabled();
                                          if (enable) {
                                              _blockOptions = _blockOptions | BLOCK_CARS;
                                          } else {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 7 other locations - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2001..2009
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2021..2029
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2040..2048
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2059..2067
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2079..2087
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2099..2107
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2122..2130

                                  Duplicated Code

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

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

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

                                      public void setRemoveCustomLoadsEnabled(boolean enable) {
                                          boolean old = isRemoveCustomLoadsEnabled();
                                          if (enable) {
                                              _loadOptions = _loadOptions | EMPTY_CUSTOM_LOADS;
                                          } else {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 7 other locations - About 50 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2001..2009
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2021..2029
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2059..2067
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2079..2087
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2099..2107
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2122..2130
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2136..2144

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.ITEM_COUNT)) != null) {
                                              try {
                                                  _scheduleCount = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Schedule count isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.FACTOR)) != null) {
                                              try {
                                                  _reservationFactor = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Reservation factor isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.BLOCKING_ORDER)) != null) {
                                              try {
                                                  _blockingOrder = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Track blocking order isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.DIR)) != null) {
                                              try {
                                                  _trainDir = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Track service direction isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.IGNORE_USED_PERCENTAGE)) != null) {
                                              try {
                                                  _ignoreUsedLengthPercentage = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Ignore used percentage isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560

                                  Duplicated Code

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

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

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

                                              if ((a = e.getAttribute(Xml.MIN_LENGTH)) != null) {
                                                  try {
                                                      _minimumLength = Integer.parseInt(a.getValue());
                                                  } catch (NumberFormatException nfe) {
                                                      log.error("Minimum pool length isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.MOVES)) != null) {
                                              try {
                                                  _moves = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Track moves isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.LOAD_OPTIONS)) != null) {
                                              try {
                                                  _loadOptions = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Load options isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.SCHEDULE_MODE)) != null) {
                                              try {
                                                  _mode = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Schedule mode isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.BLOCK_OPTIONS)) != null) {
                                              try {
                                                  _blockOptions = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Block options isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2334..2340
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                          if ((a = e.getAttribute(Xml.LENGTH)) != null) {
                                              try {
                                                  _length = Integer.parseInt(a.getValue());
                                              } catch (NumberFormatException nfe) {
                                                  log.error("Track length isn't a vaild number for track {}", getName());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 11 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 1422..1428
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2341..2348
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2349..2355
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2356..2362
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2503..2509
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2510..2516
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2517..2523
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2535..2541
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2542..2548
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2554..2560
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2562..2568

                                  Duplicated Code

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

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

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

                                      private void setLoadNames(String[] loads) {
                                          if (loads.length > 0) {
                                              Arrays.sort(loads);
                                              for (String loadName : loads) {
                                                  if (!loadName.equals(NONE)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 4 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 871..880
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 963..972
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1158..1167
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStockAttribute.java on lines 53..62

                                  Duplicated Code

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

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

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

                                      private void setTypeNames(String[] types) {
                                          if (types.length > 0) {
                                              Arrays.sort(types);
                                              for (String type : types) {
                                                  if (!_typeList.contains(type)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 4 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 963..972
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1036..1045
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1158..1167
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStockAttribute.java on lines 53..62

                                  Duplicated Code

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

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

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

                                      private void setShipLoadNames(String[] loads) {
                                          if (loads.length > 0) {
                                              Arrays.sort(loads);
                                              for (String shipLoadName : loads) {
                                                  if (!shipLoadName.equals(NONE)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 4 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 871..880
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 963..972
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1036..1045
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStockAttribute.java on lines 53..62

                                  Duplicated Code

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

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

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

                                      private void setRoadNames(String[] roads) {
                                          if (roads.length > 0) {
                                              Arrays.sort(roads);
                                              for (String roadName : roads) {
                                                  if (!roadName.equals(NONE)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 4 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 871..880
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1036..1045
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1158..1167
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStockAttribute.java on lines 53..62

                                  Duplicated Code

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

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

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

                                      public void addRoadName(String road) {
                                          if (!_roadList.contains(road)) {
                                              _roadList.add(road);
                                              log.debug("Track ({}) add car road ({})", getName(), road);
                                              setDirtyAndFirePropertyChange(ROADS_CHANGED_PROPERTY, _roadList.size() - 1, _roadList.size());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 2 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1067..1073
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1189..1195

                                  Duplicated Code

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

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

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

                                      public void addLoadName(String load) {
                                          if (!_loadList.contains(load)) {
                                              _loadList.add(load);
                                              log.debug("track ({}) add car load ({})", getName(), load);
                                              setDirtyAndFirePropertyChange(LOADS_CHANGED_PROPERTY, _loadList.size() - 1, _loadList.size());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 2 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 974..980
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1189..1195

                                  Duplicated Code

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

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

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

                                      public void addShipLoadName(String load) {
                                          if (!_shipLoadList.contains(load)) {
                                              _shipLoadList.add(load);
                                              log.debug("track ({}) add car load ({})", getName(), load);
                                              setDirtyAndFirePropertyChange(LOADS_CHANGED_PROPERTY, _shipLoadList.size() - 1, _shipLoadList.size());
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 2 other locations - About 45 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 974..980
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1067..1073

                                  Duplicated Code

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

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

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

                                      public void setName(String name) {
                                          String old = _name;
                                          _name = name;
                                          if (!old.equals(name)) {
                                              // recalculate max track name length
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 136..144

                                  Duplicated Code

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

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

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

                                          if (!isRoadNameAccepted(rs.getRoadName())) {
                                              log.debug("Rolling stock ({}) road ({}) not accepted at location ({}, {}) wrong road", rs.toString(),
                                                      rs.getRoadName(), getLocation().getName(), getName()); // NOI18N
                                              return ROAD + " (" + rs.getRoadName() + ")";
                                          }
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1487..1491

                                  Duplicated Code

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

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

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

                                          if (!isTypeNameAccepted(rs.getTypeName())) {
                                              log.debug("Rolling stock ({}) type ({}) not accepted at location ({}, {}) wrong type", rs.toString(),
                                                      rs.getTypeName(), getLocation().getName(), getName()); // NOI18N
                                              return TYPE + " (" + rs.getTypeName() + ")";
                                          }
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1492..1496

                                  Duplicated Code

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

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

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

                                      private void setNumberRS(int number) {
                                          int old = _numberRS;
                                          _numberRS = number;
                                          if (old != number) {
                                              setDirtyAndFirePropertyChange("trackNumberRS", Integer.toString(old), // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 17 other locations - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 336..342
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 356..363
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 375..382
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 520..526
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 543..549
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 434..441
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 606..613
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 653..660
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 665..672
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 767..774
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 220..226
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 237..243
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 317..323
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 329..335
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 402..409
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 415..421
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 427..433

                                  Duplicated Code

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

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

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

                                      public void setUsedLength(int length) {
                                          int old = _usedLength;
                                          _usedLength = length;
                                          if (old != length) {
                                              setDirtyAndFirePropertyChange("trackUsedLength", Integer.toString(old), // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 17 other locations - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 336..342
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 356..363
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 375..382
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 520..526
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 543..549
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 434..441
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 641..648
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 653..660
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 665..672
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 767..774
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 220..226
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 237..243
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 317..323
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 329..335
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 402..409
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 415..421
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 427..433

                                  Duplicated Code

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

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

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

                                      public void setReserved(int reserved) {
                                          int old = _reserved;
                                          _reserved = reserved;
                                          if (old != reserved) {
                                              setDirtyAndFirePropertyChange("trackReserved", Integer.toString(old), // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 17 other locations - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 336..342
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 356..363
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 375..382
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 520..526
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 543..549
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 606..613
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 641..648
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 653..660
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 665..672
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 767..774
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 220..226
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 237..243
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 317..323
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 329..335
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 402..409
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 415..421
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 427..433

                                  Duplicated Code

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

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

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

                                      private void setNumberCars(int number) {
                                          int old = _numberCars;
                                          _numberCars = number;
                                          if (old != number) {
                                              setDirtyAndFirePropertyChange("trackNumberCars", Integer.toString(old), // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 17 other locations - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 336..342
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 356..363
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 375..382
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 520..526
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 543..549
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 434..441
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 606..613
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 641..648
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 665..672
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 767..774
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 220..226
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 237..243
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 317..323
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 329..335
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 402..409
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 415..421
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 427..433

                                  Duplicated Code

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

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

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

                                      private void setNumberEngines(int number) {
                                          int old = _numberEngines;
                                          _numberEngines = number;
                                          if (old != number) {
                                              setDirtyAndFirePropertyChange("trackNumberEngines", Integer.toString(old), // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 17 other locations - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 336..342
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 356..363
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 375..382
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 520..526
                                  java/src/jmri/jmrit/operations/locations/Location.java on lines 543..549
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 434..441
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 606..613
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 641..648
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 653..660
                                  java/src/jmri/jmrit/operations/rollingstock/RollingStock.java on lines 767..774
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 220..226
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 237..243
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 317..323
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 329..335
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 402..409
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 415..421
                                  java/src/jmri/jmrit/operations/routes/RouteLocation.java on lines 427..433

                                  Duplicated Code

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

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

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

                                      public void setMinimumLength(int length) {
                                          int old = _minimumLength;
                                          _minimumLength = length;
                                          if (old != length) {
                                              setDirtyAndFirePropertyChange(MIN_LENGTH_CHANGED_PROPERTY, Integer.toString(old), Integer.toString(length));
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 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
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 542..549

                                  Duplicated Code

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

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

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

                                      public void setIgnoreUsedLengthPercentage(int percentage) {
                                          int old = _ignoreUsedLengthPercentage;
                                          _ignoreUsedLengthPercentage = percentage;
                                          if (old != percentage) {
                                              setDirtyAndFirePropertyChange(PLANNED_PICKUPS_CHANGED_PROPERTY, Integer.toString(old),
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 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
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 542..549

                                  Duplicated Code

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

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

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

                                      public void setLength(int length) {
                                          int old = _length;
                                          _length = length;
                                          if (old != length) {
                                              setDirtyAndFirePropertyChange(LENGTH_CHANGED_PROPERTY, Integer.toString(old), Integer.toString(length));
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 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
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 542..549

                                  Duplicated Code

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

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

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

                                      public void setTrainDirections(int direction) {
                                          int old = _trainDir;
                                          _trainDir = direction;
                                          if (old != direction) {
                                              setDirtyAndFirePropertyChange(TRAIN_DIRECTION_CHANGED_PROPERTY, Integer.toString(old),
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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/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
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 542..549

                                  Duplicated Code

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

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

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

                                      public void setDropOption(String option) {
                                          String old = _dropOption;
                                          _dropOption = option;
                                          if (!old.equals(option)) {
                                              _dropList.clear();
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1292..1299

                                  Duplicated Code

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

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

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

                                      public void setPickupOption(String option) {
                                          String old = _pickupOption;
                                          _pickupOption = option;
                                          if (!old.equals(option)) {
                                              _pickupList.clear();
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 40 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1264..1271

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 isLoadNameAccepted(String load) {
                                          if (_loadOption.equals(ALL_LOADS)) {
                                              return true;
                                          }
                                          if (_loadOption.equals(INCLUDE_LOADS)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 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
                                  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 isRoadNameAccepted(String road) {
                                          if (_roadOption.equals(ALL_ROADS)) {
                                              return true;
                                          }
                                          if (_roadOption.equals(INCLUDE_ROADS)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 6 other locations - About 35 mins to fix
                                  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
                                  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 isLoadNameShipped(String load) {
                                          if (_shipLoadOption.equals(ALL_LOADS)) {
                                              return true;
                                          }
                                          if (_shipLoadOption.equals(INCLUDE_LOADS)) {
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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/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
                                  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 2 locations. Consider refactoring.
                                  Open

                                      public void addPickupId(String id) {
                                          if (!_pickupList.contains(id)) {
                                              _pickupList.add(id);
                                              log.debug("track ({}) add pick up id {}", getName(), id);
                                              setDirtyAndFirePropertyChange(PICKUP_CHANGED_PROPERTY, null, id);
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 35 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1313..1319

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 46.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      public void addDropId(String id) {
                                          if (!_dropList.contains(id)) {
                                              _dropList.add(id);
                                              log.debug("Track ({}) add drop id: {}", getName(), id);
                                              setDirtyAndFirePropertyChange(DROP_CHANGED_PROPERTY, null, id);
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 1 other location - About 35 mins to fix
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1381..1387

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 deleteShipLoadName(String load) {
                                          if (_shipLoadList.remove(load)) {
                                              log.debug("track ({}) delete car load ({})", getName(), load);
                                              setDirtyAndFirePropertyChange(LOADS_CHANGED_PROPERTY, _shipLoadList.size() + 1, _shipLoadList.size());
                                          }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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/trains/Train.java on lines 1067..1072

                                  Duplicated Code

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

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

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

                                      public void deleteRoadName(String road) {
                                          if (_roadList.remove(road)) {
                                              log.debug("Track ({}) delete car road ({})", getName(), road);
                                              setDirtyAndFirePropertyChange(ROADS_CHANGED_PROPERTY, _roadList.size() + 1, _roadList.size());
                                          }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 1081..1086
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 1203..1208
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 1067..1072

                                  Duplicated Code

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

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

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

                                      public void deleteLoadName(String load) {
                                          if (_loadList.remove(load)) {
                                              log.debug("track ({}) delete car load ({})", getName(), load);
                                              setDirtyAndFirePropertyChange(LOADS_CHANGED_PROPERTY, _loadList.size() + 1, _loadList.size());
                                          }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 1203..1208
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 1067..1072

                                  Duplicated Code

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

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

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

                                      public void deleteTypeName(String type) {
                                          if (_typeList.remove(type)) {
                                              log.debug("Track ({}) delete rolling stock type ({})", getName(), type);
                                              setDirtyAndFirePropertyChange(TYPES_CHANGED_PROPERTY, _typeList.size() + 1, _typeList.size());
                                          }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 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
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 1067..1072

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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[] getShipLoadNames() {
                                          String[] loads = _shipLoadList.toArray(new String[0]);
                                          if (_shipLoadList.size() > 0) {
                                              Arrays.sort(loads);
                                          }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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/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
                                  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[] getRoadNames() {
                                          String[] roads = _roadList.toArray(new String[0]);
                                          if (_roadList.size() > 0) {
                                              Arrays.sort(roads);
                                          }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.java and 6 other locations - About 35 mins to fix
                                  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
                                  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[] getLoadNames() {
                                          String[] loads = _loadList.toArray(new String[0]);
                                          if (_loadList.size() > 0) {
                                              Arrays.sort(loads);
                                          }
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 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
                                  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 setComment(String comment) {
                                          String old = _comment;
                                          _comment = comment;
                                          if (!old.equals(comment)) {
                                              setDirtyAndFirePropertyChange("trackComment", old, comment); // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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/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 2235..2241
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2261..2267
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2278..2284
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2291..2297
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2313..2319
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2335..2341
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2357..2363
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2374..2380
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2391..2397
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2420..2426
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2437..2443
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2454..2460
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2562..2568
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2688..2694
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 3032..3038
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 3533..3539
                                  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 setTrackType(String type) {
                                          String old = _trackType;
                                          _trackType = type;
                                          if (!old.equals(type)) {
                                              setDirtyAndFirePropertyChange(TRACK_TYPE_CHANGED_PROPERTY, old, type);
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 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 2244..2250
                                  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/Train.java on lines 2206..2212
                                  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 setCommentBoth(String comment) {
                                          String old = _commentBoth;
                                          _commentBoth = comment;
                                          if (!old.equals(comment)) {
                                              setDirtyAndFirePropertyChange(TRACK_COMMENT_CHANGED_PROPERTY, old, comment); // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 2244..2250
                                  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/Train.java on lines 2206..2212
                                  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 setDestinationOption(String option) {
                                          String old = _destinationOption;
                                          _destinationOption = option;
                                          if (!option.equals(old)) {
                                              setDirtyAndFirePropertyChange(DESTINATION_OPTIONS_CHANGED_PROPERTY, old, option); // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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/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/Train.java on lines 2206..2212
                                  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 setCommentPickup(String comment) {
                                          String old = _commentPickup;
                                          _commentPickup = comment;
                                          if (!old.equals(comment)) {
                                              setDirtyAndFirePropertyChange(TRACK_COMMENT_CHANGED_PROPERTY, old, comment); // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 804..810
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 820..826
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2244..2250
                                  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/Train.java on lines 2206..2212
                                  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 setCommentSetout(String comment) {
                                          String old = _commentSetout;
                                          _commentSetout = comment;
                                          if (!old.equals(comment)) {
                                              setDirtyAndFirePropertyChange(TRACK_COMMENT_CHANGED_PROPERTY, old, comment); // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 820..826
                                  java/src/jmri/jmrit/operations/locations/Track.java on lines 2244..2250
                                  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/Train.java on lines 2206..2212
                                  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 21 locations. Consider refactoring.
                                  Open

                                      public void setReservationFactor(int factor) {
                                          int old = _reservationFactor;
                                          _reservationFactor = factor;
                                          if (old != factor) {
                                              setDirtyAndFirePropertyChange("trackReservationFactor", old, factor); // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 96..105
                                  java/src/jmri/implementation/AbstractSignalMast.java on lines 116..124
                                  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 89..98
                                  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/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 2532..2538
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2550..2556
                                  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

                                      public void setReporter(Reporter r) {
                                          Reporter old = _reader;
                                          _reader = r;
                                          if (old != r) {
                                              setDirtyAndFirePropertyChange(TRACK_REPORTER_CHANGED_PROPERTY, old, r);
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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/rollingstock/cars/Car.java on lines 322..328
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2837..2843
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2897..2903

                                  Duplicated Code

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

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

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 setScheduleMode(int mode) {
                                          int old = _mode;
                                          _mode = mode;
                                          if (old != mode) {
                                              setDirtyAndFirePropertyChange(SCHEDULE_MODE_CHANGED_PROPERTY, old, mode); // NOI18N
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/locations/Track.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 2818..2824
                                  java/src/jmri/jmrit/operations/rollingstock/cars/Car.java on lines 322..328
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2837..2843
                                  java/src/jmri/jmrit/operations/trains/Train.java on lines 2897..2903

                                  Duplicated Code

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

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

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