Showing 10,007 of 24,911 total issues

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

          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

            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

                          File ConnectivityUtil.java has 2268 lines of code (exceeds 300 allowed). Consider refactoring.
                          Open

                          package jmri.jmrit.display.layoutEditor;
                          
                          import java.util.ArrayList;
                          import java.util.List;
                          import java.util.stream.Collectors;
                          Severity: Major
                          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 6 days to fix

                            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

                              File XNetMessage.java has 2195 lines of code (exceeds 300 allowed). Consider refactoring.
                              Open

                              package jmri.jmrix.lenz;
                              
                              import java.io.Serializable;
                              
                              import org.slf4j.Logger;
                              Severity: Major
                              Found in java/src/jmri/jmrix/lenz/XNetMessage.java - About 5 days to fix

                                File DCCppMessage.java has 2186 lines of code (exceeds 300 allowed). Consider refactoring.
                                Open

                                package jmri.jmrix.dccpp;
                                
                                import java.util.concurrent.Delayed;
                                import java.util.concurrent.TimeUnit;
                                import java.util.regex.Matcher;
                                Severity: Major
                                Found in java/src/jmri/jmrix/dccpp/DCCppMessage.java - About 5 days to fix

                                  Method draw1 has a Cognitive Complexity of 297 (exceeds 20 allowed). Consider refactoring.
                                  Open

                                      @Override
                                      protected void draw1(Graphics2D g2, boolean isMain, boolean isBlock) {
                                          if (isBlock && getLayoutBlock() == null) {
                                              // Skip the block layer if there is no block assigned.
                                              return;
                                  Severity: Minor
                                  Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 5 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language