java/src/jmri/jmrit/logix/WarrantFrame.java

Summary

Maintainability
F
2 wks
Test Coverage
F
58%

File WarrantFrame.java has 1988 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.logix;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
Severity: Major
Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 5 days to fix

    WarrantFrame has 48 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class WarrantFrame extends WarrantRoute {
    
        int _rowHeight;
        private Warrant _warrant; // unregistered warrant - may be a copy of a
                                  // registered warrant
    Severity: Minor
    Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 6 hrs to fix

      Method setValueAt has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring.
      Open

              @Override
              @SuppressFBWarnings(value = "DB_DUPLICATE_SWITCH_CLAUSES",
                      justification = "put least likely cases last for efficiency")
              public void setValueAt(Object value, int row, int col) {
                  if (row >= _throttleCommands.size()) {
      Severity: Minor
      Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 6 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method checkThrottleCommands has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring.
      Open

          private String checkThrottleCommands() {
              if (_throttleCommands.size() <= getOrders().size() + 1) {
                  return Bundle.getMessage("NoCommands", _warrant.getDisplayName());
              }
              float lastSpeed = 0.0f;
      Severity: Minor
      Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 6 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method propertyChange has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
      Open

          @Override
          public void propertyChange(java.beans.PropertyChangeEvent e) {
              String property = e.getPropertyName();
              if (property.equals("DnDrop")) {
                  doAction(e.getSource());
      Severity: Minor
      Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          @Override
          public void propertyChange(java.beans.PropertyChangeEvent e) {
              String property = e.getPropertyName();
              if (property.equals("DnDrop")) {
                  doAction(e.getSource());
      Severity: Major
      Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 5 hrs to fix

        Method setValueAt has 130 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                @Override
                @SuppressFBWarnings(value = "DB_DUPLICATE_SWITCH_CLAUSES",
                        justification = "put least likely cases last for efficiency")
                public void setValueAt(Object value, int row, int col) {
                    if (row >= _throttleCommands.size()) {
        Severity: Major
        Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 5 hrs to fix

          Method save has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring.
          Open

              private boolean save() {
                  boolean fatal = false;
                  String msg = null;
                  if (isRunning()) {
                      msg = Bundle.getMessage("CannotEdit", _warrant.getDisplayName());
          Severity: Minor
          Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 5 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Method save has 112 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private boolean save() {
                  boolean fatal = false;
                  String msg = null;
                  if (isRunning()) {
                      msg = Bundle.getMessage("CannotEdit", _warrant.getDisplayName());
          Severity: Major
          Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 4 hrs to fix

            Method checkThrottleCommands has 101 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private String checkThrottleCommands() {
                    if (_throttleCommands.size() <= getOrders().size() + 1) {
                        return Bundle.getMessage("NoCommands", _warrant.getDisplayName());
                    }
                    float lastSpeed = 0.0f;
            Severity: Major
            Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 4 hrs to fix

              Method makeSetPowerTabPanel has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private JPanel makeSetPowerTabPanel() {
                      JPanel tab2 = new JPanel();
                      tab2.setLayout(new BoxLayout(tab2, BoxLayout.PAGE_AXIS));
                      tab2.add(makeTabMidPanel());
              
              
              Severity: Major
              Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 3 hrs to fix

                Method runLearnModeTrain has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private void runLearnModeTrain() {
                        _warrant.setSpeedUtil(_speedUtil); // transfer SpeedUtil to warrant
                        String msg = null;
                        if (isRunning()) {
                            msg = Bundle.getMessage("CannotRun", _warrant.getDisplayName(),
                Severity: Major
                Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 2 hrs to fix

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

                      private JPanel makeThrottleTablePanel() {
                          _commandTable = new JTable(_commandModel);
                          DefaultCellEditor ed = (DefaultCellEditor) _commandTable.getDefaultEditor(String.class);
                          ed.setClickCountToStart(1);
                  
                  
                  Severity: Major
                  Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 2 hrs to fix

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

                        protected void runTrain() {
                            long time = System.currentTimeMillis();
                            if (time - lastClicktime < 1000) {
                                return;
                            }
                    Severity: Major
                    Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 2 hrs to fix

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

                          private float setup(Warrant warrant, boolean omitLastBlockCmds) {
                              _origin.setOrder(warrant.getfirstOrder());
                              _destination.setOrder(warrant.getLastOrder());
                              _via.setOrder(warrant.getViaOrder());
                              _avoid.setOrder(warrant.getAvoidOrder());
                      Severity: Major
                      Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 2 hrs to fix

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

                            private JPanel makePlaybackPanel() {
                                JPanel runPanel = new JPanel();
                                runPanel.setLayout(new BoxLayout(runPanel, BoxLayout.LINE_AXIS));
                                runPanel.add(Box.createHorizontalStrut(STRUT_SIZE));
                        
                        
                        Severity: Minor
                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

                          Method init has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private void init() {
                                  _commandModel = new ThrottleTableModel();
                          
                                  JPanel contentPane = new JPanel();
                                  contentPane.setLayout(new BorderLayout(5, 5));
                          Severity: Minor
                          Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

                            Method makeTabMidPanel has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private JPanel makeTabMidPanel() {
                                    JPanel midPanel = new JPanel();
                                    midPanel.setLayout(new BoxLayout(midPanel, BoxLayout.PAGE_AXIS));
                            
                                    JPanel tablePanel = new JPanel();
                            Severity: Minor
                            Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

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

                                  private JPanel makeFindRouteTabPanel() {
                                      JPanel tab1 = new JPanel();
                                      tab1.setLayout(new BoxLayout(tab1, BoxLayout.LINE_AXIS));
                                      tab1.add(Box.createHorizontalStrut(STRUT_SIZE));
                              
                              
                              Severity: Minor
                              Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

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

                                    private JPanel makeEditableButtonPanel() {
                                        JPanel buttonPanel = new JPanel();
                                        buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
                                        buttonPanel.add(Box.createHorizontalStrut(10 * STRUT_SIZE));
                                
                                
                                Severity: Minor
                                Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

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

                                      private JPanel makeSCParamPanel() {
                                          JPanel scParamPanel = new JPanel();
                                          scParamPanel.setLayout(new BoxLayout(scParamPanel, BoxLayout.PAGE_AXIS));
                                          scParamPanel.add(Box.createHorizontalStrut(STRUT_SIZE));
                                  
                                  
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

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

                                            @Override
                                            public Object getValueAt(int row, int col) {
                                                // some error checking
                                                if (row >= _throttleCommands.size()) {
                                                    if (log.isDebugEnabled())
                                    Severity: Minor
                                    Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

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

                                          private void stopRunTrain(boolean aborted) {
                                              if (_learnThrottle != null) {
                                                  _learnThrottle.dispose();
                                                  _learnThrottle = null;
                                              }
                                      Severity: Minor
                                      Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

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

                                                @Override
                                                public Component getTableCellEditorComponent(JTable table, Object value,
                                                        boolean isSelected, int row, int col) {
                                                    if (log.isDebugEnabled()) {
                                                        log.debug("getValueCellEditorComponent: row= {}, column= {} selected = {} value= {}",
                                        Severity: Minor
                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

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

                                              private void speedUnitsAction() {
                                                  switch (_displayPref) {
                                                      case MPH:
                                                          _displayPref = Display.KPH;
                                                          _speedConversion = _scale * 3.6f;
                                          Severity: Minor
                                          Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 1 hr to fix

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

                                                    public Component getTableCellRendererComponent(JTable table, Object value,
                                                            boolean isSelected, boolean hasFocus, int row, int column) {
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 35 mins to fix

                                              Method runTrain has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                                              Open

                                                  protected void runTrain() {
                                                      long time = System.currentTimeMillis();
                                                      if (time - lastClicktime < 1000) {
                                                          return;
                                                      }
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 35 mins to fix

                                              Cognitive Complexity

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

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

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

                                              Further reading

                                              Avoid too many return statements within this method.
                                              Open

                                                                      return Bundle.getMessage("badThrottleCommand",
                                                                              i + 1, cmd.toString(), valType.toString());
                                              Severity: Major
                                              Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                        return msg +
                                                                                '\n' +
                                                                                Bundle.getMessage("badThrottleCommand",
                                                                                        i + 1, cmd.toString(), valType.toString());
                                                Severity: Major
                                                Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return Bundle.getMessage("BadLastSpeed", lastSpeed);
                                                  Severity: Major
                                                  Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                            return Bundle.getMessage("badThrottleCommand",
                                                                                    i + 1, cmd.toString(), valType.toString());
                                                    Severity: Major
                                                    Found in java/src/jmri/jmrit/logix/WarrantFrame.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/logix/WarrantFrame.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                                return Bundle.getMessage("badThrottleCommand",
                                                                                        i + 1, cmd.toString(), valType.toString());
                                                        Severity: Major
                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                                  return Bundle.getMessage("badThrottleCommand",
                                                                                          i + 1, cmd.toString(), valType.toString());
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                                return Bundle.getMessage("BadThrottleSetting", i + 1);
                                                            Severity: Major
                                                            Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                                      return Bundle.getMessage("badThrottleCommand",
                                                                                              i + 1, cmd.toString(), valType.toString());
                                                              Severity: Major
                                                              Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                                        return Bundle.getMessage("badThrottleCommand",
                                                                                                i + 1, cmd.toString(), valType.toString());
                                                                Severity: Major
                                                                Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                                          return msg +
                                                                                                  '\n' +
                                                                                                  Bundle.getMessage("badThrottleCommand",
                                                                                                          i + 1, cmd.toString(), valType.toString());
                                                                  Severity: Major
                                                                  Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                            return Bundle.getMessage("badThrottleCommand",
                                                                                                    i + 1, cmd.toString(), valType.toString());
                                                                    Severity: Major
                                                                    Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                              return Bundle.getMessage("badThrottleCommand",
                                                                                                      i + 1, cmd.toString(), valType.toString());
                                                                      Severity: Major
                                                                      Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 30 mins to fix

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

                                                                            private void stopRunTrain(boolean aborted) {
                                                                                if (_learnThrottle != null) {
                                                                                    _learnThrottle.dispose();
                                                                                    _learnThrottle = null;
                                                                                }
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java - About 25 mins to fix

                                                                        Cognitive Complexity

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

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

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

                                                                        Further reading

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

                                                                                for (ThrottleSetting ts : _throttleCommands) {
                                                                                    CommandValue cmdVal = ts.getValue();
                                                                                    ValueType valType = cmdVal.getType();
                                                                                    switch (valType) {
                                                                                        case VAL_FLOAT:
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 1 hr to fix
                                                                        java/src/jmri/jmrit/logix/Warrant.java on lines 409..425

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 92.

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

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

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

                                                                        See codeclimate-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 {
                                                                                                        ListIterator<Float> iter = ramp.speedIterator(false);
                                                                                                        while (iter.hasPrevious()) {
                                                                                                            float speedSetting = iter.previous().floatValue();
                                                                                                            _throttleCommands.add(new ThrottleSetting(et, Command.SPEED, -1, ValueType.VAL_FLOAT,
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 1 hr to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 160..168

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 80.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                                    if (ramp.isUpRamp()) {
                                                                                                        ListIterator<Float> iter = ramp.speedIterator(true);
                                                                                                        while (iter.hasNext()) {
                                                                                                            float speedSetting = iter.next().floatValue();
                                                                                                            _throttleCommands.add(new ThrottleSetting(et, Command.SPEED, -1, ValueType.VAL_FLOAT,
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 1 hr to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 168..176

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 80.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                    class CellMaker implements Runnable {
                                                                                        Dimension dim;
                                                                        
                                                                                        CellMaker(Dimension d) {
                                                                                            dim = d;
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 1 hr to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1762..1778

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 79.

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

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

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

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

                                                                                    class CellMaker implements Runnable {
                                                                                        Dimension dim;
                                                                        
                                                                                        CellMaker(Dimension d) {
                                                                                            dim = d;
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 1 hr to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1814..1830

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 79.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                            } else if (property.equals("WarrantOverrun")) {
                                                                                                String blkName = (String) e.getOldValue();
                                                                                                OBlock warName = (OBlock) e.getNewValue();
                                                                                                msg = Bundle.getMessage("WarrantOverrun",
                                                                                                        _warrant.getTrainName(), blkName, warName);
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 2 other locations - About 45 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1462..1468
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1456..1462

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 56.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                            } else if (property.equals("OccupyOverrun")) {
                                                                                                String blockName = (String) e.getOldValue();
                                                                                                OBlock occuppier = (OBlock) e.getNewValue();
                                                                                                msg = Bundle.getMessage("OccupyOverrun",
                                                                                                        _warrant.getTrainName(), blockName, occuppier);
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 2 other locations - About 45 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1468..1474
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1456..1462

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 56.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                            } else if (property.equals("SignalOverrun")) {
                                                                                                String name = (String) e.getOldValue();
                                                                                                String speed = (String) e.getNewValue();
                                                                                                msg = Bundle.getMessage("SignalOverrun",
                                                                                                        _warrant.getTrainName(), speed, name);
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 2 other locations - About 45 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1468..1474
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1462..1468

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 56.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                        case LATCHF:
                                                                                            if (valType != ValueType.VAL_ON && valType != ValueType.VAL_OFF) {
                                                                                                return Bundle.getMessage("badThrottleCommand",
                                                                                                        i + 1, cmd.toString(), valType.toString());
                                                                                            }
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 40 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1052..1057

                                                                        Duplicated Code

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

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

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 FORWARD:
                                                                                            if (valType != ValueType.VAL_TRUE && valType != ValueType.VAL_FALSE) {
                                                                                                return Bundle.getMessage("badThrottleCommand",
                                                                                                        i + 1, cmd.toString(), valType.toString());
                                                                                            }
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 40 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1059..1064

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 50.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                edge.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(java.awt.Color.BLACK),
                                                                                        Bundle.getMessage("RunParameters"),
                                                                                        javax.swing.border.TitledBorder.CENTER,
                                                                                        javax.swing.border.TitledBorder.TOP));
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 7 other locations - About 40 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 409..412
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 419..422
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 429..432
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 449..452
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 508..511
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 363..366
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 400..403

                                                                        Duplicated Code

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

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

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

                                                                                edge.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(java.awt.Color.BLACK),
                                                                                        Bundle.getMessage("SelectType"),
                                                                                        javax.swing.border.TitledBorder.CENTER,
                                                                                        javax.swing.border.TitledBorder.TOP));
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 7 other locations - About 40 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 419..422
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 429..432
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 439..442
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 449..452
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 508..511
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 363..366
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 400..403

                                                                        Duplicated Code

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

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

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

                                                                                edge.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(java.awt.Color.BLACK),
                                                                                        Bundle.getMessage("SetSCParameters"),
                                                                                        javax.swing.border.TitledBorder.CENTER,
                                                                                        javax.swing.border.TitledBorder.TOP));
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 7 other locations - About 40 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 409..412
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 429..432
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 439..442
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 449..452
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 508..511
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 363..366
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 400..403

                                                                        Duplicated Code

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

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

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

                                                                                edge.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(java.awt.Color.BLACK),
                                                                                        Bundle.getMessage("RunTrain"),
                                                                                        javax.swing.border.TitledBorder.CENTER,
                                                                                        javax.swing.border.TitledBorder.TOP));
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 7 other locations - About 40 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 409..412
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 419..422
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 429..432
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 439..442
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 508..511
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 363..366
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 400..403

                                                                        Duplicated Code

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

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

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

                                                                                edge.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(java.awt.Color.BLACK),
                                                                                        Bundle.getMessage("SetPower"),
                                                                                        javax.swing.border.TitledBorder.CENTER,
                                                                                        javax.swing.border.TitledBorder.TOP));
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 7 other locations - About 40 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 409..412
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 419..422
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 429..432
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 439..442
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 449..452
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 363..366
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 400..403

                                                                        Duplicated Code

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

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

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

                                                                                edge.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(java.awt.Color.BLACK),
                                                                                        Bundle.getMessage("LearnMode"),
                                                                                        javax.swing.border.TitledBorder.CENTER,
                                                                                        javax.swing.border.TitledBorder.TOP));
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 7 other locations - About 40 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 409..412
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 419..422
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 439..442
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 449..452
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 508..511
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 363..366
                                                                        java/src/jmri/jmrit/logix/WarrantPreferencesPanel.java on lines 400..403

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 48.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                for (int i = 0; i < _commandModel.getColumnCount(); i++) {
                                                                                    int width = _commandModel.getPreferredWidth(i);
                                                                                    columnModel.getColumn(i).setPreferredWidth(width);
                                                                                }
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 35 mins to fix
                                                                        java/src/jmri/jmrit/beantable/OBlockTablePanel.java on lines 101..104

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 46.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                if (_saveWarrant != null && _saveWarrant instanceof SCWarrant) {
                                                                                    setPanelEnabled(scParamPanel, true);
                                                                                    setPanelEnabled(learnPanel, false);
                                                                                    setPanelEnabled(paramsPanel, false);
                                                                                    setPanelEnabled(runPanel, false);
                                                                        Severity: Major
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 8 other locations - About 30 mins to fix
                                                                        java/src/jmri/jmrit/consisttool/ConsistToolFrame.java on lines 471..477
                                                                        java/src/jmri/jmrit/logixng/util/swing/LogixNG_SelectStringSwing.java on lines 99..105
                                                                        java/src/jmri/jmrit/roster/swing/speedprofile/SpeedProfilePanel.java on lines 607..613
                                                                        java/src/jmri/jmrit/roster/swing/speedprofile/SpeedProfilePanel.java on lines 601..607
                                                                        java/src/jmri/jmrit/simplelightctrl/SimpleLightCtrlFrame.java on lines 253..259
                                                                        java/src/jmri/jmrit/throttle/ThrottleWindow.java on lines 208..214
                                                                        java/src/jmri/jmrit/throttle/ThrottleWindow.java on lines 202..208
                                                                        java/src/jmri/jmrix/can/cbus/swing/console/CbusConsoleDecodeOptionsPane.java on lines 143..150

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 42.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                _isSCWarrant.addActionListener((ActionEvent e) -> {
                                                                                    setPanelEnabled(scParamPanel, true);
                                                                                    setPanelEnabled(learnPanel, false);
                                                                                    setPanelEnabled(paramsPanel, false);
                                                                                    setPanelEnabled(runPanel, false);
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 30 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 473..478

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 42.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                _isWarrant.addActionListener((ActionEvent e) -> {
                                                                                    setPanelEnabled(scParamPanel, false);
                                                                                    setPanelEnabled(learnPanel, true);
                                                                                    setPanelEnabled(paramsPanel, true);
                                                                                    setPanelEnabled(runPanel, true);
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 30 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 459..464

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 42.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                        case NOOP:
                                                                                            if (valType != ValueType.VAL_NOOP) {
                                                                                                return Bundle.getMessage("badThrottleCommand",
                                                                                                        i + 1, cmd.toString(), valType.toString());
                                                                                            }
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 30 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1102..1107

                                                                        Duplicated Code

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

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

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

                                                                                            if (msg != null) {
                                                                                                return msg +
                                                                                                        '\n' +
                                                                                                        Bundle.getMessage("badThrottleCommand",
                                                                                                                i + 1, cmd.toString(), valType.toString());
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 30 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1095..1100

                                                                        Duplicated Code

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

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

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

                                                                                            if (ts == null || ts.getCommand() == null) {
                                                                                                msg = Bundle.getMessage("nullValue", Bundle.getMessage("CommandCol"));
                                                                                                break;
                                                                                            }
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 30 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 2188..2191

                                                                        Duplicated Code

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

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

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

                                                                                            if (ts == null || ts.getCommand() == null) {
                                                                                                msg = Bundle.getMessage("nullValue", Bundle.getMessage("CommandCol"));
                                                                                                break;
                                                                                            }
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 30 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 2212..2215

                                                                        Duplicated Code

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

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

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 SPEEDSTEP:
                                                                                            if (valType != ValueType.VAL_STEP) {
                                                                                                return Bundle.getMessage("badThrottleCommand",
                                                                                                        i + 1, cmd.toString(), valType.toString());
                                                                                            }
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 30 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1046..1051

                                                                        Duplicated Code

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

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

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

                                                                                            if (msg != null) {
                                                                                                return msg +
                                                                                                        '\n' +
                                                                                                        Bundle.getMessage("badThrottleCommand",
                                                                                                                i + 1, cmd.toString(), valType.toString());
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 1 other location - About 30 mins to fix
                                                                        java/src/jmri/jmrit/logix/WarrantFrame.java on lines 1077..1082

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 40.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                if (bo != null) {
                                                                                    OBlock block = bo.getBlock();
                                                                                    if (block != null) {
                                                                                        bName = block.getDisplayName();
                                                                                    }
                                                                        Severity: Minor
                                                                        Found in java/src/jmri/jmrit/logix/WarrantFrame.java and 2 other locations - About 30 mins to fix
                                                                        java/src/jmri/jmrit/display/layoutEditor/LayoutTurntable.java on lines 505..510
                                                                        java/src/jmri/jmrit/display/layoutEditor/LayoutTurntableView.java on lines 469..474

                                                                        Duplicated Code

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

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

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