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

Summary

Maintainability
F
1 mo
Test Coverage

File TrainBuilderBase.java has 2608 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.operations.trains;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
Severity: Major
Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 wk to fix

    Method getCarList has a Cognitive Complexity of 118 (exceeds 20 allowed). Consider refactoring.
    Open

        protected void getCarList() throws BuildFailedException {
            // get list of cars for this route
            _carList = carManager.getAvailableTrainList(_train);
            addLine(_buildReport, SEVEN, BLANK_LINE);
            addLine(_buildReport, SEVEN, Bundle.getMessage("buildRemoveCars"));
    Severity: Minor
    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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

    TrainBuilderBase has 78 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class TrainBuilderBase extends TrainCommon {
    
        // report levels
        protected static final String ONE = Setup.BUILD_REPORT_MINIMAL;
        protected static final String THREE = Setup.BUILD_REPORT_NORMAL;
    Severity: Major
    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 day to fix

      Method getCarList has 203 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected void getCarList() throws BuildFailedException {
              // get list of cars for this route
              _carList = carManager.getAvailableTrainList(_train);
              addLine(_buildReport, SEVEN, BLANK_LINE);
              addLine(_buildReport, SEVEN, Bundle.getMessage("buildRemoveCars"));
      Severity: Major
      Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 day to fix

        Method getEngines has a Cognitive Complexity of 63 (exceeds 20 allowed). Consider refactoring.
        Open

            protected boolean getEngines(String requestedEngines, String model, String road, RouteLocation rl,
                    RouteLocation rld, boolean useBunit) throws BuildFailedException {
                // load departure track if staging
                Track departStageTrack = null;
                if (rl == _train.getTrainDepartsRouteLocation()) {
        Severity: Minor
        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 checkStagingCarTypeRoadLoadOwnerBuiltCabooseOrFRED has a Cognitive Complexity of 56 (exceeds 20 allowed). Consider refactoring.
        Open

            private boolean checkStagingCarTypeRoadLoadOwnerBuiltCabooseOrFRED(Track departStageTrack) {
                boolean foundCaboose = false;
                boolean foundFRED = false;
                if (departStageTrack.getNumberCars() > 0) {
                    for (Car car : carManager.getList()) {
        Severity: Minor
        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 6 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method showTrainBuildOptions has a Cognitive Complexity of 56 (exceeds 20 allowed). Consider refactoring.
        Open

            protected void showTrainBuildOptions() {
                ResourceBundle rb = ResourceBundle.getBundle("jmri.jmrit.operations.setup.JmritOperationsSetupBundle");
                addLine(_buildReport, FIVE, Bundle.getMessage("MenuItemBuildOptions") + ":");
                if (Setup.isBuildAggressive()) {
                    addLine(_buildReport, FIVE, Bundle.getMessage("BuildModeAggressive"));
        Severity: Minor
        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 6 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            protected void showCarsByLocation() throws BuildFailedException {
                // show how many cars were found
                addLine(_buildReport, FIVE, BLANK_LINE);
                addLine(_buildReport, ONE,
                        Bundle.getMessage("buildFoundCars", Integer.toString(_carList.size()), _train.getName()));
        Severity: Minor
        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 generateLoadCarDepartingAndTerminatingIntoStaging has 124 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected boolean generateLoadCarDepartingAndTerminatingIntoStaging(Car car, Track stageTrack)
                    throws BuildFailedException {
                // code check
                if (stageTrack == null || !stageTrack.isStaging()) {
                    throw new BuildFailedException("ERROR coding issue, staging track null or not staging");
        Severity: Major
        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 4 hrs to fix

          Method getNewEngine has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring.
          Open

              protected void getNewEngine(int hpNeeded, Engine leadEngine, String model, String road)
                      throws BuildFailedException {
                  // save lead engine's rl, and rld
                  RouteLocation rl = leadEngine.getRouteLocation();
                  RouteLocation rld = leadEngine.getRouteDestination();
          Severity: Minor
          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 getEngines has 120 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected boolean getEngines(String requestedEngines, String model, String road, RouteLocation rl,
                      RouteLocation rld, boolean useBunit) throws BuildFailedException {
                  // load departure track if staging
                  Track departStageTrack = null;
                  if (rl == _train.getTrainDepartsRouteLocation()) {
          Severity: Major
          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 4 hrs to fix

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

                protected boolean generateLoadCarDepartingAndTerminatingIntoStaging(Car car, Track stageTrack)
                        throws BuildFailedException {
                    // code check
                    if (stageTrack == null || !stageTrack.isStaging()) {
                        throw new BuildFailedException("ERROR coding issue, staging track null or not staging");
            Severity: Minor
            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 showAndInitializeTrainRoute has 99 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected void showAndInitializeTrainRoute() throws BuildFailedException {
                    int requestedCarMoves = 0; // how many cars were asked to be moved
                    // TODO: DAB control minimal build by each train
            
                    addLine(_buildReport, THREE,
            Severity: Major
            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 3 hrs to fix

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

                  private boolean checkStagingEngines(Track departStageTrack) {
                      if (departStageTrack.getNumberEngines() > 0) {
                          for (Engine eng : engineManager.getList()) {
                              if (eng.getTrack() == departStageTrack) {
                                  // has engine been assigned to another train?
              Severity: Minor
              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 checkStagingCarTypeRoadLoadOwnerBuiltCabooseOrFRED has 88 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private boolean checkStagingCarTypeRoadLoadOwnerBuiltCabooseOrFRED(Track departStageTrack) {
                      boolean foundCaboose = false;
                      boolean foundFRED = false;
                      if (departStageTrack.getNumberCars() > 0) {
                          for (Car car : carManager.getList()) {
              Severity: Major
              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 3 hrs to fix

                Method showTrainBuildOptions has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected void showTrainBuildOptions() {
                        ResourceBundle rb = ResourceBundle.getBundle("jmri.jmrit.operations.setup.JmritOperationsSetupBundle");
                        addLine(_buildReport, FIVE, Bundle.getMessage("MenuItemBuildOptions") + ":");
                        if (Setup.isBuildAggressive()) {
                            addLine(_buildReport, FIVE, Bundle.getMessage("BuildModeAggressive"));
                Severity: Major
                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 3 hrs to fix

                  Method getTracksAtDestination has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected List<Track> getTracksAtDestination(Car car, RouteLocation rld) {
                          List<Track> tracks = new ArrayList<>();
                          Location testDestination = rld.getLocation();
                          // first report if there are any alternate tracks
                          for (Track track : testDestination.getTracksByNameList(null)) {
                  Severity: Major
                  Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 2 hrs to fix

                    Method showCarsByLocation has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected void showCarsByLocation() throws BuildFailedException {
                            // show how many cars were found
                            addLine(_buildReport, FIVE, BLANK_LINE);
                            addLine(_buildReport, ONE,
                                    Bundle.getMessage("buildFoundCars", Integer.toString(_carList.size()), _train.getName()));
                    Severity: Major
                    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 2 hrs to fix

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

                          protected void showAndInitializeTrainRoute() throws BuildFailedException {
                              int requestedCarMoves = 0; // how many cars were asked to be moved
                              // TODO: DAB control minimal build by each train
                      
                              addLine(_buildReport, THREE,
                      Severity: Minor
                      Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 checkScheduleItem has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private ScheduleItem checkScheduleItem(ScheduleItem si, Car car, Track track) {
                              if (!car.getTypeName().equals(si.getTypeName()) ||
                                      si.getReceiveLoadName().equals(ScheduleItem.NONE) ||
                                      si.getReceiveLoadName().equals(carLoads.getDefaultEmptyName()) ||
                                      si.getReceiveLoadName().equals(carLoads.getDefaultLoadName())) {
                      Severity: Major
                      Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 2 hrs to fix

                        Method showTrainRequirements has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected void showTrainRequirements() {
                                addLine(_buildReport, ONE, Bundle.getMessage("TrainRequirements"));
                                if (_train.getNumberEngines().equals("0")) {
                                    addLine(_buildReport, ONE, Bundle.getMessage("buildTrainReq0Engine"));
                                } else if (_train.getNumberEngines().equals("1")) {
                        Severity: Major
                        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 2 hrs to fix

                          Method checkStagingEngines has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private boolean checkStagingEngines(Track departStageTrack) {
                                  if (departStageTrack.getNumberEngines() > 0) {
                                      for (Engine eng : engineManager.getList()) {
                                          if (eng.getTrack() == departStageTrack) {
                                              // has engine been assigned to another train?
                          Severity: Major
                          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 2 hrs to fix

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

                                protected boolean redirectCarsFromAlternateTrack() throws BuildFailedException {
                                    // code check, should be aggressive
                                    if (!Setup.isBuildAggressive()) {
                                        throw new BuildFailedException("ERROR coding issue, should be using aggressive mode");
                                    }
                            Severity: Minor
                            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                  private boolean checkStagingPool(Track departStageTrack) {
                                      if (departStageTrack.getPool() == null ||
                                              departStageTrack.getServiceOrder().equals(Track.NORMAL) ||
                                              departStageTrack.getNumberCars() == 0) {
                                          return true;
                              Severity: Minor
                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                    private boolean buildConsistFromSingleLocos(int reqNumberEngines, List<Engine> singleLocos, RouteLocation rl,
                                            RouteLocation rld) {
                                        addLine(_buildReport, FIVE, Bundle.getMessage("buildOptionBuildConsist", reqNumberEngines, rl.getName()));
                                        addLine(_buildReport, FIVE, Bundle.getMessage("buildOptionSingleLocos", singleLocos.size(), rl.getName()));
                                        if (singleLocos.size() >= reqNumberEngines) {
                                Severity: Minor
                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 checkTerminateStagingTrack has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected boolean checkTerminateStagingTrack(Track terminateStageTrack) {
                                        if (!terminateStageTrack.isDropTrainAccepted(_train)) {
                                            addLine(_buildReport, FIVE, Bundle.getMessage("buildStagingNotTrain", terminateStageTrack.getName()));
                                            return false;
                                        }
                                Severity: Minor
                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                      protected void adjustCarsInStaging() throws BuildFailedException {
                                          if (!_train.isDepartingStaging()) {
                                              return; // not departing staging
                                          }
                                          int numCarsFromStaging = 0;
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                        protected void getNewEngine(int hpNeeded, Engine leadEngine, String model, String road)
                                                throws BuildFailedException {
                                            // save lead engine's rl, and rld
                                            RouteLocation rl = leadEngine.getRouteLocation();
                                            RouteLocation rld = leadEngine.getRouteDestination();
                                    Severity: Minor
                                    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

                                      Method checkDepartureStagingTrack has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected boolean checkDepartureStagingTrack(Track departStageTrack) {
                                              addLine(_buildReport, THREE,
                                                      Bundle.getMessage("buildStagingHas", departStageTrack.getName(),
                                                              Integer.toString(departStageTrack.getNumberEngines()),
                                                              Integer.toString(departStageTrack.getNumberCars())));
                                      Severity: Minor
                                      Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

                                        Method checkTerminateStagingTrackRestrictions has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private boolean checkTerminateStagingTrackRestrictions(Track terminateStageTrack) {
                                                // check go see if location/track will accept the train's car and engine
                                                // types
                                                for (String name : _train.getTypeNames()) {
                                                    if (!_terminateLocation.acceptsTypeName(name)) {
                                        Severity: Minor
                                        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

                                          Method addEnginesBasedHPT has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              protected void addEnginesBasedHPT(int hpAvailable, int extraHpNeeded, RouteLocation rlNeedHp, RouteLocation rl,
                                                      RouteLocation rld) throws BuildFailedException {
                                                  if (rlNeedHp == null) {
                                                      return;
                                                  }
                                          Severity: Minor
                                          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

                                            Method checkStagingPool has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
                                            Open

                                                private boolean checkStagingPool(Track departStageTrack) {
                                                    if (departStageTrack.getPool() == null ||
                                                            departStageTrack.getServiceOrder().equals(Track.NORMAL) ||
                                                            departStageTrack.getNumberCars() == 0) {
                                                        return true;
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 addCarToTrain has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                protected void addCarToTrain(Car car, RouteLocation rl, RouteLocation rld, Track track) {
                                                    addLine(_buildReport, THREE,
                                                            Bundle.getMessage("buildCarAssignedDest", car.toString(), rld.getName(), track.getName()));
                                                    car.setDestination(track.getLocation(), track);
                                                    int length = car.getTotalLength();
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

                                              Method sortCarsOnFifoLifoTracks has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  protected void sortCarsOnFifoLifoTracks() {
                                                      addLine(_buildReport, SEVEN, Bundle.getMessage("buildSortCarsByLastDate"));
                                                      for (_carIndex = 0; _carIndex < _carList.size(); _carIndex++) {
                                                          Car car = _carList.get(_carIndex);
                                                          if (car.getTrack().getServiceOrder().equals(Track.NORMAL) || car.getTrack().isStaging()) {
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                    protected void sortCarsOnFifoLifoTracks() {
                                                        addLine(_buildReport, SEVEN, Bundle.getMessage("buildSortCarsByLastDate"));
                                                        for (_carIndex = 0; _carIndex < _carList.size(); _carIndex++) {
                                                            Car car = _carList.get(_carIndex);
                                                            if (car.getTrack().getServiceOrder().equals(Track.NORMAL) || car.getTrack().isStaging()) {
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 checkDropTrainDirection has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    protected boolean checkDropTrainDirection(RollingStock rs, RouteLocation rld, Track track) {
                                                        // local?
                                                        if (_train.isLocalSwitcher()) {
                                                            return true;
                                                        }
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                      private boolean buildConsistFromSingleLocos(int reqNumberEngines, List<Engine> singleLocos, RouteLocation rl,
                                                              RouteLocation rld) {
                                                          addLine(_buildReport, FIVE, Bundle.getMessage("buildOptionBuildConsist", reqNumberEngines, rl.getName()));
                                                          addLine(_buildReport, FIVE, Bundle.getMessage("buildOptionSingleLocos", singleLocos.size(), rl.getName()));
                                                          if (singleLocos.size() >= reqNumberEngines) {
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                        protected boolean redirectCarsFromAlternateTrack() throws BuildFailedException {
                                                            // code check, should be aggressive
                                                            if (!Setup.isBuildAggressive()) {
                                                                throw new BuildFailedException("ERROR coding issue, should be using aggressive mode");
                                                            }
                                                    Severity: Minor
                                                    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 getScheduleItem has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        protected ScheduleItem getScheduleItem(Car car, Track track) throws BuildFailedException {
                                                            if (track.getSchedule() == null) {
                                                                return null;
                                                            }
                                                            if (!track.isTypeNameAccepted(car.getTypeName())) {
                                                    Severity: Minor
                                                    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

                                                      Method getAutoEngines has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          private int getAutoEngines() {
                                                              double numberEngines = 1;
                                                              int moves = 0;
                                                              int carLength = 40 + Car.COUPLERS; // typical 40' car
                                                      
                                                      
                                                      Severity: Minor
                                                      Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                            protected boolean setEngineDestination(Engine engine, RouteLocation rl, RouteLocation rld) {
                                                                // engine to staging?
                                                                if (rld == _train.getTrainTerminatesRouteLocation() && _terminateStageTrack != null) {
                                                                    String status = engine.checkDestination(_terminateStageTrack.getLocation(), _terminateStageTrack);
                                                                    if (status.equals(Track.OKAY)) {
                                                        Severity: Minor
                                                        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                              protected List<Track> getTracksAtDestination(Car car, RouteLocation rld) {
                                                                  List<Track> tracks = new ArrayList<>();
                                                                  Location testDestination = rld.getLocation();
                                                                  // first report if there are any alternate tracks
                                                                  for (Track track : testDestination.getTracksByNameList(null)) {
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 showSpecificTrainBuildOptions has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                              private void showSpecificTrainBuildOptions(boolean enabled) {
                                                          
                                                                  if (_train.isBuildTrainNormalEnabled() ^ !enabled) {
                                                                      addLine(_buildReport, FIVE, Bundle.getMessage("NormalModeWhenBuilding"));
                                                                  }
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

                                                            Method checkTerminateStagingTrackRestrictions has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                                                            Open

                                                                private boolean checkTerminateStagingTrackRestrictions(Track terminateStageTrack) {
                                                                    // check go see if location/track will accept the train's car and engine
                                                                    // types
                                                                    for (String name : _train.getTypeNames()) {
                                                                        if (!_terminateLocation.acceptsTypeName(name)) {
                                                            Severity: Minor
                                                            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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 promptFromStagingDialog has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                protected Track promptFromStagingDialog() {
                                                                    List<Track> tracksIn = _departLocation.getTracksByNameList(null);
                                                                    List<Track> validTracks = new ArrayList<>();
                                                                    // only show valid tracks
                                                                    for (Track track : tracksIn) {
                                                            Severity: Minor
                                                            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                                  protected Track tryStaging(Car car, RouteLocation rldSave) throws BuildFailedException {
                                                                      // local switcher working staging?
                                                                      if (_train.isLocalSwitcher() &&
                                                                              !car.isPassenger() &&
                                                                              !car.isCaboose() &&
                                                              Severity: Minor
                                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                                    protected void showEnginesByLocation() {
                                                                        // show how many engines were found
                                                                        addLine(_buildReport, SEVEN, BLANK_LINE);
                                                                        addLine(_buildReport, ONE,
                                                                                Bundle.getMessage("buildFoundLocos", Integer.toString(_engineList.size()), _train.getName()));
                                                                Severity: Minor
                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                                      protected boolean checkForLaterPickUp(Car car, RouteLocation rl, RouteLocation rld) throws BuildFailedException {
                                                                          if (rl != rld && rld.getName().equals(car.getLocationName())) {
                                                                              // don't delay adding a caboose, passenger car, or car with FRED
                                                                              if (car.isCaboose() || car.isPassenger() || car.hasFred()) {
                                                                                  return false;
                                                                  Severity: Minor
                                                                  Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                                        protected void showBuildReportInfo() {
                                                                            addLine(_buildReport, ONE, Bundle.getMessage("BuildReportMsg", _train.getName(), _startTime));
                                                                            addLine(_buildReport, ONE,
                                                                                    Bundle.getMessage("BuildReportVersion", Version.name()));
                                                                            if (!trainScheduleManager.getTrainScheduleActiveId().equals(TrainScheduleManager.NONE)) {
                                                                    Severity: Minor
                                                                    Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

                                                                      Consider simplifying this complex logical expression.
                                                                      Open

                                                                              if (!_train.isAllowThroughCarsEnabled() &&
                                                                                      !_train.isLocalSwitcher() &&
                                                                                      !car.isCaboose() &&
                                                                                      !car.hasFred() &&
                                                                                      !car.isPassenger() &&
                                                                      Severity: Critical
                                                                      Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 1 hr to fix

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

                                                                            protected void adjustCarsInStaging() throws BuildFailedException {
                                                                                if (!_train.isDepartingStaging()) {
                                                                                    return; // not departing staging
                                                                                }
                                                                                int numCarsFromStaging = 0;
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 45 mins to fix

                                                                        Cognitive Complexity

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

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

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

                                                                        Further reading

                                                                        Consider simplifying this complex logical expression.
                                                                        Open

                                                                                        if (!car.isCaboose() &&
                                                                                                !car.isPassenger() &&
                                                                                                (!car.getLoadName().equals(carLoads.getDefaultEmptyName()) ||
                                                                                                        !departStageTrack.isAddCustomLoadsEnabled() &&
                                                                                                                !departStageTrack.isAddCustomLoadsAnySpurEnabled() &&
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 40 mins to fix

                                                                          Consider simplifying this complex logical expression.
                                                                          Open

                                                                                  } else if (status.startsWith(Track.LOAD) &&
                                                                                          car.getTrack() == _departStageTrack &&
                                                                                          car.getLoadName().equals(carLoads.getDefaultEmptyName()) &&
                                                                                          rldSave == null &&
                                                                                          (_departStageTrack.isAddCustomLoadsAnyStagingTrackEnabled() ||
                                                                          Severity: Major
                                                                          Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 40 mins to fix

                                                                            Method getEngines has 6 arguments (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                                protected boolean getEngines(String requestedEngines, String model, String road, RouteLocation rl,
                                                                                        RouteLocation rld, boolean useBunit) throws BuildFailedException {
                                                                            Severity: Minor
                                                                            Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java - About 35 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                          return false;
                                                                              Severity: Major
                                                                              Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.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/TrainBuilderBase.java - About 30 mins to fix

                                                                                                              Avoid too many return statements within this method.
                                                                                                              Open

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

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

                                                                                                                        if (validTracks.size() > 1) {
                                                                                                                            // need an object array for dialog window
                                                                                                                            Object[] tracks = new Object[validTracks.size()];
                                                                                                                            for (int i = 0; i < validTracks.size(); i++) {
                                                                                                                                tracks[i] = validTracks.get(i);
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 2 hrs to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 592..607

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 136.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                        if (validTracks.size() > 1) {
                                                                                                                            // need an object array for dialog window
                                                                                                                            Object[] tracks = new Object[validTracks.size()];
                                                                                                                            for (int i = 0; i < validTracks.size(); i++) {
                                                                                                                                tracks[i] = validTracks.get(i);
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 2 hrs to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 630..645

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 136.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                        if (!si.getRoadName().equals(ScheduleItem.NONE) && !car.getRoadName().equals(si.getRoadName())) {
                                                                                                                            log.debug("Not using track ({}) schedule request type ({}) road ({}) load ({})", track.getName(),
                                                                                                                                    si.getTypeName(), si.getRoadName(), si.getReceiveLoadName()); // NOI18N
                                                                                                                            if (!Setup.getRouterBuildReportLevel().equals(Setup.BUILD_REPORT_NORMAL)) {
                                                                                                                                addLine(_buildReport, SEVEN,
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 1 hr to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2151..2161

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 96.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                si.getReceiveLoadName().equals(carLoads.getDefaultLoadName())) {
                                                                                                                            log.debug("Not using track ({}) schedule request type ({}) road ({}) load ({})", track.getName(),
                                                                                                                                    si.getTypeName(), si.getRoadName(), si.getReceiveLoadName()); // NOI18N
                                                                                                                            if (!Setup.getRouterBuildReportLevel().equals(Setup.BUILD_REPORT_NORMAL)) {
                                                                                                                                addLine(_buildReport, SEVEN,
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 1 hr to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2162..2172

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 96.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                            if (car.isOutOfService()) {
                                                                                                                                addLine(_buildReport, SEVEN, Bundle.getMessage("buildExcludeCarOutOfService", car.toString(),
                                                                                                                                        car.getLocationName(), car.getTrackName()));
                                                                                                                                if (car.getTrack().equals(_departStageTrack)) {
                                                                                                                                    throw new BuildFailedException(
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 1 hr to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 721..731

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 84.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                            if (car.isLocationUnknown()) {
                                                                                                                                addLine(_buildReport, SEVEN, Bundle.getMessage("buildExcludeCarLocUnknown", car.toString(),
                                                                                                                                        car.getLocationName(), car.getTrackName()));
                                                                                                                                if (car.getTrack().equals(_departStageTrack)) {
                                                                                                                                    throw new BuildFailedException(Bundle.getMessage("buildErrorLocationUnknown", car.getLocationName(),
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 1 hr to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 733..744

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 84.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

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

                                                                                                                Duplicated Code

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

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

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

                                                                                                                                if (!_train.isBuiltDateAccepted(car.getBuilt())) {
                                                                                                                                    addLine(_buildReport, SEVEN,
                                                                                                                                            Bundle.getMessage("buildExcludeCarBuiltAtLoc", car.toString(), car.getBuilt(),
                                                                                                                                                    car.getLocationName(), car.getTrackName()));
                                                                                                                                    _carList.remove(car);
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 50 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 850..857

                                                                                                                Duplicated Code

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

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

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

                                                                                                                        if ((_train.getThirdLegOptions() & Train.REMOVE_CABOOSE) == Train.REMOVE_CABOOSE ||
                                                                                                                                (_train.getThirdLegOptions() & Train.ADD_CABOOSE) == Train.ADD_CABOOSE) {
                                                                                                                            addLine(_buildReport, ONE, Bundle.getMessage("buildCabooseChange", _train.getThirdLegStartRouteLocation()));
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 50 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 526..530

                                                                                                                Duplicated Code

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

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

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

                                                                                                                                if (!_train.isOwnerNameAccepted(car.getOwnerName())) {
                                                                                                                                    addLine(_buildReport, SEVEN,
                                                                                                                                            Bundle.getMessage("buildExcludeCarOwnerAtLoc", car.toString(), car.getOwnerName(),
                                                                                                                                                    car.getLocationName(), car.getTrackName()));
                                                                                                                                    _carList.remove(car);
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 50 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 858..865

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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("buildTrackHasPlannedPickups", terminateStageTrack.getName(),
                                                                                                                                                terminateStageTrack.getIgnoreUsedLengthPercentage(), terminateStageTrack.getLength(),
                                                                                                                                                Setup.getLengthUnit().toLowerCase(), terminateStageTrack.getUsedLength(), terminateStageTrack.getReserved(),
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 50 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2265..2273

                                                                                                                Duplicated Code

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

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

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

                                                                                                                        if ((_train.getSecondLegOptions() & Train.REMOVE_CABOOSE) == Train.REMOVE_CABOOSE ||
                                                                                                                                (_train.getSecondLegOptions() & Train.ADD_CABOOSE) == Train.ADD_CABOOSE) {
                                                                                                                            addLine(_buildReport, ONE,
                                                                                                                                    Bundle.getMessage("buildCabooseChange", _train.getSecondLegStartRouteLocation()));
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 50 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 531..534

                                                                                                                Duplicated Code

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

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

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

                                                                                                                            if (testTrack.getIgnoreUsedLengthPercentage() > Track.IGNORE_0) {
                                                                                                                                addLine(_buildReport, SEVEN,
                                                                                                                                        Bundle.getMessage("buildTrackHasPlannedPickups", testTrack.getName(),
                                                                                                                                                testTrack.getIgnoreUsedLengthPercentage(), testTrack.getLength(),
                                                                                                                                                Setup.getLengthUnit().toLowerCase(), testTrack.getUsedLength(), testTrack.getReserved(),
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 50 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1963..1971

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 60.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                            if (status.equals(Track.OKAY)) {
                                                                                                                                addEngineToTrain(engine, rl, rld, _terminateStageTrack);
                                                                                                                                return true; // done
                                                                                                                            } else {
                                                                                                                                addLine(_buildReport, SEVEN,
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 50 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 3061..3067

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (status.equals(Track.OKAY)) {
                                                                                                                                    addEngineToTrain(engine, rl, rld, track);
                                                                                                                                    return true;
                                                                                                                                } else {
                                                                                                                                    addLine(_buildReport, SEVEN, Bundle.getMessage("buildCanNotDropEngineToTrack", engine.toString(),
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 50 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 3041..3048

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 ((_train.getThirdLegOptions() & Train.HELPER_ENGINES) == Train.HELPER_ENGINES) {
                                                                                                                            addLine(_buildReport, ONE,
                                                                                                                                    Bundle.getMessage("buildTrainHelperEngines", _train.getThirdLegNumberEngines(),
                                                                                                                                            _train.getThirdLegStartLocationName(), _train.getThirdLegEndLocationName(),
                                                                                                                                            _train.getThirdLegEngineModel(), _train.getThirdLegEngineRoad()));
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 45 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 502..507

                                                                                                                Duplicated Code

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

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

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

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

                                                                                                                        if ((_train.getSecondLegOptions() & Train.HELPER_ENGINES) == Train.HELPER_ENGINES) {
                                                                                                                            addLine(_buildReport, ONE,
                                                                                                                                    Bundle.getMessage("buildTrainHelperEngines", _train.getSecondLegNumberEngines(),
                                                                                                                                            _train.getSecondLegStartLocationName(), _train.getSecondLegEndLocationName(),
                                                                                                                                            _train.getSecondLegEngineModel(), _train.getSecondLegEngineRoad()));
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 45 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 514..519

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 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

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

                                                                                                                                    } else {
                                                                                                                                        addLine(_buildReport, SEVEN,
                                                                                                                                                Bundle.getMessage("buildExcludeCarByRoute", car.toString(), car.getTypeName(),
                                                                                                                                                        car.getTrack().getTrackTypeName(), car.getLocationName(), car.getTrackName()));
                                                                                                                                        _carList.remove(car);
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 2 other locations - About 45 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 792..798
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 806..813

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 54.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                        car.getLastRouteId().equals(_train.getRoute().getId())) {
                                                                                                                                    addLine(_buildReport, SEVEN, Bundle.getMessage("buildExcludeCarDropByTrain", car.toString(),
                                                                                                                                            car.getTypeName(), _train.getRoute().getName(), car.getLocationName(), car.getTrackName()));
                                                                                                                                    _carList.remove(car);
                                                                                                                                    i--;
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 2 other locations - About 45 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 818..825
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 806..813

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 54.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                    } else {
                                                                                                                                        addLine(_buildReport, SEVEN,
                                                                                                                                                Bundle.getMessage("buildExcludeCarByTrain", car.toString(), car.getTypeName(),
                                                                                                                                                        car.getTrack().getTrackTypeName(), car.getLocationName(), car.getTrackName()));
                                                                                                                                        _carList.remove(car);
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 2 other locations - About 45 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 792..798
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 818..825

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 54.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                            if (rl.getLocation().isStaging()) {
                                                                                                                                addLine(_buildReport, FIVE,
                                                                                                                                        Bundle.getMessage("buildCarsInStaging", count, rl.getName()));
                                                                                                                            } else {
                                                                                                                                addLine(_buildReport, FIVE,
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 3155..3161

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 52.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                if (car.getTrain() != null && car.getTrain() != _train) {
                                                                                                                                    addLine(_buildReport, THREE, Bundle.getMessage("buildStagingDepartCarTrain",
                                                                                                                                            departStageTrack.getName(), car.toString(), car.getTrainName()));
                                                                                                                                    return false;
                                                                                                                                }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1703..1707

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 52.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                        if ((_train.getThirdLegOptions() & Train.CHANGE_ENGINES) == Train.CHANGE_ENGINES) {
                                                                                                                            addLine(_buildReport, ONE,
                                                                                                                                    Bundle.getMessage("buildTrainEngineChange", _train.getThirdLegStartLocationName(),
                                                                                                                                            _train.getThirdLegNumberEngines(), _train.getThirdLegEngineModel(),
                                                                                                                                            _train.getThirdLegEngineRoad()));
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 496..501

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 52.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                            if (rl.getLocation().isStaging()) {
                                                                                                                                addLine(_buildReport, FIVE,
                                                                                                                                        Bundle.getMessage("buildLocosInStaging", count, rl.getName()));
                                                                                                                            } else {
                                                                                                                                addLine(_buildReport, FIVE,
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1018..1024

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 52.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                    if (eng.getTrain() != null && eng.getTrain() != _train) {
                                                                                                                                        addLine(_buildReport, THREE, Bundle.getMessage("buildStagingDepartEngineTrain",
                                                                                                                                                departStageTrack.getName(), eng.toString(), eng.getTrainName()));
                                                                                                                                        return false;
                                                                                                                                    }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1787..1791

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 52.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                        if ((_train.getSecondLegOptions() & Train.CHANGE_ENGINES) == Train.CHANGE_ENGINES) {
                                                                                                                            addLine(_buildReport, ONE,
                                                                                                                                    Bundle.getMessage("buildTrainEngineChange", _train.getSecondLegStartLocationName(),
                                                                                                                                            _train.getSecondLegNumberEngines(), _train.getSecondLegEngineModel(),
                                                                                                                                            _train.getSecondLegEngineRoad()));
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 508..513

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderCars.java on lines 663..666

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 50.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                        if (_train.getCarRoadOption().equals(Train.ALL_ROADS) &&
                                                                                                                                !terminateStageTrack.getRoadOption().equals(Track.ALL_ROADS)) {
                                                                                                                            addLine(_buildReport, FIVE, Bundle.getMessage("buildStagingTrackAllRoads", terminateStageTrack.getName()));
                                                                                                                            return false;
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2038..2042

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 50.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                            if (!Setup.isLocalSpurMovesEnabled() && testTrack.isSpur() && car.getTrack().isSpur()) {
                                                                                                                                addLine(_buildReport, SEVEN,
                                                                                                                                        Bundle.getMessage("buildNoSpurToSpurMove", car.getTrackName(), testTrack.getName()));
                                                                                                                                return false;
                                                                                                                            }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2378..2385

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 50.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                            if (!Setup.isLocalInterchangeMovesEnabled() &&
                                                                                                                                    testTrack.isInterchange() &&
                                                                                                                                    car.getTrack().isInterchange()) {
                                                                                                                                addLine(_buildReport, SEVEN,
                                                                                                                                        Bundle.getMessage("buildNoInterchangeToInterchangeMove", car.getTrackName(),
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2361..2365

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 50.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                        if (_train.getLoadOption().equals(Train.ALL_LOADS) &&
                                                                                                                                !terminateStageTrack.getLoadOption().equals(Track.ALL_LOADS)) {
                                                                                                                            addLine(_buildReport, FIVE, Bundle.getMessage("buildStagingTrackAllLoads", terminateStageTrack.getName()));
                                                                                                                            return false;
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2019..2023

                                                                                                                Duplicated Code

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

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

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

                                                                                                                                    if (!_train.isBuiltDateAccepted(eng.getBuilt())) {
                                                                                                                                        addLine(_buildReport, THREE,
                                                                                                                                                Bundle.getMessage("buildStagingDepartEngineBuilt", departStageTrack.getName(),
                                                                                                                                                        eng.toString(), eng.getBuilt(), _train.getName()));
                                                                                                                                        return false;
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 6 other locations - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1710..1714
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1742..1746
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1793..1798
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1800..1805
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1820..1824
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1827..1831

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                if (!_train.isOwnerNameAccepted(car.getOwnerName())) {
                                                                                                                                    addLine(_buildReport, THREE, Bundle.getMessage("buildStagingDepartCarOwner",
                                                                                                                                            departStageTrack.getName(), car.toString(), car.getOwnerName(), _train.getName()));
                                                                                                                                    return false;
                                                                                                                                }
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 6 other locations - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1710..1714
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1742..1746
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1749..1754
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1793..1798
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1800..1805
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1827..1831

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                    if (!_train.isTypeNameAccepted(eng.getTypeName())) {
                                                                                                                                        addLine(_buildReport, THREE, Bundle.getMessage("buildStagingDepartEngineType",
                                                                                                                                                departStageTrack.getName(), eng.toString(), eng.getTypeName(), _train.getName()));
                                                                                                                                        return false;
                                                                                                                                    }
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 6 other locations - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1742..1746
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1749..1754
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1793..1798
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1800..1805
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1820..1824
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1827..1831

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                if (!_train.isBuiltDateAccepted(car.getBuilt())) {
                                                                                                                                    addLine(_buildReport, THREE, Bundle.getMessage("buildStagingDepartCarBuilt",
                                                                                                                                            departStageTrack.getName(), car.toString(), car.getBuilt(), _train.getName()));
                                                                                                                                    return false;
                                                                                                                                }
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 6 other locations - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1710..1714
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1742..1746
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1749..1754
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1793..1798
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1800..1805
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1820..1824

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                    if (!_train.isOwnerNameAccepted(eng.getOwnerName())) {
                                                                                                                                        addLine(_buildReport, THREE, Bundle.getMessage("buildStagingDepartEngineOwner",
                                                                                                                                                departStageTrack.getName(), eng.toString(), eng.getOwnerName(), _train.getName()));
                                                                                                                                        return false;
                                                                                                                                    }
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 6 other locations - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1710..1714
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1749..1754
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1793..1798
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1800..1805
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1820..1824
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1827..1831

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                if (!_train.isCarRoadNameAccepted(car.getRoadName())) {
                                                                                                                                    addLine(_buildReport, THREE,
                                                                                                                                            Bundle.getMessage("buildStagingDepartCarRoad", departStageTrack.getName(), car.toString(),
                                                                                                                                                    car.getRoadName(), _train.getName()));
                                                                                                                                    return false;
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 6 other locations - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1710..1714
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1742..1746
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1749..1754
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1793..1798
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1820..1824
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1827..1831

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                if (!_train.isTypeNameAccepted(car.getTypeName())) {
                                                                                                                                    addLine(_buildReport, THREE,
                                                                                                                                            Bundle.getMessage("buildStagingDepartCarType", departStageTrack.getName(), car.toString(),
                                                                                                                                                    car.getTypeName(), _train.getName()));
                                                                                                                                    return false;
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 6 other locations - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1710..1714
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1742..1746
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1749..1754
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1800..1805
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1820..1824
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1827..1831

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                    } else if (car.getTrack().getServiceOrder().equals(Track.LIFO)) {
                                                                                                                                        if (bestCar.getLastMoveDate().before(testCar.getLastMoveDate()) &&
                                                                                                                                                bestCar.getLoadPriority().equals(testCar.getLoadPriority())) {
                                                                                                                                            bestCar = testCar;
                                                                                                                                            log.debug("New best car ({})", bestCar.toString());
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1104..1110

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                    if (car.getTrack().getServiceOrder().equals(Track.FIFO)) {
                                                                                                                                        if (bestCar.getLastMoveDate().after(testCar.getLastMoveDate()) &&
                                                                                                                                                bestCar.getLoadPriority().equals(testCar.getLoadPriority())) {
                                                                                                                                            bestCar = testCar;
                                                                                                                                            log.debug("New best car ({})", bestCar.toString());
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 40 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1110..1116

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                        if (!_train.getLocoRoadOption().equals(Train.ALL_ROADS)) {
                                                                                                                            addLine(_buildReport, FIVE, Bundle.getMessage("buildTrainLocoRoads", _train.getName(),
                                                                                                                                    _train.getLocoRoadOption(), formatStringToCommaSeparated(_train.getLocoRoadNames())));
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 2 other locations - About 35 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 309..312
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 572..575

                                                                                                                Duplicated Code

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

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

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

                                                                                                                        if (!_train.getLoadOption().equals(Train.ALL_LOADS)) {
                                                                                                                            addLine(_buildReport, FIVE, Bundle.getMessage("buildTrainLoads", _train.getName(), _train.getLoadOption(),
                                                                                                                                    formatStringToCommaSeparated(_train.getLoadNames())));
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 2 other locations - About 35 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 304..307
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 309..312

                                                                                                                Duplicated Code

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

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

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

                                                                                                                        if (!_train.getOwnerOption().equals(Train.ALL_OWNERS)) {
                                                                                                                            addLine(_buildReport, FIVE, Bundle.getMessage("buildTrainOwners", _train.getName(), _train.getOwnerOption(),
                                                                                                                                    formatStringToCommaSeparated(_train.getOwnerNames())));
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 2 other locations - About 35 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 304..307
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 572..575

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 44.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                        try {
                                                                                                                            _buildReport = new PrintWriter(
                                                                                                                                    new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)),
                                                                                                                                    true);
                                                                                                                        } catch (IOException e) {
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 35 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainManifest.java on lines 40..47

                                                                                                                Duplicated Code

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

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

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

                                                                                                                                } else if (rl.isDropAllowed() && rl.isPickUpAllowed()) {
                                                                                                                                    addLine(_buildReport, THREE,
                                                                                                                                            Bundle.getMessage("buildLocRequestMoves", rl.getId(), rl.getName(),
                                                                                                                                                    rl.getTrainDirectionString(), rl.getMaxCarMoves(), rl.getMaxTrainLength(),
                                                                                                                                                    Setup.getLengthUnit().toLowerCase()));
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 3 other locations - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 412..417
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 404..409
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 384..389

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 42.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                            addLine(_buildReport, SEVEN,
                                                                                                                                    Bundle.getMessage("buildTrackModePriority", car.toString(), car.getTrack().getTrackTypeName(),
                                                                                                                                            car.getLocationName(), car.getTrackName(), car.getTrack().getServiceOrder(), car.getLastDate()));
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1095..1097

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 42.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                } else if (!rl.isDropAllowed()) {
                                                                                                                                    addLine(_buildReport, THREE,
                                                                                                                                            Bundle.getMessage("buildLocRequestPickups", rl.getId(), rl.getName(),
                                                                                                                                                    rl.getTrainDirectionString(), rl.getMaxCarMoves(), rl.getMaxTrainLength(),
                                                                                                                                                    Setup.getLengthUnit().toLowerCase()));
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 3 other locations - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 412..417
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 399..404
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 384..389

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 42.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                if (location.isStaging() && rl.isPickUpAllowed() && rl == _train.getTrainDepartsRouteLocation()) {
                                                                                                                                    addLine(_buildReport, THREE,
                                                                                                                                            Bundle.getMessage("buildStagingDeparts", rl.getId(), rl.getName(),
                                                                                                                                                    rl.getTrainDirectionString(), rl.getMaxCarMoves(), rl.getMaxTrainLength(),
                                                                                                                                                    Setup.getLengthUnit().toLowerCase()));
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 3 other locations - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 412..417
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 404..409
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 399..404

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 42.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                            addLine(_buildReport, SEVEN,
                                                                                                                                    Bundle.getMessage("buildTrackModePriority", car.toString(), car.getTrack().getTrackTypeName(),
                                                                                                                                            car.getLocationName(), car.getTrackName(), car.getTrack().getServiceOrder(), car.getLastDate()));
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2218..2220

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 42.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                } else {
                                                                                                                                    addLine(_buildReport, THREE,
                                                                                                                                            Bundle.getMessage("buildLocRequestDrops", rl.getId(), rl.getName(),
                                                                                                                                                    rl.getTrainDirectionString(), rl.getMaxCarMoves(), rl.getMaxTrainLength(),
                                                                                                                                                    Setup.getLengthUnit().toLowerCase()));
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 3 other locations - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 404..409
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 399..404
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 384..389

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 42.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                if (car.isCaboose() &&
                                                                                                                                        (_train.getCabooseRoad().equals(Train.NONE) ||
                                                                                                                                                _train.getCabooseRoad().equals(car.getRoadName()))) {
                                                                                                                                    foundCaboose = true;
                                                                                                                                }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1850..1854

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 42.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                if (car.hasFred() &&
                                                                                                                                        (_train.getCabooseRoad().equals(Train.NONE) ||
                                                                                                                                                _train.getCabooseRoad().equals(car.getRoadName()))) {
                                                                                                                                    foundFRED = true;
                                                                                                                                }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1844..1848

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 42.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

                                                                                                                                car.getSplitLocationName().equals(track.getLocation().getSplitName())) {
                                                                                                                            addLine(_buildReport, SEVEN,
                                                                                                                                    Bundle.getMessage("buildNoLocalMoveToTrack", car.getLocationName(), car.getTrackName(),
                                                                                                                                            track.getLocation().getName(), track.getName(), _train.getName()));
                                                                                                                            return false;
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/router/Router.java on lines 1164..1168

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 42.

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

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

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

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

                                                                                                                Refactorings

                                                                                                                Further Reading

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

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

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (car.getTrack() == _departStageTrack &&
                                                                                                                                        (car.getDestination() == null || car.getDestinationTrack() == null || car.getTrain() == null)) {
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.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/TrainBuilderCars.java on lines 544..545

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (!stageTrack.isTypeNameAccepted(car.getTypeName())) {
                                                                                                                            addLine(_buildReport, SEVEN,
                                                                                                                                    Bundle.getMessage("buildStagingTrackType", stageTrack.getName(), car.getTypeName()));
                                                                                                                            return false;
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2520..2524

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (!stageTrack.isRoadNameAccepted(car.getRoadName())) {
                                                                                                                            addLine(_buildReport, SEVEN,
                                                                                                                                    Bundle.getMessage("buildStagingTrackRoad", stageTrack.getName(), car.getRoadName()));
                                                                                                                            return false;
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 2515..2519

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (car.getLoadPriority().equals(CarLoad.PRIORITY_LOW)) {
                                                                                                                                        addLine(_buildReport, SEVEN,
                                                                                                                                                Bundle.getMessage("buildCarAtLocWithMoves", car.toString(), car.getTypeName(),
                                                                                                                                                        car.getTypeExtensions(), car.getLocationName(), car.getTrackName(),
                                                                                                                                                        car.getMoves()));
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 3163..3168

                                                                                                                Duplicated Code

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

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

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

                                                                                                                Tuning

                                                                                                                This issue has a mass of 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 (_train.isFredNeeded() && !foundFRED) {
                                                                                                                            addLine(_buildReport, THREE,
                                                                                                                                    Bundle.getMessage("buildStagingNoCarFRED", departStageTrack.getName(), _train.getCabooseRoad()));
                                                                                                                            return false;
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1858..1862

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (engine.getLocationName().equals(rl.getName())) {
                                                                                                                                    addLine(_buildReport, SEVEN,
                                                                                                                                            Bundle.getMessage("buildLocoAtLocWithMoves", engine.toString(), engine.getTypeName(),
                                                                                                                                                    engine.getModel(), engine.getLocationName(), engine.getTrackName(),
                                                                                                                                                    engine.getMoves()));
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1037..1042

                                                                                                                Duplicated Code

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

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

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 (_train.isCabooseNeeded() && !foundCaboose) {
                                                                                                                            addLine(_buildReport, THREE,
                                                                                                                                    Bundle.getMessage("buildStagingNoCaboose", departStageTrack.getName(), _train.getCabooseRoad()));
                                                                                                                            return false;
                                                                                                                        }
                                                                                                                Severity: Minor
                                                                                                                Found in java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java and 1 other location - About 30 mins to fix
                                                                                                                java/src/jmri/jmrit/operations/trains/TrainBuilderBase.java on lines 1865..1869

                                                                                                                Duplicated Code

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

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

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