Showing 24,911 of 24,911 total issues

File Editor.java has 2778 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrit.display;

import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.event.*;
Severity: Major
Found in java/src/jmri/jmrit/display/Editor.java - About 1 wk to fix

    File TransitTableAction.java has 2772 lines of code (exceeds 300 allowed). Consider refactoring.
    Open

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

      Method trackSegmentLeadsTo has a Cognitive Complexity of 383 (exceeds 20 allowed). Consider refactoring.
      Open

          private boolean trackSegmentLeadsTo(
                  @CheckForNull TrackSegment trackSegment, @CheckForNull LayoutTrack layoutTrack) {
              if ((trackSegment == null) || (layoutTrack == null)) {
                  log.error("Null argument on entry to trackSegmentLeadsTo");
                  return false;
      Severity: Minor
      Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 1 wk 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

      File Ds64TabbedPanel.java has 2669 lines of code (exceeds 300 allowed). Consider refactoring.
      Open

      package jmri.jmrix.loconet.ds64;
      
      import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
      
      import java.awt.Color;
      Severity: Major
      Found in java/src/jmri/jmrix/loconet/ds64/Ds64TabbedPanel.java - About 1 wk to fix

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

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

          File Warrant.java has 2573 lines of code (exceeds 300 allowed). Consider refactoring.
          Open

          package jmri.jmrit.logix;
          
          import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
          
          import java.util.ArrayList;
          Severity: Major
          Found in java/src/jmri/jmrit/logix/Warrant.java - About 1 wk to fix

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

            def createTowerLCCLogicDefaults( nodeAddr, nodeNamePrefix ) :
                print "Creating default logix cell values: " + nodeAddr + " " + nodeNamePrefix
                nParts = nodeAddr.split( '.')
                nBase = str(nParts[0]) + "." + str(nParts[1]) + "." + str(nParts[2]) + "." + str(nParts[3]) + "." + str(nParts[4]) + "." + str(nParts[5])
                baseAddr = 0xC0
            Severity: Major
            Found in jython/LCC/SetTowerNodeDefaults.py and 1 other location - About 6 days to fix
            jython/LCC/SetSignalNodeDefaults.py on lines 62..97

            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 700.

            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

            def createSignalLCCLogicDefaults( nodeAddr, nodeNamePrefix ) :
                print "Creating default logix cell values: " + nodeAddr + " " + nodeNamePrefix
                nParts = nodeAddr.split( '.')
                nBase = str(nParts[0]) + "." + str(nParts[1]) + "." + str(nParts[2]) + "." + str(nParts[3]) + "." + str(nParts[4]) + "." + str(nParts[5])
                baseAddr = 0xA0
            Severity: Major
            Found in jython/LCC/SetSignalNodeDefaults.py and 1 other location - About 6 days to fix
            jython/LCC/SetTowerNodeDefaults.py on lines 56..91

            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 700.

            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

            File LRouteTableAction.java has 2520 lines of code (exceeds 300 allowed). Consider refactoring.
            Open

            package jmri.jmrit.beantable;
            
            import java.awt.BorderLayout;
            import java.awt.Component;
            import java.awt.Container;
            Severity: Major
            Found in java/src/jmri/jmrit/beantable/LRouteTableAction.java - About 6 days to fix

              Method load has a Cognitive Complexity of 347 (exceeds 20 allowed). Consider refactoring.
              Open

                  public static void load(Element e) {
                      if (e.getChild(Xml.OPERATIONS) == null) {
                          log.warn("OperationsPro settings values not found");
                          return;
                      }
              Severity: Minor
              Found in java/src/jmri/jmrit/operations/setup/Setup.java - About 6 days to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                  def handle(self):
                      if (self.isAborting == True) :
                          return 0
                      #self.msgText("handle begin:.")
                      self.waitMsec(100)
              Severity: Major
              Found in jython/RobotThrottle3.py and 1 other location - About 6 days to fix
              jython/RobotThrottle2.py on lines 182..256

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 685.

              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

                  def handle(self):
                      if (self.isAborting == True) :
                          return 0
                      #self.msgText("handle begin:.\n")
                      self.waitMsec(1000)
              Severity: Major
              Found in jython/RobotThrottle2.py and 1 other location - About 6 days to fix
              jython/RobotThrottle3.py on lines 196..270

              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 685.

              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

              File LayoutTurnoutView.java has 2474 lines of code (exceeds 300 allowed). Consider refactoring.
              Open

              package jmri.jmrit.display.layoutEditor;
              
              import java.awt.Color;
              import java.awt.Graphics2D;
              import java.awt.event.ActionEvent;
              Severity: Major
              Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 6 days to fix

                File Setup.java has 2469 lines of code (exceeds 300 allowed). Consider refactoring.
                Open

                package jmri.jmrit.operations.setup;
                
                import java.awt.Color;
                import java.io.IOException;
                import java.util.*;
                Severity: Major
                Found in java/src/jmri/jmrit/operations/setup/Setup.java - About 6 days to fix

                  File DefaultSignalMastLogic.java has 2449 lines of code (exceeds 300 allowed). Consider refactoring.
                  Open

                  package jmri.implementation;
                  
                  import java.beans.PropertyChangeEvent;
                  import java.beans.PropertyChangeListener;
                  import java.beans.PropertyVetoException;
                  Severity: Major
                  Found in java/src/jmri/implementation/DefaultSignalMastLogic.java - About 6 days to fix

                    LayoutEditor has 329 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    final public class LayoutEditor extends PanelEditor implements MouseWheelListener, LayoutModels {
                    
                        // Operational instance variables - not saved to disk
                        private JmriJFrame floatingEditToolBoxFrame = null;
                        private JScrollPane floatingEditContentScrollPane = null;
                    Severity: Major
                    Found in java/src/jmri/jmrit/display/layoutEditor/LayoutEditor.java - About 6 days to fix

                      Method load has a Cognitive Complexity of 326 (exceeds 20 allowed). Consider refactoring.
                      Open

                          @Override
                          public void load(Element element, Object o) {
                              // create the objects
                              LayoutEditor p = (LayoutEditor) o;
                      
                      

                      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

                      File DefaultSection.java has 2318 lines of code (exceeds 300 allowed). Consider refactoring.
                      Open

                      package jmri.implementation;
                      
                      import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
                      
                      import java.beans.*;
                      Severity: Major
                      Found in java/src/jmri/implementation/DefaultSection.java - About 6 days to fix

                        File StlEditorPane.java has 2314 lines of code (exceeds 300 allowed). Consider refactoring.
                        Open

                        package jmri.jmrix.openlcb.swing.stleditor;
                        
                        import java.awt.*;
                        import java.awt.event.*;
                        import java.io.*;
                        Severity: Major
                        Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 6 days to fix

                          File LayoutTurnout.java has 2275 lines of code (exceeds 300 allowed). Consider refactoring.
                          Open

                          package jmri.jmrit.display.layoutEditor;
                          
                          import java.awt.Color;
                          import java.awt.Font;
                          import java.text.MessageFormat;
                          Severity: Major
                          Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnout.java - About 6 days to fix
                            Severity
                            Category
                            Status
                            Source
                            Language