java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java

Summary

Maintainability
F
3 wks
Test Coverage
B
86%

File TimeTableFrame.java has 2265 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.timetable.swing;

import java.awt.*;
import java.awt.event.*;
import java.io.File;
Severity: Major
Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 6 days to fix

    TimeTableFrame has 94 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class TimeTableFrame extends jmri.util.JmriJFrame {
    
        public static final String EMPTY_GRID = "EmptyGrid";
    
        public TimeTableFrame() {
    Severity: Major
    Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 day to fix

      Method createFrame has 166 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void createFrame() {
              Container contentPane = getContentPane();
              contentPane.setLayout(new BorderLayout());
      
              // ------------ Body - tree (left side) ------------
      Severity: Major
      Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 6 hrs to fix

        Method updateLayout has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring.
        Open

            void updateLayout() {
                Layout layout = _dataMgr.getLayout(_curNodeId);
        
                // Pre-validate and convert inputs
                String newName = _editLayoutName.getText().trim();
        Severity: Minor
        Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method exportCsvPressed has 106 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            void exportCsvPressed() {
                // Select layout
                List<Layout> layouts = _dataMgr.getLayouts(true);
                if (layouts.size() == 0) {
                    JmriJOptionPane.showMessageDialog(this,
        Severity: Major
        Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 4 hrs to fix

          Method treeRowSelected has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              void treeRowSelected(TimeTableTreeNode selectedNode) {
                  // Set the current node variables
                  _curNode = selectedNode;
                  _curNodeId = selectedNode.getId();
                  _curNodeType = selectedNode.getType();
          Severity: Major
          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 3 hrs to fix

            Method updateTrain has 90 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                void updateTrain() {
                    Train train = _dataMgr.getTrain(_curNodeId);
                    List<String> exceptionList = new ArrayList<>();
            
                    // Pre-validate and convert inputs
            Severity: Major
            Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 3 hrs to fix

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

                  void updateLayout() {
                      Layout layout = _dataMgr.getLayout(_curNodeId);
              
                      // Pre-validate and convert inputs
                      String newName = _editLayoutName.getText().trim();
              Severity: Major
              Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 3 hrs to fix

                Method updateStation has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    void updateStation() {
                        Station station = _dataMgr.getStation(_curNodeId);
                
                        // Pre-validate and convert inputs
                        String newName = _editStationName.getText().trim();
                Severity: Major
                Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 3 hrs to fix

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

                      void buildComponents() {
                          // Layout
                          _editLayoutName = new JTextField(20);
                          _editScale = new JComboBox<>();
                          _editScale.addItemListener(layoutScaleItemEvent);
                  Severity: Major
                  Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 2 hrs to fix

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

                        void updateStop() {
                            Stop stop = _dataMgr.getStop(_curNodeId);
                    
                            // Pre-validate and convert inputs
                            TimeTableDataManager.SegmentStation stopSegmentStation =
                    Severity: Major
                    Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 2 hrs to fix

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

                          void updateStation() {
                              Station station = _dataMgr.getStation(_curNodeId);
                      
                              // Pre-validate and convert inputs
                              String newName = _editStationName.getText().trim();
                      Severity: Minor
                      Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 2 hrs to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Method updateSchedule has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          void updateSchedule() {
                              Schedule schedule = _dataMgr.getSchedule(_curNodeId);
                      
                              // Pre-validate and convert inputs
                              String newName = _editScheduleName.getText().trim();
                      Severity: Major
                      Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 2 hrs to fix

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

                            void deleteSegment() {
                                List<Station> stationList = new ArrayList<>(_dataMgr.getStations(_curNodeId, true));
                                if (!stationList.isEmpty()) {
                                    // The segment still has stations.  See if any are still used by Stops
                                    List<Station> activeList = new ArrayList<>();
                        Severity: Minor
                        Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

                          Method graphPressed has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              void graphPressed(String graphType) {
                          
                                  // select a schedule if necessary
                                  Segment segment = _dataMgr.getSegment(_curNodeId);
                                  Layout layout = _dataMgr.getLayout(segment.getLayoutId());
                          Severity: Minor
                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                void makeDetailGrid(String gridType) {
                                    _detailGrid.setVisible(false);
                                    _detailGrid.removeAll();
                                    _detailFooter.setVisible(true);
                            
                            
                            Severity: Minor
                            Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

                              Method createMenu has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  void createMenu() {
                                      _showTrainTimes = InstanceManager.getDefault(jmri.UserPreferencesManager.class).
                                              getSimplePreferenceState("jmri.jmrit.timetable:TrainTimes");      // NOI18N
                              
                                      JCheckBoxMenuItem trainTime = new JCheckBoxMenuItem(Bundle.getMessage("MenuTrainTimes"));  // NOI18N
                              Severity: Minor
                              Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                    void deleteLayout() {
                                        Object[] options = {Bundle.getMessage("ButtonNo"), Bundle.getMessage("ButtonYes")};  // NOI18N
                                        int selectedOption = JmriJOptionPane.showOptionDialog(this,
                                                Bundle.getMessage("LayoutCascade"), // NOI18N
                                                Bundle.getMessage("QuestionTitle"),   // NOI18N
                                Severity: Minor
                                Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                      void createTimeTableContent() {
                                          for (Layout l : _dataMgr.getLayouts(true)) {
                                              _layoutNode = new TimeTableTreeNode(l.getLayoutName(), "Layout", l.getLayoutId(), 0);    // NOI18N
                                              _timetableRoot.add(_layoutNode);
                                  
                                  
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                        void editPressed() {
                                            switch (_curNodeType) {
                                                case "Layout":     // NOI18N
                                                    editLayout();
                                                    makeDetailGrid("Layout");  // NOI18N
                                    Severity: Minor
                                    Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                          void updateTrain() {
                                              Train train = _dataMgr.getTrain(_curNodeId);
                                              List<String> exceptionList = new ArrayList<>();
                                      
                                              // Pre-validate and convert inputs
                                      Severity: Minor
                                      Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

                                      Cognitive Complexity

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

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

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

                                      Further reading

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

                                          JTree buildTree() {
                                              _timetableRoot = new DefaultMutableTreeNode("Root Node");      // NOI18N
                                              _timetableModel = new DefaultTreeModel(_timetableRoot);
                                              _timetableTree = new JTree(_timetableModel);
                                      
                                      
                                      Severity: Minor
                                      Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                            void moveTreeNode(String direction) {
                                                // Update the node
                                                if (direction.equals("Up")) {    // NOI18N
                                                    _curNodeRow -= 1;
                                                } else {
                                        Severity: Minor
                                        Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                              void duplicateLayout(int layoutId) {
                                                  dupLayout = true;
                                                  Layout layout = _dataMgr.getLayout(layoutId);
                                                  Layout newLayout = layout.getCopy();
                                                  setShowReminder(true);
                                          Severity: Minor
                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                                void updatePressed() {
                                                    switch (_curNodeType) {
                                                        case "Layout":     // NOI18N
                                                            updateLayout();
                                                            break;
                                            Severity: Minor
                                            Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                                  void exportCsvPressed() {
                                                      // Select layout
                                                      List<Layout> layouts = _dataMgr.getLayouts(true);
                                                      if (layouts.size() == 0) {
                                                          JmriJOptionPane.showMessageDialog(this,
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

                                              Cognitive Complexity

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

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

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

                                              Further reading

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

                                                  void duplicatePressed() {
                                                      _dataMgr.setLockCalculate(true);
                                                      switch (_curNodeType) {
                                                          case "Layout":     // NOI18N
                                                              duplicateLayout(_curNodeId);
                                              Severity: Minor
                                              Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                                    void deleteSchedule() {
                                                        List<Train> trainList = new ArrayList<>(_dataMgr.getTrains(_curNodeId, 0, true));
                                                        if (!trainList.isEmpty()) {
                                                            // The schedule still has trains.
                                                            // Present the option to delete the stops, trains and the schedule
                                                Severity: Minor
                                                Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                                      void completeImport(File file) {
                                                          try {
                                                              feedbackList = new TimeTableCsvImport().importCsv(file);
                                                          } catch (IOException ex) {
                                                              log.error("Import exception", ex); // NOI18N
                                                  Severity: Minor
                                                  Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

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

                                                            @Override
                                                            public void itemStateChanged(ItemEvent e) {
                                                                if (e.getStateChange() == ItemEvent.SELECTED) {
                                                                    if (_editScale.hasFocus()) {
                                                                        Scale scale = (Scale) _editScale.getSelectedItem();
                                                    Severity: Minor
                                                    Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 1 hr to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                          return;
                                                      Severity: Major
                                                      Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                        return;
                                                        Severity: Major
                                                        Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 30 mins to fix

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

                                                              void updateSchedule() {
                                                                  Schedule schedule = _dataMgr.getSchedule(_curNodeId);
                                                          
                                                                  // Pre-validate and convert inputs
                                                                  String newName = _editScheduleName.getText().trim();
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 25 mins to fix

                                                          Cognitive Complexity

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

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

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

                                                          Further reading

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

                                                              void updateStop() {
                                                                  Stop stop = _dataMgr.getStop(_curNodeId);
                                                          
                                                                  // Pre-validate and convert inputs
                                                                  TimeTableDataManager.SegmentStation stopSegmentStation =
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java - About 25 mins to fix

                                                          Cognitive Complexity

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

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

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

                                                          Further reading

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

                                                              void makeTrainGrid(GridBagConstraints c) {
                                                                  makeGridLabel(0, "LabelTrainName", "HintTrainName", c);  // NOI18N
                                                                  _gridPanel.add(_editTrainName, c);
                                                          
                                                                  makeGridLabel(1, "LabelTrainDesc", "HintTrainDesc", c);  // NOI18N
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 2 hrs to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 829..853

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 180.

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

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

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

                                                              void makeStopGrid(GridBagConstraints c) {
                                                                  makeGridLabel(0, "LabelStopSeq", "HintStopSeq", c);  // NOI18N
                                                                  _gridPanel.add(_showStopSeq, c);
                                                          
                                                                  makeGridLabel(1, "LabelStopStation", "HintStopStation", c);  // NOI18N
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 2 hrs to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 798..822

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 180.

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

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

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

                                                              static class TimeTableTreeNode extends DefaultMutableTreeNode {
                                                          
                                                                  private String ttText;
                                                                  private String ttType;
                                                                  private int ttId;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 2 hrs to fix
                                                          java/src/jmri/jmrit/conditional/ConditionalTreeEdit.java on lines 4737..4783

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 138.

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

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

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (!exceptionList.isEmpty()) {
                                                                      StringBuilder msg = new StringBuilder(Bundle.getMessage("ScheduleUpdateErrors"));  // NOI18N
                                                                      for (String keyWord : exceptionList) {
                                                                          if (keyWord.startsWith(TimeTableDataManager.TIME_OUT_OF_RANGE)) {
                                                                              String[] comps = keyWord.split("~");
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 2 hrs to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2071..2085

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 128.

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

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

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (!exceptionList.isEmpty()) {
                                                                      StringBuilder msg = new StringBuilder(Bundle.getMessage("StopUpdateErrors"));  // NOI18N
                                                                      for (String keyWord : exceptionList) {
                                                                          if (keyWord.startsWith(TimeTableDataManager.TIME_OUT_OF_RANGE)) {
                                                                              String[] comps = keyWord.split("~");
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 2 hrs to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1870..1884

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 128.

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

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

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

                                                              void downPressed() {
                                                                  setShowReminder(true);
                                                          
                                                                  DefaultMutableTreeNode nextNode = _curNode.getNextSibling();
                                                                  if (!(nextNode instanceof TimeTableTreeNode)) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2427..2441

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 113.

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

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

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

                                                              void upPressed() {
                                                                  setShowReminder(true);
                                                          
                                                                  DefaultMutableTreeNode prevNode = _curNode.getPreviousSibling();
                                                                  if (!(prevNode instanceof TimeTableTreeNode)) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2446..2460

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 113.

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

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

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

                                                              void duplicateStation(int segmentId, int stationId, TimeTableTreeNode segmentNode) {
                                                                  Station station = _dataMgr.getStation(stationId);
                                                                  Station newStation = station.getCopy(segmentId);
                                                                  setShowReminder(true);
                                                          
                                                          
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1140..1157

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 104.

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

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

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

                                                              void duplicateTrainType(int layoutId, int typeId, TimeTableTreeNode typesNode) {
                                                                  TrainType type = _dataMgr.getTrainType(typeId);
                                                                  TrainType newType = type.getCopy(layoutId);
                                                                  setShowReminder(true);
                                                          
                                                          
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1191..1208

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 104.

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

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

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

                                                                  _timetableTree.addTreeSelectionListener(_timetableListener = new TreeSelectionListener() {
                                                                      @Override
                                                                      public void valueChanged(TreeSelectionEvent e) {
                                                                          if (_editActive) {
                                                                              if (e.getNewLeadSelectionPath() != _curTreePath) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/conditional/ConditionalTreeEdit.java on lines 1538..1557

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 96.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                              void addTrainType() {
                                                                  TimeTableTreeNode layoutNode = (TimeTableTreeNode) _curNode.getParent();
                                                                  int layoutId = layoutNode.getId();
                                                                  TrainType newType = new TrainType(layoutId);
                                                                  setShowReminder(true);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 2 other locations - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 958..971
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 992..1005

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 89.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                              void addSchedule() {
                                                                  TimeTableTreeNode layoutNode = (TimeTableTreeNode) _curNode.getParent();
                                                                  int layoutId = layoutNode.getId();
                                                                  Schedule newSchedule = new Schedule(layoutId);
                                                                  setShowReminder(true);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 2 other locations - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 940..953
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 958..971

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 89.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                              void addSegment() {
                                                                  TimeTableTreeNode layoutNode = (TimeTableTreeNode) _curNode.getParent();
                                                                  int layoutId = layoutNode.getId();
                                                                  Segment newSegment = new Segment(layoutId);
                                                                  setShowReminder(true);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 2 other locations - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 940..953
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 992..1005

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 89.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                              void addPressed() {
                                                                  switch (_curNodeType) {
                                                                      case "Layout":     // NOI18N
                                                                          addLayout();
                                                                          break;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2111..2144

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 89.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                              void deletePressed() {
                                                                  switch (_curNodeType) {
                                                                      case "Layout":  // NOI18N
                                                                          deleteLayout();
                                                                          break;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 878..911

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 89.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  if (!stopReference.isEmpty()) {
                                                                      StringBuilder msg = new StringBuilder(Bundle.getMessage("DeleteWarning", _curNodeType));  // NOI18N
                                                                      for (String stopTrainSeq : stopReference) {
                                                                          msg.append("\n    " + stopTrainSeq);  // NOI18N
                                                                      }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2208..2218

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 72.

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

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

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (!typeReference.isEmpty()) {
                                                                      StringBuilder msg = new StringBuilder(Bundle.getMessage("DeleteWarning", _curNodeType));  // NOI18N
                                                                      for (String trainName : typeReference) {
                                                                          msg.append("\n    " + trainName);  // NOI18N
                                                                      }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2298..2308

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 72.

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

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

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (schedules.size() > 1) {
                                                                      Schedule schedule = (Schedule) JmriJOptionPane.showInputDialog(
                                                                              this,
                                                                              Bundle.getMessage("ExportSelectSchedule"),  // NOI18N
                                                                              Bundle.getMessage("QuestionTitle"),  // NOI18N
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 2 other locations - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2670..2681
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2693..2704

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 70.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  if (layouts.size() > 1) {
                                                                      Layout layout = (Layout) JmriJOptionPane.showInputDialog(
                                                                              this,
                                                                              Bundle.getMessage("ExportSelectLayout"),  // NOI18N
                                                                              Bundle.getMessage("QuestionTitle"),  // NOI18N
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 2 other locations - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2693..2704
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2716..2727

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 70.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  if (segments.size() > 1) {
                                                                      Segment segment = (Segment) JmriJOptionPane.showInputDialog(
                                                                              this,
                                                                              Bundle.getMessage("ExportSelectSegment"),  // NOI18N
                                                                              Bundle.getMessage("QuestionTitle"),  // NOI18N
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 2 other locations - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2670..2681
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2716..2727

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 70.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      case "Layout":     // NOI18N
                                                                          _addButton.setText(Bundle.getMessage("AddLayoutButtonText"));  // NOI18N
                                                                          _addButtonPanel.setVisible(true);
                                                                          _duplicateButton.setText(Bundle.getMessage("DuplicateLayoutButtonText"));  // NOI18N
                                                                          _duplicateButtonPanel.setVisible(true);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 3009..3017

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 70.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      case "Schedule":     // NOI18N
                                                                          _addButton.setText(Bundle.getMessage("AddTrainButtonText"));  // NOI18N
                                                                          _addButtonPanel.setVisible(true);
                                                                          _duplicateButton.setText(Bundle.getMessage("DuplicateScheduleButtonText"));  // NOI18N
                                                                          _duplicateButtonPanel.setVisible(true);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2954..2962

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 70.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      case "Station":     // NOI18N
                                                                          _duplicateButton.setText(Bundle.getMessage("DuplicateStationButtonText"));  // NOI18N
                                                                          _duplicateButtonPanel.setVisible(true);
                                                                          _deleteButton.setText(Bundle.getMessage("DeleteStationButtonText"));  // NOI18N
                                                                          _deleteButtonPanel.setVisible(true);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 2 other locations - About 40 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2970..2976
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 3035..3041

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 50.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      case "TrainType":     // NOI18N
                                                                          _duplicateButton.setText(Bundle.getMessage("DuplicateTrainTypeButtonText"));  // NOI18N
                                                                          _duplicateButtonPanel.setVisible(true);
                                                                          _deleteButton.setText(Bundle.getMessage("DeleteTrainTypeButtonText"));  // NOI18N
                                                                          _deleteButtonPanel.setVisible(true);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 2 other locations - About 40 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2995..3001
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 3035..3041

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 50.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      case "Stop":     // NOI18N
                                                                          _duplicateButton.setText(Bundle.getMessage("DuplicateStopButtonText"));  // NOI18N
                                                                          _duplicateButtonPanel.setVisible(true);
                                                                          _deleteButton.setText(Bundle.getMessage("DeleteStopButtonText"));  // NOI18N
                                                                          _deleteButtonPanel.setVisible(true);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 2 other locations - About 40 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2970..2976
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2995..3001

                                                          Duplicated Code

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

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

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

                                                                  if (station.getStaging() != newStaging) {
                                                                      try {
                                                                          station.setStaging(newStaging);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (train.getThrottle() != newThrottle) {
                                                                      try {
                                                                          train.setThrottle(newThrottle);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (layout.getFastClock() != newFastClock) {
                                                                      try {
                                                                          layout.setFastClock(newFastClock);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (layout.getMetric() != newMetric) {
                                                                      try {
                                                                          layout.setMetric(newMetric);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (schedule.getDuration() != newDuration) {
                                                                      try {
                                                                          schedule.setDuration(newDuration);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (train.getStartTime() != newStart) {
                                                                      try {
                                                                          train.setStartTime(newStart);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (stop.getDuration() != newDuration) {
                                                                      try {
                                                                          stop.setDuration(newDuration);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (layout.getThrottles() != newThrottles) {
                                                                      try {
                                                                          layout.setThrottles(newThrottles);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (schedule.getStartHour() != newStartHour) {
                                                                      try {
                                                                          schedule.setStartHour(newStartHour);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (stop.getNextSpeed() != newSpeed) {
                                                                      try {
                                                                          stop.setNextSpeed(newSpeed);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                                  if (stop.getStagingTrack() != newStagingTrack) {
                                                                      try {
                                                                          stop.setStagingTrack(newStagingTrack);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1941..1948
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050

                                                          Duplicated Code

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

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

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

                                                                  if (train.getDefaultSpeed() != newSpeed) {
                                                                      try {
                                                                          train.setDefaultSpeed(newSpeed);
                                                                          update = true;
                                                                      } catch (IllegalArgumentException ex) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 11 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1606..1613
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1615..1622
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1624..1631
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1768..1775
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1847..1854
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1856..1863
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1950..1957
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1959..1966
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2034..2041
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2043..2050
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2052..2059

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 46.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      for (TrainType y : _dataMgr.getTrainTypes(l.getLayoutId(), true)) {
                                                                          _typeNode = new TimeTableTreeNode(y.getTypeName(), "TrainType", y.getTypeId(), 0);    // NOI18N
                                                                          _typeHead.add(_typeNode);
                                                                      }
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2877..2880

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 46.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  if (!station.getStationName().equals(newName)) {
                                                                      station.setStationName(newName);
                                                                      _curNode.setText(newName);
                                                                      _timetableModel.nodeChanged(_curNode);
                                                                      update = true;
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1590..1595

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 46.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  if (!layout.getLayoutName().equals(newName)) {
                                                                      layout.setLayoutName(newName);
                                                                      _curNode.setText(newName);
                                                                      _timetableModel.nodeChanged(_curNode);
                                                                      update = true;
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 1739..1744

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 46.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                          for (Station st : _dataMgr.getStations(sg.getSegmentId(), true)) {
                                                                              _leafNode = new TimeTableTreeNode(st.getStationName(), "Station", st.getStationId(), 0);    // NOI18N
                                                                              _segmentNode.add(_leafNode);
                                                                          }
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2867..2870

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 46.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  if (direction.equals("Up")) {    // NOI18N
                                                                      siblingNode = _curNode.getPreviousSibling();
                                                                      if (siblingNode instanceof TimeTableTreeNode) {
                                                                          tempNode = (TimeTableTreeNode) siblingNode;
                                                                          tempNode.setRow(tempNode.getRow() + 1);
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2486..2492

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 44.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  } else {
                                                                      siblingNode = _curNode.getNextSibling();
                                                                      if (siblingNode instanceof TimeTableTreeNode) {
                                                                          tempNode = (TimeTableTreeNode) siblingNode;
                                                                          tempNode.setRow(tempNode.getRow() - 1);
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2480..2486

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 44.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  int selectedOption = JmriJOptionPane.showOptionDialog(this,
                                                                          Bundle.getMessage("LayoutCascade"), // NOI18N
                                                                          Bundle.getMessage("QuestionTitle"),   // NOI18N
                                                                          JmriJOptionPane.DEFAULT_OPTION,
                                                                          JmriJOptionPane.QUESTION_MESSAGE,
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 6 other locations - About 30 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2261..2266
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2332..2337
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2372..2377
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2791..2796
                                                          java/src/jmri/jmrix/loconet/ds64/Ds64TabbedPanel.java on lines 1965..1969
                                                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 925..932

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 42.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      int selectedOption = JmriJOptionPane.showOptionDialog(this,
                                                                              Bundle.getMessage("DirtyDataWarning"), // NOI18N
                                                                              Bundle.getMessage("WarningTitle"),   // NOI18N
                                                                              JmriJOptionPane.DEFAULT_OPTION,
                                                                              JmriJOptionPane.WARNING_MESSAGE,
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 6 other locations - About 30 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2151..2156
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2261..2266
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2332..2337
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2372..2377
                                                          java/src/jmri/jmrix/loconet/ds64/Ds64TabbedPanel.java on lines 1965..1969
                                                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 925..932

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 42.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      int selectedOption = JmriJOptionPane.showOptionDialog(this,
                                                                              Bundle.getMessage("TrainCascade"), // NOI18N
                                                                              Bundle.getMessage("QuestionTitle"),   // NOI18N
                                                                              JmriJOptionPane.DEFAULT_OPTION,
                                                                              JmriJOptionPane.QUESTION_MESSAGE,
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 6 other locations - About 30 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2151..2156
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2261..2266
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2332..2337
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2791..2796
                                                          java/src/jmri/jmrix/loconet/ds64/Ds64TabbedPanel.java on lines 1965..1969
                                                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 925..932

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 42.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      int selectedOption = JmriJOptionPane.showOptionDialog(this,
                                                                              Bundle.getMessage("SegmentCascade"), // NOI18N
                                                                              Bundle.getMessage("QuestionTitle"),   // NOI18N
                                                                              JmriJOptionPane.DEFAULT_OPTION,
                                                                              JmriJOptionPane.QUESTION_MESSAGE,
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 6 other locations - About 30 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2151..2156
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2332..2337
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2372..2377
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2791..2796
                                                          java/src/jmri/jmrix/loconet/ds64/Ds64TabbedPanel.java on lines 1965..1969
                                                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 925..932

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 42.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      int selectedOption = JmriJOptionPane.showOptionDialog(this,
                                                                              Bundle.getMessage("ScheduleCascade"), // NOI18N
                                                                              Bundle.getMessage("QuestionTitle"),   // NOI18N
                                                                              JmriJOptionPane.DEFAULT_OPTION,
                                                                              JmriJOptionPane.QUESTION_MESSAGE,
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 6 other locations - About 30 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2151..2156
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2261..2266
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2372..2377
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2791..2796
                                                          java/src/jmri/jmrix/loconet/ds64/Ds64TabbedPanel.java on lines 1965..1969
                                                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 925..932

                                                          Duplicated Code

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

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

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

                                                                      for (Train train : _dataMgr.getTrains(schedule.getScheduleId(), 0, false)) {
                                                                          for (Stop stop : _dataMgr.getStops(train.getTrainId(), 0, false)) {
                                                                              _dataMgr.deleteStop(stop.getStopId());
                                                                          }
                                                                          _dataMgr.deleteTrain(train.getTrainId());
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 30 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2341..2346

                                                          Duplicated Code

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

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

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

                                                                      for (Train train : trainList) {
                                                                          for (Stop stop : _dataMgr.getStops(train.getTrainId(), 0, false)) {
                                                                              _dataMgr.deleteStop(stop.getStopId());
                                                                          }
                                                                          _dataMgr.deleteTrain(train.getTrainId());
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 30 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2165..2170

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 42.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                  } catch (IOException ex) {
                                                                      log.error("Import exception", ex); // NOI18N
                                                                      JmriJOptionPane.showMessageDialog(this,
                                                                              Bundle.getMessage("ImportCsvFailed", "CVS"), // NOI18N
                                                                              Bundle.getMessage("ErrorTitle"), // NOI18N
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 30 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2597..2604

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 42.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      } catch (IOException ex) {
                                                                          log.error("Import exception", ex);  // NOI18N
                                                                          JmriJOptionPane.showMessageDialog(this,
                                                                                  Bundle.getMessage("ImportFailed", "SGN"),  // NOI18N
                                                                                  Bundle.getMessage("ErrorTitle"),  // NOI18N
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java and 1 other location - About 30 mins to fix
                                                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2627..2634

                                                          Duplicated Code

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

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

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

                                                          There are no issues that match your filters.

                                                          Category
                                                          Status