Showing 10,024 of 24,937 total issues

Method run has a Cognitive Complexity of 231 (exceeds 20 allowed). Consider refactoring.
Open

    @Override
    public void run() {
        File file = getFile();
        if (file == null) {
            return;

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 initComponents has 885 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public void initComponents() {
        setTitle(Bundle.getMessage("ConfigNodesTitle"));

        contentPane = getContentPane();
Severity: Major
Found in java/src/jmri/jmrix/acela/nodeconfig/NodeConfigFrame.java - About 4 days to fix

    Method scanAllocationRequestList has a Cognitive Complexity of 230 (exceeds 20 allowed). Consider refactoring.
    Open

        private synchronized void scanAllocationRequestList(List<AllocationRequest> list) {
            boolean okToAllocate = false;
            if (list.size() <= 0) {
                return;
            }
    Severity: Minor
    Found in java/src/jmri/jmrit/dispatcher/AutoAllocate.java - About 4 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

    Function dispatch_train has a Cognitive Complexity of 230 (exceeds 20 allowed). Consider refactoring.
    Open

        def dispatch_train(self, sensor_changed, button_sensor_name, button_station_name):
            global trains_allocated
            global trains_dispatched
            global g
    
    
    Severity: Minor
    Found in jython/DispatcherSystem/RunDispatch.py - About 4 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 TreeEditor.java has 1679 lines of code (exceeds 300 allowed). Consider refactoring.
    Open

    package jmri.jmrit.logixng.tools.swing;
    
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.PropertyVetoException;
    Severity: Major
    Found in java/src/jmri/jmrit/logixng/tools/swing/TreeEditor.java - About 4 days to fix

      File NodeConfigFrame.java has 1679 lines of code (exceeds 300 allowed). Consider refactoring.
      Open

      package jmri.jmrix.acela.nodeconfig;
      
      import java.awt.BorderLayout;
      import java.awt.Container;
      import java.awt.FlowLayout;
      Severity: Major
      Found in java/src/jmri/jmrix/acela/nodeconfig/NodeConfigFrame.java - About 4 days to fix

        Method notifyNeighboursOfRemoval has a Cognitive Complexity of 225 (exceeds 20 allowed). Consider refactoring.
        Open

            private void notifyNeighboursOfRemoval(List<Routes> routesToRemove, Block notifyingblk) {
                String msgPrefix = "From " + this.getDisplayName() + " notify block " + notifyingblk.getDisplayName() + " ";
        
                if (enableDeleteRouteLogging) {
                    log.info("{} notifyNeighboursOfRemoval called for routes from {} ===", msgPrefix, notifyingblk.getDisplayName());
        Severity: Minor
        Found in java/src/jmri/jmrit/display/layoutEditor/LayoutBlock.java - About 4 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 SignalHeadAddEditFrame.java has 1645 lines of code (exceeds 300 allowed). Consider refactoring.
        Open

        package jmri.jmrit.beantable;
        
        import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
        
        import java.awt.*;
        Severity: Major
        Found in java/src/jmri/jmrit/beantable/SignalHeadAddEditFrame.java - About 4 days to fix

          Method getTurnoutList has a Cognitive Complexity of 223 (exceeds 20 allowed). Consider refactoring.
          Open

              @Nonnull
              public List<LayoutTrackExpectedState<LayoutTurnout>> getTurnoutList(
                      @CheckForNull Block currBlock,
                      @CheckForNull Block prevBlock,
                      @CheckForNull Block nextBlock,
          Severity: Minor
          Found in java/src/jmri/jmrit/display/layoutEditor/ConnectivityUtil.java - About 4 days to fix

          Cognitive Complexity

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

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

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

          Further reading

          Method loadSignalMastLogic has a Cognitive Complexity of 221 (exceeds 20 allowed). Consider refactoring.
          Open

              public boolean loadSignalMastLogic(Element signalMastLogic) {
                  List<Element> logicList = signalMastLogic.getChildren("signalmastlogic");
                  log.debug("Found {} signal mast logics", logicList.size());
          
                  SignalMastManager sm = InstanceManager.getDefault(jmri.SignalMastManager.class);

          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 RPSpos has a Cognitive Complexity of 218 (exceeds 20 allowed). Consider refactoring.
          Open

              RetVal RPSpos(int nr, double Tr[], double Xr[], double Yr[], double Zr[],//   many
                      double Vs, double Xt, double Yt, double Zt) {//         receivers
          
                  int i = 0, j = 0, jmax = 0, k = 0, l = 0, ns, nss, nxx, nox = 0, S, cmax;
                  int[] ce = new int[NMAX];
          Severity: Minor
          Found in java/src/jmri/jmrix/rps/Ash2_2Algorithm.java - About 4 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

          Editor has 207 methods (exceeds 20 allowed). Consider refactoring.
          Open

          abstract public class Editor extends JmriJFrame implements JmriMouseListener, JmriMouseMotionListener,
                  ActionListener, KeyListener, VetoableChangeListener {
          
              final public static int BKG = 1;
              final public static int TEMP = 2;
          Severity: Major
          Found in java/src/jmri/jmrit/display/Editor.java - About 4 days to fix

            File RunDispatch.py has 1598 lines of code (exceeds 300 allowed). Consider refactoring.
            Open

            ###############################################################################
            #
            # class OptionDialog
            # Some Swing dialogs
            #
            Severity: Major
            Found in jython/DispatcherSystem/RunDispatch.py - About 4 days to fix

              File AutoActiveTrain.java has 1596 lines of code (exceeds 300 allowed). Consider refactoring.
              Open

              package jmri.jmrit.dispatcher;
              
              import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
              import java.beans.PropertyChangeEvent;
              import java.beans.PropertyChangeListener;
              Severity: Major
              Found in java/src/jmri/jmrit/dispatcher/AutoActiveTrain.java - About 4 days to fix

                File ControlPanelEditor.java has 1595 lines of code (exceeds 300 allowed). Consider refactoring.
                Open

                package jmri.jmrit.display.controlPanelEditor;
                
                import java.awt.Color;
                import java.awt.Component;
                import java.awt.Container;
                Severity: Major
                Found in java/src/jmri/jmrit/display/controlPanelEditor/ControlPanelEditor.java - About 4 days to fix

                  Method load has 826 lines of code (exceeds 25 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: Major
                  Found in java/src/jmri/jmrit/operations/setup/Setup.java - About 4 days to fix

                    File TrainCommon.java has 1588 lines of code (exceeds 300 allowed). Consider refactoring.
                    Open

                    package jmri.jmrit.operations.trains;
                    
                    import java.awt.*;
                    import java.io.PrintWriter;
                    import java.text.SimpleDateFormat;
                    Severity: Major
                    Found in java/src/jmri/jmrit/operations/trains/TrainCommon.java - About 4 days to fix

                      DCCppMessage has 203 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class DCCppMessage extends jmri.jmrix.AbstractMRMessage implements Delayed {
                      
                          private static int _nRetries = 3;
                      
                          /* According to the specification, DCC++ has a maximum timing
                      Severity: Major
                      Found in java/src/jmri/jmrix/dccpp/DCCppMessage.java - About 4 days to fix

                        File PositionablePointView.java has 1551 lines of code (exceeds 300 allowed). Consider refactoring.
                        Open

                        package jmri.jmrit.display.layoutEditor;
                        
                        import java.awt.*;
                        import java.awt.event.*;
                        import java.awt.geom.Point2D;
                        Severity: Major
                        Found in java/src/jmri/jmrit/display/layoutEditor/PositionablePointView.java - About 4 days to fix

                          File MoveTrain.py has 1547 lines of code (exceeds 300 allowed). Consider refactoring.
                          Open

                          ###############################################################################
                          #
                          # class MoveTrain
                          # Calls dispatcher to e train from one station to another
                          # given engine and start and end positions
                          Severity: Major
                          Found in jython/DispatcherSystem/MoveTrain.py - About 3 days to fix
                            Severity
                            Category
                            Status
                            Source
                            Language