java/src/jmri/jmrit/dispatcher/DispatcherFrame.java

Summary

Maintainability
F
1 mo
Test Coverage
F
50%

File DispatcherFrame.java has 2904 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.dispatcher;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.FlowLayout;
Severity: Major
Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 wk to fix

    Method allocateSection has a Cognitive Complexity of 192 (exceeds 20 allowed). Consider refactoring.
    Open

        public AllocatedSection allocateSection(AllocationRequest ar, Section ns) {
            log.trace("{}: Checking Section [{}]", ar.getActiveTrain().getTrainName(), (ns != null ? ns.getDisplayName(USERSYS) : "auto"));
            AllocatedSection as = null;
            Section nextSection = null;
            int nextSectionSeqNo = 0;
    Severity: Minor
    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 3 days to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method checkBlocksNotInAllocatedSection has a Cognitive Complexity of 164 (exceeds 20 allowed). Consider refactoring.
    Open

        protected Section checkBlocksNotInAllocatedSection(Section s, AllocationRequest ar) {
            for (AllocatedSection as : allocatedSections) {
                if (as.getSection() != s) {
                    List<Block> blas = as.getSection().getBlockList();
                    //
    Severity: Minor
    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 3 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

    DispatcherFrame has 131 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class DispatcherFrame extends jmri.util.JmriJFrame implements InstanceManagerAutoDefault {
    
        public DispatcherFrame() {
            super(true, true); // remember size a position.
            editorManager = InstanceManager.getDefault(EditorManager.class);
    Severity: Major
    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 2 days to fix

      Method createActiveTrain has a Cognitive Complexity of 114 (exceeds 20 allowed). Consider refactoring.
      Open

          public ActiveTrain createActiveTrain(String transitID, String trainID, int tSource, String startBlockName,
                  int startBlockSectionSequenceNumber, String endBlockName, int endBlockSectionSequenceNumber,
                  boolean autoRun, String dccAddress, int priority, boolean resetWhenDone, boolean reverseAtEnd,
                  boolean showErrorMessages, JmriJFrame frame, int allocateMethod) {
              log.debug("trainID:{}, tSource:{}, startBlockName:{}, startBlockSectionSequenceNumber:{}, endBlockName:{}, endBlockSectionSequenceNumber:{}",
      Severity: Minor
      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 day to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method checkAutoRelease has a Cognitive Complexity of 110 (exceeds 20 allowed). Consider refactoring.
      Open

          protected void checkAutoRelease() {
              if (_AutoRelease) {
                  // Auto release of exited sections has been requested - because of possible noise in block detection
                  //    hardware, allocated sections are automatically released in the order they were allocated only
                  // Only unoccupied sections that have been exited are tested.
      Severity: Minor
      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 day to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method allocateSection has 275 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public AllocatedSection allocateSection(AllocationRequest ar, Section ns) {
              log.trace("{}: Checking Section [{}]", ar.getActiveTrain().getTrainName(), (ns != null ? ns.getDisplayName(USERSYS) : "auto"));
              AllocatedSection as = null;
              Section nextSection = null;
              int nextSectionSeqNo = 0;
      Severity: Major
      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 day to fix

        Method createActiveTrain has 216 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public ActiveTrain createActiveTrain(String transitID, String trainID, int tSource, String startBlockName,
                    int startBlockSectionSequenceNumber, String endBlockName, int endBlockSectionSequenceNumber,
                    boolean autoRun, String dccAddress, int priority, boolean resetWhenDone, boolean reverseAtEnd,
                    boolean showErrorMessages, JmriJFrame frame, int allocateMethod) {
                log.debug("trainID:{}, tSource:{}, startBlockName:{}, startBlockSectionSequenceNumber:{}, endBlockName:{}, endBlockSectionSequenceNumber:{}",
        Severity: Major
        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 day to fix

          Method openDispatcherWindow has 206 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              void openDispatcherWindow() {
                  if (dispatcherFrame == null) {
                      if (editorManager.getAll(LayoutEditor.class).size() > 0 && autoAllocate == null) {
                          autoAllocate = new AutoAllocate(this, allocationRequests);
                          autoAllocateThread = jmri.util.ThreadingUtil.newThread(autoAllocate, "Auto Allocator ");
          Severity: Major
          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 day to fix

            Method loadTrainFromTrainInfo has 108 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public int loadTrainFromTrainInfo(TrainInfo info, String overRideType, String overRideValue) {
            
                    log.debug("loading train:{}, startblockname:{}, destinationBlockName:{}", info.getTrainName(),
                            info.getStartBlockName(), info.getDestinationBlockName());
                    // create a new Active Train
            Severity: Major
            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 4 hrs to fix

              Method checkBlocksNotInAllocatedSection has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected Section checkBlocksNotInAllocatedSection(Section s, AllocationRequest ar) {
                      for (AllocatedSection as : allocatedSections) {
                          if (as.getSection() != s) {
                              List<Block> blas = as.getSection().getBlockList();
                              //
              Severity: Major
              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 3 hrs to fix

                Method terminateActiveTrain has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.
                Open

                    public void terminateActiveTrain(ActiveTrain at, boolean terminateNow, boolean runNextTrain) {
                        // ensure there is a train to terminate
                        if (at == null) {
                            log.error("Null ActiveTrain pointer when attempting to terminate an ActiveTrain");
                            return;
                Severity: Minor
                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.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 getValueAt has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        @Override
                        public Object getValueAt(int r, int c) {
                            int rx = r;
                            if (rx >= activeTrainsList.size()) {
                                return null;
                Severity: Major
                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 3 hrs to fix

                  Method checkAutoRelease has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected void checkAutoRelease() {
                          if (_AutoRelease) {
                              // Auto release of exited sections has been requested - because of possible noise in block detection
                              //    hardware, allocated sections are automatically released in the order they were allocated only
                              // Only unoccupied sections that have been exited are tested.
                  Severity: Major
                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 2 hrs to fix

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

                        public void terminateActiveTrain(ActiveTrain at, boolean terminateNow, boolean runNextTrain) {
                            // ensure there is a train to terminate
                            if (at == null) {
                                log.error("Null ActiveTrain pointer when attempting to terminate an ActiveTrain");
                                return;
                    Severity: Major
                    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 2 hrs to fix

                      Method getValueAt has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              @Override
                              public Object getValueAt(int r, int c) {
                                  int rx = r;
                                  if (rx >= allocationRequests.size()) {
                                      return null;
                      Severity: Major
                      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 2 hrs to fix

                        Method requestAllocation has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected boolean requestAllocation(ActiveTrain activeTrain, Section section, int direction,
                                    int seqNumber, boolean showErrorMessages, JmriJFrame frame,boolean firstAllocation) {
                                // check input entries
                                if (activeTrain == null) {
                                    if (showErrorMessages) {
                        Severity: Major
                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 2 hrs to fix

                          Method allocateExtraSection has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private void allocateExtraSection(ActionEvent e) {
                                  if (extraFrame == null) {
                                      extraFrame = new JmriJFrame(Bundle.getMessage("ExtraTitle"));
                                      extraFrame.addHelpMenu("package.jmri.jmrit.dispatcher.AllocateExtra", true);
                                      extraPane = extraFrame.getContentPane();
                          Severity: Minor
                          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 2 hrs to fix

                            Method getValueAt has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    @Override
                                    public Object getValueAt(int r, int c) {
                                        int rx = r;
                                        if (rx >= allocatedSections.size()) {
                                            return null;
                            Severity: Minor
                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

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

                                  private void addExtraRequested(ActionEvent e) {
                                      int index = extraBox.getSelectedIndex();
                                      if ((atSelectedIndex < 0) || (index < 0)) {
                                          cancelExtraRequested(e);
                                          return;
                              Severity: Minor
                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

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

                                        @Override
                                        public Object getValueAt(int r, int c) {
                                            int rx = r;
                                            if (rx >= activeTrainsList.size()) {
                                                return null;
                                Severity: Minor
                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.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 createActiveTrain has 15 arguments (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public ActiveTrain createActiveTrain(String transitID, String trainID, int tSource, String startBlockName,
                                            int startBlockSectionSequenceNumber, String endBlockName, int endBlockSectionSequenceNumber,
                                            boolean autoRun, String dccAddress, int priority, boolean resetWhenDone, boolean reverseAtEnd,
                                            boolean showErrorMessages, JmriJFrame frame, int allocateMethod) {
                                Severity: Major
                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

                                  Method getColumnName has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          @Override
                                          public String getColumnName(int col) {
                                              switch (col) {
                                                  case TRANSIT_COLUMN:
                                                      return Bundle.getMessage("TransitColumnSysTitle");
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

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

                                        private AllocatedSection allocateSection(ActiveTrain at, Section s, int seqNum, Section nextSection, int nextSectionSeqNo, int direction) {
                                            AllocatedSection as = null;
                                            // allocate the section
                                            as = new AllocatedSection(s, at, seqNum, nextSection, nextSectionSeqNo);
                                            if (_SupportVSDecoder) {
                                    Severity: Minor
                                    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

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

                                          void cancelRestart(ActionEvent e) {
                                              ActiveTrain at = null;
                                              if (restartingTrainsList.size() == 1) {
                                                  at = restartingTrainsList.get(0);
                                              } else if (restartingTrainsList.size() > 1) {
                                      Severity: Minor
                                      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

                                        Method loadAtStartup has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public void loadAtStartup() {
                                                log.debug("Loading saved trains flagged as LoadAtStartup");
                                                TrainInfoFile tif = new TrainInfoFile();
                                                String[] names = tif.getTrainInfoFileNames();
                                                log.debug("initializing block paths early"); //TODO: figure out how to prevent the "regular" init
                                        Severity: Minor
                                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

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

                                                  @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "DB_DUPLICATE_SWITCH_CLAUSES",
                                                                          justification="better to keep cases in column order rather than to combine")
                                                  public int getPreferredWidth(int col) {
                                                      switch (col) {
                                                          case TRANSIT_COLUMN:
                                          Severity: Minor
                                          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

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

                                                    @Override
                                                    public String getColumnName(int col) {
                                                        switch (col) {
                                                            case TRANSIT_COLUMN:
                                                                return Bundle.getMessage("TransitColumnSysTitle");
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

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

                                                  private void addExtraRequested(ActionEvent e) {
                                                      int index = extraBox.getSelectedIndex();
                                                      if ((atSelectedIndex < 0) || (index < 0)) {
                                                          cancelExtraRequested(e);
                                                          return;
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.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 loadTrainFromTrainInfo has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                                              Open

                                                  public int loadTrainFromTrainInfo(TrainInfo info, String overRideType, String overRideValue) {
                                              
                                                      log.debug("loading train:{}, startblockname:{}, destinationBlockName:{}", info.getTrainName(),
                                                              info.getStartBlockName(), info.getDestinationBlockName());
                                                      // create a new Active Train
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.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 terminateTrain has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  void terminateTrain(ActionEvent e) {
                                                      ActiveTrain at = null;
                                                      if (activeTrainsList.size() == 1) {
                                                          at = activeTrainsList.get(0);
                                                      } else if (activeTrainsList.size() > 1) {
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

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

                                                    protected void doReleaseAllocatedSection(AllocatedSection as, boolean terminatingTrain) {
                                                        // check that section is not occupied if not terminating train
                                                        if (!terminatingTrain && (as.getSection().getOccupancy() == Section.OCCUPIED)) {
                                                            // warn the manual dispatcher that Allocated Section is occupied
                                                            int selectedValue = JmriJOptionPane.showOptionDialog(dispatcherFrame, java.text.MessageFormat.format(
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 1 hr to fix

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

                                                      protected boolean requestAllocation(ActiveTrain activeTrain, Section section, int direction,
                                                              int seqNumber, boolean showErrorMessages, JmriJFrame frame,boolean firstAllocation) {
                                                          // check input entries
                                                          if (activeTrain == null) {
                                                              if (showErrorMessages) {
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 55 mins to fix

                                                  Cognitive Complexity

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

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

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

                                                  Further reading

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

                                                      private AllocatedSection allocateSection(ActiveTrain at, Section s, int seqNum, Section nextSection, int nextSectionSeqNo, int direction) {
                                                          AllocatedSection as = null;
                                                          // allocate the section
                                                          as = new AllocatedSection(s, at, seqNum, nextSection, nextSectionSeqNo);
                                                          if (_SupportVSDecoder) {
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.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

                                                  Method requestAllocation has 7 arguments (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                      protected boolean requestAllocation(ActiveTrain activeTrain, Section section, int direction,
                                                              int seqNumber, boolean showErrorMessages, JmriJFrame frame,boolean firstAllocation) {
                                                  Severity: Major
                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                                        if (allocatedSections.get(k).getSection() == ns) {
                                                                                            nas = allocatedSections.get(k);
                                                                                        }
                                                    Severity: Major
                                                    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                                          if (nas != null && at.reachedRestartPoint()) {
                                                                                              foundOne = true;
                                                                                          }
                                                      Severity: Major
                                                      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 45 mins to fix

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

                                                            public void loadAtStartup() {
                                                                log.debug("Loading saved trains flagged as LoadAtStartup");
                                                                TrainInfoFile tif = new TrainInfoFile();
                                                                String[] names = tif.getTrainInfoFileNames();
                                                                log.debug("initializing block paths early"); //TODO: figure out how to prevent the "regular" init
                                                        Severity: Minor
                                                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 45 mins to fix

                                                        Cognitive Complexity

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

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

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

                                                        Further reading

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                        if (tas.getActiveTrain() == as.getActiveTrain() && tas.getExited() && tas.getSection().getOccupancy() == Section.OCCUPIED ) {
                                                                                            return as.getSection();
                                                                                        }
                                                        Severity: Major
                                                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                                          for (int i = 0; i < blas.size(); i++) {
                                                                                              //The block we get to is occupied therefore the subsequent blocks have not been entered
                                                                                              if (blas.get(i).getState() == Block.OCCUPIED) {
                                                                                                  if (ar != null) {
                                                                                                      ar.setWaitingOnBlock(b);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                                if ((asx.getActiveTrain() == as.getActiveTrain())
                                                                                                        && (asx.getAllocationNumber() != -1)
                                                                                                        && (asx.getAllocationNumber() < as.getAllocationNumber())) {
                                                                                                    foundOne = false;
                                                                                                }
                                                            Severity: Major
                                                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                                  if (asx.getActiveTrain() == as.getActiveTrain()) {
                                                                                                          allocatedCount++ ;
                                                                                                  }
                                                              Severity: Major
                                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 45 mins to fix

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

                                                                    private AllocatedSection allocateSection(ActiveTrain at, Section s, int seqNum, Section nextSection, int nextSectionSeqNo, int direction) {
                                                                Severity: Minor
                                                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 35 mins to fix

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

                                                                      protected boolean requestAllocation(ActiveTrain activeTrain, Section section, int direction,
                                                                              int seqNumber, boolean showErrorMessages, JmriJFrame frame) {
                                                                  Severity: Minor
                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 35 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                            return("NA");
                                                                    Severity: Major
                                                                    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                              return as;
                                                                      Severity: Major
                                                                      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                                return "<none>";
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                                  return (at.getNextSectionToAllocate().getUserName());
                                                                          Severity: Major
                                                                          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                                return (" ");
                                                                            Severity: Major
                                                                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                                      return Bundle.getMessage("UNKNOWN");
                                                                              Severity: Major
                                                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                                    return Bundle.getMessage("UNOCCUPIED");
                                                                                Severity: Major
                                                                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                                      return (" ");
                                                                                  Severity: Major
                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                    return null;
                                                                                    Severity: Major
                                                                                    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                                          return null;
                                                                                      Severity: Major
                                                                                      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                                return Bundle.getMessage("Exited");
                                                                                        Severity: Major
                                                                                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                              return null;
                                                                                          Severity: Major
                                                                                          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                    return null;
                                                                                            Severity: Major
                                                                                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                                      return (at.getLastAllocatedSection().getUserName());
                                                                                              Severity: Major
                                                                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

                                                                                                                        return (at.getNextSectionToAllocate().getSystemName());
                                                                                                Severity: Major
                                                                                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                  Avoid too many return statements within this method.
                                                                                                  Open

                                                                                                                          return "<none>";
                                                                                                  Severity: Major
                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                    Avoid too many return statements within this method.
                                                                                                    Open

                                                                                                                            return Bundle.getMessage("OCCUPIED");
                                                                                                    Severity: Major
                                                                                                    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                      Avoid too many return statements within this method.
                                                                                                      Open

                                                                                                                          return null;
                                                                                                      Severity: Major
                                                                                                      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                        Avoid too many return statements within this method.
                                                                                                        Open

                                                                                                                    return null;
                                                                                                        Severity: Major
                                                                                                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                          Avoid too many return statements within this method.
                                                                                                          Open

                                                                                                                          return null;
                                                                                                          Severity: Major
                                                                                                          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                            Avoid too many return statements within this method.
                                                                                                            Open

                                                                                                                                return (" ");
                                                                                                            Severity: Major
                                                                                                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                              Avoid too many return statements within this method.
                                                                                                              Open

                                                                                                                                      return (as.getSection().getUserName());
                                                                                                              Severity: Major
                                                                                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                Avoid too many return statements within this method.
                                                                                                                Open

                                                                                                                                        return null;
                                                                                                                Severity: Major
                                                                                                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this method.
                                                                                                                  Open

                                                                                                                              return null;
                                                                                                                  Severity: Major
                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this method.
                                                                                                                    Open

                                                                                                                                return null;
                                                                                                                    Severity: Major
                                                                                                                    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this method.
                                                                                                                      Open

                                                                                                                                              return(at.getDccAddress());
                                                                                                                      Severity: Major
                                                                                                                      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this method.
                                                                                                                        Open

                                                                                                                                                return (ar.getSection().getUserName());
                                                                                                                        Severity: Major
                                                                                                                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this method.
                                                                                                                          Open

                                                                                                                                      return null;
                                                                                                                          Severity: Major
                                                                                                                          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this method.
                                                                                                                            Open

                                                                                                                                        return null;
                                                                                                                            Severity: Major
                                                                                                                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this method.
                                                                                                                              Open

                                                                                                                                      return at;
                                                                                                                              Severity: Major
                                                                                                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                Open

                                                                                                                                                return null;
                                                                                                                                Severity: Major
                                                                                                                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                  Open

                                                                                                                                                          return(at.getAutoActiveTrain().getCurrentSignalUserName());
                                                                                                                                  Severity: Major
                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                    Open

                                                                                                                                                            return Bundle.getMessage("FREE");
                                                                                                                                    Severity: Major
                                                                                                                                    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                      Open

                                                                                                                                                              return Bundle.getMessage("UNKNOWN");
                                                                                                                                      Severity: Major
                                                                                                                                      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                        Open

                                                                                                                                                            return Bundle.getMessage("Entered");
                                                                                                                                        Severity: Major
                                                                                                                                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                          Open

                                                                                                                                                      return null;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                            Open

                                                                                                                                                        return null;
                                                                                                                                            Severity: Major
                                                                                                                                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                              Open

                                                                                                                                                                      return("NA");
                                                                                                                                              Severity: Major
                                                                                                                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                Open

                                                                                                                                                                    return Bundle.getMessage("ALLOCATED");
                                                                                                                                                Severity: Major
                                                                                                                                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this method.
                                                                                                                                                  Open

                                                                                                                                                                          return Bundle.getMessage("OCCUPIED");
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                                    Open

                                                                                                                                                                            return Bundle.getMessage("NotEntered");
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                                      Open

                                                                                                                                                                              return("NA");
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                                        Open

                                                                                                                                                                            return null;
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                                          Open

                                                                                                                                                                                  return(at.getAutoActiveTrain().getCurrentSignal());
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                                            Open

                                                                                                                                                                                    return null;
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                                              Avoid too many return statements within this method.
                                                                                                                                                              Open

                                                                                                                                                                                      return null;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

                                                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                                                Open

                                                                                                                                                                                    return Bundle.getMessage("UNOCCUPIED");
                                                                                                                                                                Severity: Major
                                                                                                                                                                Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 30 mins to fix

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

                                                                                                                                                                      void cancelRestart(ActionEvent e) {
                                                                                                                                                                          ActiveTrain at = null;
                                                                                                                                                                          if (restartingTrainsList.size() == 1) {
                                                                                                                                                                              at = restartingTrainsList.get(0);
                                                                                                                                                                          } else if (restartingTrainsList.size() > 1) {
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 25 mins to fix

                                                                                                                                                                  Cognitive Complexity

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

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

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

                                                                                                                                                                  Further reading

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

                                                                                                                                                                          @Override
                                                                                                                                                                          public Object getValueAt(int r, int c) {
                                                                                                                                                                              int rx = r;
                                                                                                                                                                              if (rx >= allocatedSections.size()) {
                                                                                                                                                                                  return null;
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 25 mins to fix

                                                                                                                                                                  Cognitive Complexity

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

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

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

                                                                                                                                                                  Further reading

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

                                                                                                                                                                          if (restartingTrainsList.size() == 1) {
                                                                                                                                                                              at = restartingTrainsList.get(0);
                                                                                                                                                                          } else if (restartingTrainsList.size() > 1) {
                                                                                                                                                                              Object choices[] = new Object[restartingTrainsList.size()];
                                                                                                                                                                              for (int i = 0; i < restartingTrainsList.size(); i++) {
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 3 hrs to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1074..1096

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 214.

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

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

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

                                                                                                                                                                  See codeclimate-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 (activeTrainsList.size() == 1) {
                                                                                                                                                                              at = activeTrainsList.get(0);
                                                                                                                                                                          } else if (activeTrainsList.size() > 1) {
                                                                                                                                                                              Object choices[] = new Object[activeTrainsList.size()];
                                                                                                                                                                              for (int i = 0; i < activeTrainsList.size(); i++) {
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 3 hrs to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1037..1059

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 214.

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

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

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

                                                                                                                                                                  See codeclimate-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

                                                                                                                                                                          @Override
                                                                                                                                                                          public String getColumnName(int col) {
                                                                                                                                                                              switch (col) {
                                                                                                                                                                                  case TRANSIT_COLUMN:
                                                                                                                                                                                      return Bundle.getMessage("TransitColumnSysTitle");
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 2 other locations - About 2 hrs to fix
                                                                                                                                                                  java/src/jmri/jmrit/operations/automation/AutomationTableModel.java on lines 136..166
                                                                                                                                                                  java/src/jmri/jmrix/can/cbus/swing/eventrequestmonitor/CbusEventRequestDataModel.java on lines 104..134

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 158.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          @Override
                                                                                                                                                                          public String getColumnName(int col) {
                                                                                                                                                                              switch (col) {
                                                                                                                                                                                  case TRANSIT_COLUMN:
                                                                                                                                                                                      return Bundle.getMessage("TransitColumnSysTitle");
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 4 other locations - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/blockRoutingTable/LayoutBlockRouteTableModel.java on lines 50..73
                                                                                                                                                                  java/src/jmri/jmrit/operations/automation/AutomationsTableModel.java on lines 114..136
                                                                                                                                                                  java/src/jmri/jmrit/operations/routes/RoutesTableModel.java on lines 110..132
                                                                                                                                                                  java/src/jmri/jmrix/rps/aligntable/AlignTablePane.java on lines 228..250

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 110.

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

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

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

                                                                                                                                                                                  for (int i = tsList.size() - 1; i > 0; i--) {
                                                                                                                                                                                      TransitSection ts = tsList.get(i);
                                                                                                                                                                                      if (ts.getSection() == ar.getSection() && ts.getSequenceNumber() == ar.getSectionSeqNumber()) {
                                                                                                                                                                                          found = true;
                                                                                                                                                                                      } else if (found) {
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1926..1942

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 110.

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

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

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

                                                                                                                                                                                  for (int i = 0; i <= tsList.size() - 1; i++) {
                                                                                                                                                                                      TransitSection ts = tsList.get(i);
                                                                                                                                                                                      if (ts.getSection() == ar.getSection() && ts.getSequenceNumber() == ar.getSectionSeqNumber()) {
                                                                                                                                                                                          found = true;
                                                                                                                                                                                      } else if (found) {
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1908..1924

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 110.

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

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

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

                                                                                                                                                                      static protected class HeaderActionListener implements ActionListener {
                                                                                                                                                                  
                                                                                                                                                                          TableColumn tc;
                                                                                                                                                                          XTableColumnModel tcm;
                                                                                                                                                                  
                                                                                                                                                                  
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/beantable/BeanTableDataModel.java on lines 1193..1212

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 89.

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

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

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

                                                                                                                                                                      class TableHeaderListener extends JmriMouseAdapter {
                                                                                                                                                                  
                                                                                                                                                                          JTable table;
                                                                                                                                                                  
                                                                                                                                                                          TableHeaderListener(JTable tbl) {
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/beantable/BeanTableDataModel.java on lines 1333..1371

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 82.

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

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

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

                                                                                                                                                                  See codeclimate-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 (startBlockSectionSequenceNumber > t.getMaxSequence()) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                          "Error13"), new Object[]{"" + startBlockSectionSequenceNumber}),
                                                                                                                                                                                          Bundle.getMessage("ErrorTitle"), JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1334..1342

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 76.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                              cancelRestartButton.addActionListener(new ActionListener() {
                                                                                                                                                                                  @Override
                                                                                                                                                                                  public void actionPerformed(ActionEvent e) {
                                                                                                                                                                                      if (!newTrainActive) {
                                                                                                                                                                                          cancelRestart(e);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 547..560

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 76.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          } else if (endBlockSectionSequenceNumber > t.getMaxSequence()) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                          "Error9"), new Object[]{"" + endBlockSectionSequenceNumber}),
                                                                                                                                                                                          Bundle.getMessage("ErrorTitle"), JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1312..1320

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 76.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                              terminateTrainButton.addActionListener(new ActionListener() {
                                                                                                                                                                                  @Override
                                                                                                                                                                                  public void actionPerformed(ActionEvent e) {
                                                                                                                                                                                      if (!newTrainActive) {
                                                                                                                                                                                          terminateTrain(e);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 530..543

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 76.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                              if (secList.size() == 1) {
                                                                                                                                                                                  nextSection = secList.get(0);
                                                                                                                                                                              } else if (secList.size() > 1) {
                                                                                                                                                                                  if (_AutoAllocate) {
                                                                                                                                                                                      nextSection = autoChoice(secList, ar, nextSectionSeqNo);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1839..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 70.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                              if (secList.size() == 1) {
                                                                                                                                                                                  nextSection = secList.get(0);
                                                                                                                                                                  
                                                                                                                                                                              } else if (secList.size() > 1) {
                                                                                                                                                                                  if (_AutoAllocate) {
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1857..1865

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 70.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          if (t == null) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                          "Error1"), new Object[]{transitID}), Bundle.getMessage("ErrorTitle"),
                                                                                                                                                                                          JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1280..1288

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 70.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          if ((direction != Section.FORWARD) && (direction != Section.REVERSE)) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                          "Error18"), new Object[]{"" + direction, activeTrain.getActiveTrainName()}), Bundle.getMessage("ErrorTitle"),
                                                                                                                                                                                          JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1657..1665

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 70.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          if (startBlock == null) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                          "Error4"), new Object[]{startBlockName}), Bundle.getMessage("ErrorTitle"),
                                                                                                                                                                                          JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1244..1252

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 70.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          if (((seqNumber <= 0) || (seqNumber > (activeTrain.getTransit().getMaxSequence()))) && (seqNumber != -99)) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                          "Error19"), new Object[]{"" + seqNumber, activeTrain.getActiveTrainName()}), Bundle.getMessage("ErrorTitle"),
                                                                                                                                                                                          JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1666..1674

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 70.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          if (isInAllocatedSection(startBlock)) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                          "Error5"), new Object[]{startBlock.getDisplayName()}), Bundle.getMessage("ErrorTitle"),
                                                                                                                                                                                          JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1298..1306

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 68.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          if (_HasOccupancyDetection && (!(startBlock.getState() == Block.OCCUPIED))) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                          "Error6"), new Object[]{startBlock.getDisplayName()}), Bundle.getMessage("ErrorTitle"),
                                                                                                                                                                                          JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 1 hr to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1289..1297

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 68.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                  if (numErrors != 0) {
                                                                                                                                                                                      if (showErrorMessages) {
                                                                                                                                                                                          JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                                  "Error36"), new Object[]{("" + numErrors)}),
                                                                                                                                                                                                  Bundle.getMessage("ErrorTitle"), JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 2 other locations - About 55 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1394..1401
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1408..1415

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 66.

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

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

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

                                                                                                                                                                  See codeclimate-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 (numErrors != 0) {
                                                                                                                                                                                      if (showErrorMessages) {
                                                                                                                                                                                          JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                                  "Error36"), new Object[]{("" + numErrors)}),
                                                                                                                                                                                                  Bundle.getMessage("ErrorTitle"), JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 2 other locations - About 55 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1431..1438
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1394..1401

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 66.

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

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

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

                                                                                                                                                                  See codeclimate-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 (numErrors != 0) {
                                                                                                                                                                                  if (showErrorMessages) {
                                                                                                                                                                                      JmriJOptionPane.showMessageDialog(frame, java.text.MessageFormat.format(Bundle.getMessage(
                                                                                                                                                                                              "Error34"), new Object[]{("" + numErrors)}),
                                                                                                                                                                                              Bundle.getMessage("ErrorTitle"), JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 2 other locations - About 55 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1431..1438
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1408..1415

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 66.

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

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

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

                                                                                                                                                                                          for (int i = 0; i < s.getBlockList().size(); i++) {
                                                                                                                                                                                              if (j == 0 && s.getBlockList().get(i).getState() == Block.OCCUPIED) {
                                                                                                                                                                                                  j = 1;
                                                                                                                                                                                              }
                                                                                                                                                                                              if (j == 1) {
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 50 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 2281..2288

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 62.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                          for (int i = s.getBlockList().size() - 1; i >= 0; i--) {
                                                                                                                                                                                              if (j == 0 && s.getBlockList().get(i).getState() == Block.OCCUPIED) {
                                                                                                                                                                                                  j = 1;
                                                                                                                                                                                              }
                                                                                                                                                                                              if (j == 1) {
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 50 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 2271..2278

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 62.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                  for (int i = 0; i < blas.size(); i++) {
                                                                                                                                                                                                      //The block we get to is occupied therefore the subsequent blocks have not been entered
                                                                                                                                                                                                      if (blas.get(i).getState() == Block.OCCUPIED) {
                                                                                                                                                                                                          if (ar != null) {
                                                                                                                                                                                                              ar.setWaitingOnBlock(b);
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 50 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 2337..2347

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                                  for (int i = blas.size() - 1; i >= 0; i--) {
                                                                                                                                                                                                      //The block we get to is occupied therefore the subsequent blocks have not been entered
                                                                                                                                                                                                      if (blas.get(i).getState() == Block.OCCUPIED) {
                                                                                                                                                                                                          if (ar != null) {
                                                                                                                                                                                                              ar.setWaitingOnBlock(b);
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 50 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 2325..2335

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 60.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                              int selectedValue = JmriJOptionPane.showOptionDialog(dispatcherFrame,
                                                                                                                                                                                      Bundle.getMessage("Question4"), Bundle.getMessage("WarningTitle"),
                                                                                                                                                                                      JmriJOptionPane.DEFAULT_OPTION, JmriJOptionPane.QUESTION_MESSAGE, null,
                                                                                                                                                                                      new Object[]{Bundle.getMessage("ButtonOverride"), Bundle.getMessage("ButtonNo")},
                                                                                                                                                                                      Bundle.getMessage("ButtonNo"));
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 2 other locations - About 50 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1789..1793
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 2144..2148

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 58.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                  int selectedValue = JmriJOptionPane.showOptionDialog(dispatcherFrame,
                                                                                                                                                                                          Bundle.getMessage("Question2"), Bundle.getMessage("WarningTitle"),
                                                                                                                                                                                          JmriJOptionPane.DEFAULT_OPTION, JmriJOptionPane.QUESTION_MESSAGE, null,
                                                                                                                                                                                          new Object[]{Bundle.getMessage("ButtonOverride"), Bundle.getMessage("ButtonNo")},
                                                                                                                                                                                          Bundle.getMessage("ButtonNo"));
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 2 other locations - About 50 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1789..1793
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1803..1807

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 58.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                              int selectedValue = JmriJOptionPane.showOptionDialog(dispatcherFrame,
                                                                                                                                                                                      Bundle.getMessage("Question1"), Bundle.getMessage("WarningTitle"),
                                                                                                                                                                                      JmriJOptionPane.DEFAULT_OPTION, JmriJOptionPane.QUESTION_MESSAGE, null,
                                                                                                                                                                                      new Object[]{Bundle.getMessage("ButtonOverride"), Bundle.getMessage("ButtonNo")},
                                                                                                                                                                                      Bundle.getMessage("ButtonNo"));
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 2 other locations - About 50 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1803..1807
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 2144..2148

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                      for (int j = restartingTrainsList.size(); j > 0; j--) {
                                                                                                                                                                                          if (restartingTrainsList.get(j - 1) == at) {
                                                                                                                                                                                              restartingTrainsList.remove(j - 1);
                                                                                                                                                                                              return;
                                                                                                                                                                                          }
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 45 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1062..1067

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 54.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                              for (int j = restartingTrainsList.size(); j > 0; j--) {
                                                                                                                                                                                  if (restartingTrainsList.get(j - 1) == at) {
                                                                                                                                                                                      restartingTrainsList.remove(j - 1);
                                                                                                                                                                                      return;
                                                                                                                                                                                  }
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 45 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3155..3160

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 54.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          for (int i = allocatedSections.size(); i > 0; i--) {
                                                                                                                                                                              if (as == allocatedSections.get(i - 1)) {
                                                                                                                                                                                  allocatedSections.remove(i - 1);
                                                                                                                                                                              }
                                                                                                                                                                          }
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 40 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1573..1577

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  case OCCUPANCY_COLUMN:
                                                                                                                                                                                      if (!_HasOccupancyDetection) {
                                                                                                                                                                                          return Bundle.getMessage("UNKNOWN");
                                                                                                                                                                                      }
                                                                                                                                                                                      if (ar.getSection().getOccupancy() == Section.OCCUPIED) {
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 40 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3493..3500

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                          for (int j = restartingTrainsList.size(); j > 0; j--) {
                                                                                                                                                                              if (at == restartingTrainsList.get(j - 1)) {
                                                                                                                                                                                  restartingTrainsList.remove(j - 1);
                                                                                                                                                                              }
                                                                                                                                                                          }
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 40 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 2526..2530

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  case OCCUPANCY_COLUMN:
                                                                                                                                                                                      if (!_HasOccupancyDetection) {
                                                                                                                                                                                          return Bundle.getMessage("UNKNOWN");
                                                                                                                                                                                      }
                                                                                                                                                                                      if (as.getSection().getOccupancy() == Section.OCCUPIED) {
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 40 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3332..3339

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  case TRANSIT_COLUMN_U:
                                                                                                                                                                                      if (as.getActiveTrain().getTransit() != null && as.getActiveTrain().getTransit().getUserName() != null) {
                                                                                                                                                                                          return (as.getActiveTrain().getTransit().getUserName());
                                                                                                                                                                                      } else {
                                                                                                                                                                                          return "";
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 40 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3303..3308

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 50.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                  case TRANSIT_COLUMN_U:
                                                                                                                                                                                      if (ar.getActiveTrain().getTransit() != null && ar.getActiveTrain().getTransit().getUserName() != null) {
                                                                                                                                                                                          return (ar.getActiveTrain().getTransit().getUserName());
                                                                                                                                                                                      } else {
                                                                                                                                                                                          return "";
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 40 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3473..3478

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 50.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                  for (int i = delayedTrains.size() - 1; i >= 0; i--) {
                                                                                                                                                                                      if (delayedTrains.get(i) == at) {
                                                                                                                                                                                          delayedTrains.remove(i);
                                                                                                                                                                                      }
                                                                                                                                                                                  }
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 40 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/AutoTrainAction.java on lines 240..244

                                                                                                                                                                  Duplicated Code

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

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

                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 ((ar.getActiveTrain() == at) && (ar.getSection() == s) && (ar.getSectionSeqNumber() == seq)
                                                                                                                                                                                      && (ar.getSectionDirection() == dir)) {
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java on lines 2827..2830

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 46.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          for (int i = 0; i < allocationRequests.size(); i++) {
                                                                                                                                                                              if (ar == allocationRequests.get(i)) {
                                                                                                                                                                                  ix = i;
                                                                                                                                                                              }
                                                                                                                                                                          }
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 2 other locations - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/Block.java on lines 440..444
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/ActiveTrain.java on lines 825..829

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  case TRANSIT_COLUMN_U:
                                                                                                                                                                                      if (at.getTransit() != null && at.getTransit().getUserName() != null) {
                                                                                                                                                                                          return (at.getTransit().getUserName());
                                                                                                                                                                                      } else {
                                                                                                                                                                                          return "";
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 4 other locations - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3086..3091
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3098..3103
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3321..3326
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3487..3492

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  case SECTION_COLUMN_U:
                                                                                                                                                                                      if (as.getSection() != null && as.getSection().getUserName() != null) {
                                                                                                                                                                                          return (as.getSection().getUserName());
                                                                                                                                                                                      } else {
                                                                                                                                                                                          return "<none>";
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 4 other locations - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3066..3071
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3086..3091
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3098..3103
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3321..3326

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  case NEXTSECTION_COLUMN_U:
                                                                                                                                                                                      if (at.getNextSectionToAllocate() != null && at.getNextSectionToAllocate().getUserName() != null) {
                                                                                                                                                                                          return (at.getNextSectionToAllocate().getUserName());
                                                                                                                                                                                      } else {
                                                                                                                                                                                          return "<none>";
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 4 other locations - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3066..3071
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3086..3091
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3321..3326
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3487..3492

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  case SECTION_COLUMN_U:
                                                                                                                                                                                      if (ar.getSection() != null && ar.getSection().getUserName() != null) {
                                                                                                                                                                                          return (ar.getSection().getUserName());
                                                                                                                                                                                      } else {
                                                                                                                                                                                          return "<none>";
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 4 other locations - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3066..3071
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3086..3091
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3098..3103
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3487..3492

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  case ALLOCATED_COLUMN_U:
                                                                                                                                                                                      if (at.getLastAllocatedSection() != null && at.getLastAllocatedSection().getUserName() != null) {
                                                                                                                                                                                          return (at.getLastAllocatedSection().getUserName());
                                                                                                                                                                                      } else {
                                                                                                                                                                                          return "<none>";
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 4 other locations - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3066..3071
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3098..3103
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3321..3326
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 3487..3492

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 44.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          if ((trainID == null) || trainID.equals("")) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, Bundle.getMessage("Error3"),
                                                                                                                                                                                          Bundle.getMessage("ErrorTitle"), JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                              }
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1352..1359

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 44.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                          if (autoRun && ((dccAddress == null) || dccAddress.equals(""))) {
                                                                                                                                                                              if (showErrorMessages) {
                                                                                                                                                                                  JmriJOptionPane.showMessageDialog(frame, Bundle.getMessage("Error10"),
                                                                                                                                                                                          Bundle.getMessage("ErrorTitle"), JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                              }
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1262..1269

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 44.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                  if (!_UseConnectivity || (editorManager.getAll(LayoutEditor.class).size() == 0)) {
                                                                                                                                                                                      if (showErrorMessages) {
                                                                                                                                                                                          JmriJOptionPane.showMessageDialog(frame, Bundle.getMessage("Error33"),
                                                                                                                                                                                                  Bundle.getMessage("ErrorTitle"), JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                                          log.error("AutoRun requested without a LayoutEditor panel for connectivity.");
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1372..1379

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 44.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                  if (!_HasOccupancyDetection) {
                                                                                                                                                                                      if (showErrorMessages) {
                                                                                                                                                                                          JmriJOptionPane.showMessageDialog(frame, Bundle.getMessage("Error35"),
                                                                                                                                                                                                  Bundle.getMessage("ErrorTitle"), JmriJOptionPane.ERROR_MESSAGE);
                                                                                                                                                                                          log.error("AutoRun requested without occupancy detection.");
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 35 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 1364..1371

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                  Tuning

                                                                                                                                                                  This issue has a mass of 44.

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

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

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

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

                                                                                                                                                                  Refactorings

                                                                                                                                                                  Further Reading

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

                                                                                                                                                                              case OVERRIDETYPE_ROSTER:
                                                                                                                                                                                  tSource = ActiveTrain.ROSTER;
                                                                                                                                                                                  rosterIDToUse = overRideValue;
                                                                                                                                                                                  if (trainNameToUse.isEmpty()) {
                                                                                                                                                                                      trainNameToUse = overRideValue;
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 30 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 250..256

                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                              case OVERRIDETYPE_DCCADDRESS:
                                                                                                                                                                                  tSource = ActiveTrain.USER;
                                                                                                                                                                                  dccAddressToUse = overRideValue;
                                                                                                                                                                                  if (trainNameToUse.isEmpty()) {
                                                                                                                                                                                      trainNameToUse = overRideValue;
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java and 1 other location - About 30 mins to fix
                                                                                                                                                                  java/src/jmri/jmrit/dispatcher/DispatcherFrame.java on lines 261..267

                                                                                                                                                                  Duplicated Code

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

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

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