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

Summary

Maintainability
F
3 wks
Test Coverage

File TrainBuilderCars.java has 1384 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.operations.trains;

import java.util.*;

import org.apache.commons.lang3.StringUtils;
Severity: Major
Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 3 days to fix

    Method getCaboose has a Cognitive Complexity of 116 (exceeds 20 allowed). Consider refactoring.
    Open

        protected void getCaboose(String roadCaboose, Engine leadEngine, RouteLocation rl, RouteLocation rld,
                boolean requiresCaboose) throws BuildFailedException {
            // code check
            if (rl == null) {
                throw new BuildFailedException(Bundle.getMessage("buildErrorCabooseNoLocation", _train.getName()));
    Severity: Minor
    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 2 days to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method findDestinationAndTrack has a Cognitive Complexity of 88 (exceeds 20 allowed). Consider refactoring.
    Open

        private boolean findDestinationAndTrack(Car car, RouteLocation rl, int routeIndex, int routeEnd)
                throws BuildFailedException {
            if (routeIndex + 1 == routeEnd) {
                log.debug("Car ({}) is at the last location in the train's route", car.toString());
            }
    Severity: Minor
    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method checkCarForDestination has a Cognitive Complexity of 65 (exceeds 20 allowed). Consider refactoring.
    Open

        private boolean checkCarForDestination(Car car, RouteLocation rl, int routeIndex) throws BuildFailedException {
            if (car.getDestination() == null) {
                return false; // the only false return
            }
            addLine(_buildReport, SEVEN, Bundle.getMessage("buildCarHasAssignedDest", car.toString(), car.getLoadName(),
    Severity: Minor
    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 7 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method blockCarsByLocationMoves has a Cognitive Complexity of 65 (exceeds 20 allowed). Consider refactoring.
    Open

        private void blockCarsByLocationMoves() throws BuildFailedException {
            List<RouteLocation> blockRouteList = _train.getRoute().getLocationsBySequenceList();
            for (RouteLocation rl : blockRouteList) {
                // start at the second location in the route to begin blocking
                if (rl == _train.getTrainDepartsRouteLocation()) {
    Severity: Minor
    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 7 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method findDestinationAndTrack has 183 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private boolean findDestinationAndTrack(Car car, RouteLocation rl, int routeIndex, int routeEnd)
                throws BuildFailedException {
            if (routeIndex + 1 == routeEnd) {
                log.debug("Car ({}) is at the last location in the train's route", car.toString());
            }
    Severity: Major
    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 7 hrs to fix

      Method getCaboose has 141 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected void getCaboose(String roadCaboose, Engine leadEngine, RouteLocation rl, RouteLocation rld,
                  boolean requiresCaboose) throws BuildFailedException {
              // code check
              if (rl == null) {
                  throw new BuildFailedException(Bundle.getMessage("buildErrorCabooseNoLocation", _train.getName()));
      Severity: Major
      Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 5 hrs to fix

        Method getCarWithFred has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring.
        Open

            protected void getCarWithFred(String road, RouteLocation rl, RouteLocation rld) throws BuildFailedException {
                // load departure track if staging
                Track departTrack = null;
                if (rl == _train.getTrainDepartsRouteLocation()) {
                    departTrack = _departStageTrack;
        Severity: Minor
        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 5 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method checkCarForDestination has 126 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private boolean checkCarForDestination(Car car, RouteLocation rl, int routeIndex) throws BuildFailedException {
                if (car.getDestination() == null) {
                    return false; // the only false return
                }
                addLine(_buildReport, SEVEN, Bundle.getMessage("buildCarHasAssignedDest", car.toString(), car.getLoadName(),
        Severity: Major
        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 5 hrs to fix

          Method generateCarLoadFromStaging has 120 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private boolean generateCarLoadFromStaging(Car car, RouteLocation rld) throws BuildFailedException {
                  // Code Check, car should have a track assignment
                  if (car.getTrack() == null) {
                      throw new BuildFailedException(
                              Bundle.getMessage("buildWarningRsNoTrack", car.toString(), car.getLocationName()));
          Severity: Major
          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 4 hrs to fix

            Method findDestinationsForCarsWithHomeDivision has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
            Open

                private boolean findDestinationsForCarsWithHomeDivision(Car car) throws BuildFailedException {
                    if (car.getDivision() == null || car.getDestination() != null || car.getFinalDestination() != null) {
                        return true;
                    }
                    if (car.getDivision() == car.getTrack().getDivision()) {
            Severity: Minor
            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.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 sendCarToDestinationSpur has 101 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private boolean sendCarToDestinationSpur(Car car, Track track) {
                    if (!checkBasicMoves(car, track)) {
                        addLine(_buildReport, SEVEN, Bundle.getMessage("trainCanNotDeliverToDestination", _train.getName(),
                                car.toString(), track.getLocation().getName(), track.getName()));
                        return false;
            Severity: Major
            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 4 hrs to fix

              Method findFinalDestinationForCarLoad has 99 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private boolean findFinalDestinationForCarLoad(Car car) throws BuildFailedException {
                      if (car.getLoadName().equals(carLoads.getDefaultEmptyName()) ||
                              car.getLoadName().equals(carLoads.getDefaultLoadName()) ||
                              car.getDestination() != null ||
                              car.getFinalDestination() != null) {
              Severity: Major
              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 3 hrs to fix

                Method findFinalDestinationForCarLoad has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
                Open

                    private boolean findFinalDestinationForCarLoad(Car car) throws BuildFailedException {
                        if (car.getLoadName().equals(carLoads.getDefaultEmptyName()) ||
                                car.getLoadName().equals(carLoads.getDefaultLoadName()) ||
                                car.getDestination() != null ||
                                car.getFinalDestination() != null) {
                Severity: Minor
                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 3 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 findDestinationsForCarsFromLocation has a Cognitive Complexity of 39 (exceeds 20 allowed). Consider refactoring.
                Open

                    protected void findDestinationsForCarsFromLocation(RouteLocation rl, boolean isSecondPass)
                            throws BuildFailedException {
                        if (_reqNumOfMoves <= 0) {
                            return;
                        }
                Severity: Minor
                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 3 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 generateCarLoadFromStaging has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.
                Open

                    private boolean generateCarLoadFromStaging(Car car, RouteLocation rld) throws BuildFailedException {
                        // Code Check, car should have a track assignment
                        if (car.getTrack() == null) {
                            throw new BuildFailedException(
                                    Bundle.getMessage("buildWarningRsNoTrack", car.toString(), car.getLocationName()));
                Severity: Minor
                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 3 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 checkCarForFinalDestination has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private boolean checkCarForFinalDestination(Car car) {
                        if (car.getFinalDestination() == null || car.getDestination() != null) {
                            return false;
                        }
                
                
                Severity: Major
                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 3 hrs to fix

                  Method generateCarLoadStagingToStaging has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private boolean generateCarLoadStagingToStaging(Car car) throws BuildFailedException {
                          // Code Check, car should have a track assignment
                          if (car.getTrack() == null) {
                              throw new BuildFailedException(
                                      Bundle.getMessage("buildWarningRsNoTrack", car.toString(), car.getLocationName()));
                  Severity: Major
                  Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 3 hrs to fix

                    Method findDestinationsForCarsFromLocation has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected void findDestinationsForCarsFromLocation(RouteLocation rl, boolean isSecondPass)
                                throws BuildFailedException {
                            if (_reqNumOfMoves <= 0) {
                                return;
                            }
                    Severity: Major
                    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 3 hrs to fix

                      Method blockCarsByLocationMoves has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private void blockCarsByLocationMoves() throws BuildFailedException {
                              List<RouteLocation> blockRouteList = _train.getRoute().getLocationsBySequenceList();
                              for (RouteLocation rl : blockRouteList) {
                                  // start at the second location in the route to begin blocking
                                  if (rl == _train.getTrainDepartsRouteLocation()) {
                      Severity: Major
                      Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 2 hrs to fix

                        Method getCarWithFred has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected void getCarWithFred(String road, RouteLocation rl, RouteLocation rld) throws BuildFailedException {
                                // load departure track if staging
                                Track departTrack = null;
                                if (rl == _train.getTrainDepartsRouteLocation()) {
                                    departTrack = _departStageTrack;
                        Severity: Major
                        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 2 hrs to fix

                          Method findDestinationsForCarsWithHomeDivision has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private boolean findDestinationsForCarsWithHomeDivision(Car car) throws BuildFailedException {
                                  if (car.getDivision() == null || car.getDestination() != null || car.getFinalDestination() != null) {
                                      return true;
                                  }
                                  if (car.getDivision() == car.getTrack().getDivision()) {
                          Severity: Major
                          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 2 hrs to fix

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

                                private boolean sendCarToDestinationSpur(Car car, Track track) {
                                    if (!checkBasicMoves(car, track)) {
                                        addLine(_buildReport, SEVEN, Bundle.getMessage("trainCanNotDeliverToDestination", _train.getName(),
                                                car.toString(), track.getLocation().getName(), track.getName()));
                                        return false;
                            Severity: Minor
                            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

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

                                private boolean checkCarForFinalDestination(Car car) {
                                    if (car.getFinalDestination() == null || car.getDestination() != null) {
                                        return false;
                                    }
                            
                            
                            Severity: Minor
                            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.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 sendCarToHomeDivisionTrack has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private boolean sendCarToHomeDivisionTrack(Car car, String trackType, boolean home_division) {
                                    // locations not reachable
                                    List<Location> locationsNotServiced = new ArrayList<>();
                                    List<Track> tracks = locationManager.getTracksByMoves(trackType);
                                    log.debug("Found {} {} tracks", tracks.size(), trackType);
                            Severity: Minor
                            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 1 hr to fix

                              Method sendCarToDestinationTrack has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private boolean sendCarToDestinationTrack(Car car, Track track) {
                                      if (!checkBasicMoves(car, track)) {
                                          addLine(_buildReport, SEVEN, Bundle.getMessage("trainCanNotDeliverToDestination", _train.getName(),
                                                  car.toString(), track.getLocation().getName(), track.getName()));
                                          return false;
                              Severity: Minor
                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 1 hr to fix

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

                                    private boolean generateCarLoadStagingToStaging(Car car) throws BuildFailedException {
                                        // Code Check, car should have a track assignment
                                        if (car.getTrack() == null) {
                                            throw new BuildFailedException(
                                                    Bundle.getMessage("buildWarningRsNoTrack", car.toString(), car.getLocationName()));
                                Severity: Minor
                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.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

                                Avoid too many return statements within this method.
                                Open

                                                        return sendCarToHomeDivisionTrack(car, Track.SPUR, HOME_DIVISION);
                                Severity: Major
                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return false; // move this car, routing failed!
                                  Severity: Major
                                  Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

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

                                      Avoid too many return statements within this method.
                                      Open

                                              return true; // car no longer has a destination, but it had one.
                                      Severity: Major
                                      Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

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

                                          Avoid too many return statements within this method.
                                          Open

                                                  return true; // done, car has a new destination
                                          Severity: Major
                                          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

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

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

                                                          if (car.getLoadType().equals(CarLoad.LOAD_TYPE_EMPTY)) {
                                                              log.debug("Car ({}) has home division ({}) and load type empty", car.toString(), car.getDivisionName());
                                                              if (car.getTrack().isYard() && car.getTrack().getDivision() == car.getDivision()) {
                                                                  log.debug("Car ({}) at it's home division yard", car.toString());
                                                                  if (!sendCarToHomeDivisionTrack(car, Track.STAGING, HOME_DIVISION)) {
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 3 hrs to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 897..920

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 204.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (car.getLoadType().equals(CarLoad.LOAD_TYPE_EMPTY)) {
                                                              log.debug("Car ({}) has home division ({}) and load type empty", car.toString(), car.getDivisionName());
                                                              if (car.getTrack().isYard() && car.getTrack().getDivision() == car.getDivision()) {
                                                                  log.debug("Car ({}) at it's home division yard", car.toString());
                                                                  if (!sendCarToHomeDivisionTrack(car, Track.SPUR, HOME_DIVISION)) {
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 3 hrs to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 871..894

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 204.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (car.getTrack() == departTrack) {
                                                              foundCarWithFred = false;
                                                              if (!generateCarLoadFromStaging(car, rld)) {
                                                                  // departing and terminating into staging?
                                                                  if (car.getTrack().isAddCustomLoadsAnyStagingTrackEnabled() &&
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 2 hrs to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 84..106

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 132.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (car.getTrack() == departTrack) {
                                                              foundCaboose = false;
                                                              if (!generateCarLoadFromStaging(car, rld)) {
                                                                  // departing and terminating into staging?
                                                                  if (car.getTrack().isAddCustomLoadsAnyStagingTrackEnabled() &&
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 2 hrs to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 244..265

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 132.

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

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

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (!checkPickUpTrainDirection(car, rl)) {
                                                                  addLine(_buildReport, SEVEN,
                                                                          Bundle.getMessage("buildExcludeCarTypeAtLoc", car.toString(), car.getTypeName(),
                                                                                  car.getTypeExtensions(), car.getLocationName(), car.getTrackName()));
                                                                  _carList.remove(car); // remove this car from the list
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 50 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 275..281

                                              Duplicated Code

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

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

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

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

                                                              if (!checkPickUpTrainDirection(car, rl)) {
                                                                  addLine(_buildReport, SEVEN, Bundle.getMessage("buildExcludeCarTypeAtLoc", car.toString(),
                                                                          car.getTypeName(), car.getTypeExtensions(), car.getLocationName(), car.getTrackName()));
                                                                  _carList.remove(car); // remove this car from the list
                                                                  _carIndex--;
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 50 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 111..118

                                              Duplicated Code

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

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

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

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

                                                              if (car.getLoadType().equals(CarLoad.LOAD_TYPE_EMPTY) && car.getDivision() != track.getDivision() ||
                                                                      car.getLoadType().equals(CarLoad.LOAD_TYPE_LOAD) &&
                                                                              car.getTrack().getDivision() != car.getDivision() &&
                                                                              car.getDivision() != track.getDivision()) {
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 50 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2588..2592

                                              Duplicated Code

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

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

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

                                                          if (!status.startsWith(Track.LENGTH)) {
                                                              addLine(_buildReport, SEVEN,
                                                                      Bundle.getMessage("buildNoDestTrackNewLoad", StringUtils.capitalize(track.getTrackTypeName()),
                                                                              track.getLocation().getName(), track.getName(), car.toString(), car.getLoadName(),
                                                                              status));
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 50 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1141..1147
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1253..1258

                                              Duplicated Code

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

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

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

                                                          if (!scheduleStatus.equals(Track.OKAY)) {
                                                              addLine(_buildReport, SEVEN,
                                                                      Bundle.getMessage("buildNoDestTrackNewLoad", StringUtils.capitalize(track.getTrackTypeName()),
                                                                              track.getLocation().getName(), track.getName(), car.toString(), car.getLoadName(),
                                                                              scheduleStatus));
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 50 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1133..1139
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1253..1258

                                              Duplicated Code

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

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

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

                                                      if (!status.equals(Track.OKAY)) {
                                                          addLine(_buildReport, SEVEN,
                                                                  Bundle.getMessage("buildNoDestTrackNewLoad", StringUtils.capitalize(track.getTrackTypeName()),
                                                                          track.getLocation().getName(), track.getName(), car.toString(), car.getLoadName(), status));
                                                          return false;
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 50 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1133..1139
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1141..1147

                                              Duplicated Code

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

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

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

                                                      } else {
                                                          addLine(_buildReport, FIVE,
                                                                  Bundle.getMessage("buildCarDepartForeignDivision", car.toString(), car.getTypeName(),
                                                                          car.getLoadType().toLowerCase(),
                                                                          car.getLoadName(), car.getDivisionName(), car.getTrack().getTrackTypeName(),
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 50 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 846..853

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 58.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                      if (car.getDivision() == car.getTrack().getDivision()) {
                                                          addLine(_buildReport, FIVE,
                                                                  Bundle.getMessage("buildCarDepartHomeDivision", car.toString(), car.getTypeName(),
                                                                          car.getLoadType().toLowerCase(),
                                                                          car.getLoadName(), car.getDivisionName(), car.getTrack().getTrackTypeName(),
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 50 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 853..860

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 58.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                                      if (checkAndAddCarForDestinationAndTrack(car, rl, rld)) {
                                                                          if (car.getTrain() == _train) {
                                                                              foundCaboose = true;
                                                                              break;
                                                                          }
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 45 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 180..188

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 56.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                                  if (checkAndAddCarForDestinationAndTrack(car, rl, rld)) {
                                                                      if (car.getTrain() == _train) {
                                                                          foundCaboose = true;
                                                                          break;
                                                                      }
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 45 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 153..161

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 56.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          if (!car.getTrack().isDestinationAccepted(track.getLocation())) {
                                                              addLine(_buildReport, SEVEN, Bundle.getMessage("buildDestinationNotServiced",
                                                                      track.getLocation().getName(), car.getTrackName()));
                                                              // location not reachable
                                                              locationsNotServiced.add(track.getLocation());
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 4 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 632..637
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 780..785
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 953..959
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1074..1079

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          if (!car.getTrack().isDestinationAccepted(track.getLocation())) {
                                                              addLine(_buildReport, SEVEN, Bundle.getMessage("buildDestinationNotServiced",
                                                                      track.getLocation().getName(), car.getTrackName()));
                                                              locationsNotServiced.add(track.getLocation());
                                                              continue;
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 4 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 780..785
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 953..959
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1033..1039
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1074..1079

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          if (!car.getTrack().isDestinationAccepted(track.getLocation())) {
                                                              addLine(_buildReport, SEVEN, Bundle.getMessage("buildDestinationNotServiced",
                                                                      track.getLocation().getName(), car.getTrackName()));
                                                              // location not reachable
                                                              locationsNotServiced.add(track.getLocation());
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 4 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 632..637
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 780..785
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1033..1039
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1074..1079

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                              if (!car.getTrack().isDestinationAccepted(track.getLocation())) {
                                                                  addLine(_buildReport, SEVEN, Bundle.getMessage("buildDestinationNotServiced",
                                                                          track.getLocation().getName(), car.getTrackName()));
                                                                  locationsNotServiced.add(track.getLocation());
                                                                  continue;
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 4 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 632..637
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 780..785
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 953..959
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1033..1039

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          if (!car.getTrack().isDestinationAccepted(track.getLocation())) {
                                                              addLine(_buildReport, SEVEN, Bundle.getMessage("buildDestinationNotServiced",
                                                                      track.getLocation().getName(), car.getTrackName()));
                                                              locationsNotServiced.add(track.getLocation());
                                                              continue;
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 4 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 632..637
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 953..959
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1033..1039
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1074..1079

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                      if (car.getKernel() != null) {
                                                          addLine(_buildReport, SEVEN, Bundle.getMessage("buildCarLeadKernel", car.toString(), car.getKernelName(),
                                                                  car.getKernel().getSize(), car.getKernel().getTotalLength(), Setup.getLengthUnit().toLowerCase()));
                                                      }
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 3 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 612..617
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 861..866
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1010..1015

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                      if (car.getKernel() != null) {
                                                          addLine(_buildReport, SEVEN,
                                                                  Bundle.getMessage("buildCarLeadKernel", car.toString(), car.getKernelName(),
                                                                          car.getKernel().getSize(), car.getKernel().getTotalLength(),
                                                                          Setup.getLengthUnit().toLowerCase()));
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 3 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 612..617
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 861..866
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1604..1607

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                      if (car.getKernel() != null) {
                                                          addLine(_buildReport, SEVEN,
                                                                  Bundle.getMessage("buildCarLeadKernel", car.toString(), car.getKernelName(),
                                                                          car.getKernel().getSize(), car.getKernel().getTotalLength(),
                                                                          Setup.getLengthUnit().toLowerCase()));
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 3 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 861..866
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1010..1015
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1604..1607

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                      if (car.getKernel() != null) {
                                                          addLine(_buildReport, SEVEN,
                                                                  Bundle.getMessage("buildCarLeadKernel", car.toString(), car.getKernelName(),
                                                                          car.getKernel().getSize(),
                                                                          car.getKernel().getTotalLength(), Setup.getLengthUnit().toLowerCase()));
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 3 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 612..617
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1010..1015
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1604..1607

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          if (rld.getCarMoves() >= rld.getMaxCarMoves()) {
                                                              addLine(_buildReport, FIVE,
                                                                      Bundle.getMessage("buildNoAvailableMovesDest", rld.getCarMoves(), rld.getMaxCarMoves(),
                                                                              _train.getRoute().getName(), rld.getId(), rld.getName()));
                                                              continue;
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1663..1668

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          if (rld.getCarMoves() >= rld.getMaxCarMoves()) {
                                                              addLine(_buildReport, FIVE,
                                                                      Bundle.getMessage("buildNoAvailableMovesDest", rld.getCarMoves(), rld.getMaxCarMoves(),
                                                                              _train.getRoute().getName(), rld.getId(), rld.getName()));
                                                              continue;
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1457..1462

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 52.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                              addLine(_buildReport, SEVEN,
                                                                      Bundle.getMessage("buildCarHasDivisionStaging", car.toString(), car.getTypeName(),
                                                                              car.getLoadType().toLowerCase(), car.getLoadName(), car.getDivisionName(),
                                                                              car.getLocationName(), car.getTrackName(), car.getTrack().getDivisionName()));
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2580..2584

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 50.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                                              car.getDivision() != track.getDivision()) {
                                                                  addLine(_buildReport, SEVEN,
                                                                          Bundle.getMessage("buildNoDivisionTrack", track.getTrackTypeName(),
                                                                                  track.getLocation().getName(), track.getName(), track.getDivisionName(),
                                                                                  car.toString(), car.getLoadType().toLowerCase(), car.getLoadName()));
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 681..687
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 942..949

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 50.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          if (home_division && car.getDivision() != track.getDivision()) {
                                                              addLine(_buildReport, SEVEN,
                                                                      Bundle.getMessage("buildNoDivisionTrack", track.getTrackTypeName(),
                                                                              track.getLocation().getName(), track.getName(), track.getDivisionName(), car.toString(),
                                                                              car.getLoadType().toLowerCase(),
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 673..679
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 681..687

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 50.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          if (!track.isSpaceAvailable(car)) {
                                                              addLine(_buildReport, SEVEN,
                                                                      Bundle.getMessage("buildNoDestTrackSpace", car.toString(), track.getLocation().getName(),
                                                                              track.getName(), track.getNumberOfCarsInRoute(), track.getReservedInRoute(),
                                                                              Setup.getLengthUnit().toLowerCase(), track.getReservationFactor()));
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 673..679
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 942..949

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 50.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                      if (!checkBasicMoves(car, track)) {
                                                          addLine(_buildReport, SEVEN, Bundle.getMessage("trainCanNotDeliverToDestination", _train.getName(),
                                                                  car.toString(), track.getLocation().getName(), track.getName()));
                                                          return false;
                                                      }
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1120..1124

                                              Duplicated Code

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

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

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

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

                                                      if (!checkBasicMoves(car, track)) {
                                                          addLine(_buildReport, SEVEN, Bundle.getMessage("trainCanNotDeliverToDestination", _train.getName(),
                                                                  car.toString(), track.getLocation().getName(), track.getName()));
                                                          return false;
                                                      }
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 40 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1247..1251

                                              Duplicated Code

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

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

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

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

                                                              addLine(_buildReport, SEVEN,
                                                                      Bundle.getMessage("buildNoDestSpace", car.toString(), track.getTrackTypeName(),
                                                                              track.getLocation().getName(), track.getName(), track.getNumberOfCarsInRoute(),
                                                                              track.getReservedInRoute(), Setup.getLengthUnit().toLowerCase()));
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 35 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1260..1263

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 46.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          addLine(_buildReport, SEVEN,
                                                                  Bundle.getMessage("buildNoDestSpace", car.toString(), track.getTrackTypeName(),
                                                                          track.getLocation().getName(), track.getName(), track.getNumberOfCarsInRoute(),
                                                                          track.getReservedInRoute(), Setup.getLengthUnit().toLowerCase()));
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 35 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1201..1204

                                              Duplicated Code

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

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

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

                                                      addLine(_buildReport, FIVE, Bundle.getMessage("buildFindDestinationForCar", car.toString(), car.getTypeName(),
                                                              car.getLoadType().toLowerCase(), car.getLoadName(), car.getTrackType(), car.getLocationName(),
                                                              car.getTrackName()));
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 35 mins to fix
                                              java/src/jmri/jmrit/operations/router/Router.java on lines 323..325
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1006..1009

                                              Duplicated Code

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

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

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

                                                      addLine(_buildReport, FIVE,
                                                              Bundle.getMessage("buildSearchForSpur", car.toString(), car.getTypeName(),
                                                                      car.getLoadType().toLowerCase(), car.getLoadName(), car.getTrackType(), car.getLocationName(),
                                                                      car.getTrackName()));
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 35 mins to fix
                                              java/src/jmri/jmrit/operations/router/Router.java on lines 323..325
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1601..1603

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 44.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                          if (car.getTrack() == _departStageTrack &&
                                                                  (car.getDestination() == null || car.getDestinationTrack() == null || car.getTrain() == null)) {
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 30 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1298..1299
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1346..1347

                                              Duplicated Code

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

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

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

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

                                                          if (_train.isLocationSkipped(rld.getId())) {
                                                              addLine(_buildReport, FIVE,
                                                                      Bundle.getMessage("buildLocSkipped", rld.getName(), rld.getId(), _train.getName()));
                                                              continue;
                                                          }
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 30 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilder.java on lines 385..389
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1657..1661

                                              Duplicated Code

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

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

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

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

                                                          if (_train.isLocationSkipped(rld.getId())) {
                                                              addLine(_buildReport, FIVE,
                                                                      Bundle.getMessage("buildLocSkipped", rld.getName(), rld.getId(), _train.getName()));
                                                              continue;
                                                          }
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 2 other locations - About 30 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilder.java on lines 385..389
                                              java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 1451..1455

                                              Duplicated Code

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

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

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

                                                          if (!rld.isDropAllowed()) {
                                                              addLine(_buildReport, FIVE, Bundle.getMessage("buildRouteNoDropLocation", _train.getRoute().getName(),
                                                                      rld.getId(), rld.getName()));
                                                              continue;
                                                          }
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java and 1 other location - About 30 mins to fix
                                              java/src/jmri/jmrit/operations/trains/TrainBuilder.java on lines 390..394

                                              Duplicated Code

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

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

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