Showing 10,024 of 24,937 total issues

File bootstrap.js has 1537 lines of code (exceeds 300 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.3.2 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
Severity: Major
Found in web/js/bootstrap.js - About 3 days to fix

    File YetAnotherAutoTrain3.py has 1530 lines of code (exceeds 300 allowed). Consider refactoring.
    Open

    # YetAnotherAutoTrain.py -- Data driven automatic train
    # Use a list of actions to automatically run a train.
    # v1.3 -- Add line numbers to the compiler error messages.
    # v1.4 -- Add a master controller that can be used to terminate all of the threads.
    # v1.5 -- Add signal mast and signal head options.
    Severity: Major
    Found in jython/YetAnotherAutoTrain3.py - About 3 days to fix

      File CircuitBuilder.java has 1529 lines of code (exceeds 300 allowed). Consider refactoring.
      Open

      package jmri.jmrit.display.controlPanelEditor;
      
      import java.awt.BorderLayout;
      import java.awt.Color;
      import java.awt.Dimension;
      Severity: Major
      Found in java/src/jmri/jmrit/display/controlPanelEditor/CircuitBuilder.java - About 3 days to fix

        File DCCppReply.java has 1528 lines of code (exceeds 300 allowed). Consider refactoring.
        Open

        package jmri.jmrix.dccpp;
        
        import java.util.LinkedHashMap;
        import java.util.ArrayList;
        import java.util.regex.Matcher;
        Severity: Major
        Found in java/src/jmri/jmrix/dccpp/DCCppReply.java - About 3 days to fix

          File NceShowCabPanel.java has 1520 lines of code (exceeds 300 allowed). Consider refactoring.
          Open

          package jmri.jmrix.nce.cab;
          
          import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
          import java.awt.Dimension;
          import java.awt.GridBagConstraints;
          Severity: Major
          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 3 days to fix

            Method getProtectedBlocks has a Cognitive Complexity of 206 (exceeds 20 allowed). Consider refactoring.
            Open

                @Nonnull
                public ArrayList<LayoutBlock> getProtectedBlocks(jmri.NamedBean bean) {
                    ArrayList<LayoutBlock> ret = new ArrayList<>(2);
                    if (getLayoutBlock() == null) {
                        return ret;
            Severity: Minor
            Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnout.java - About 3 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 search has 779 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                static boolean search(String name, JTextArea text) {
                    String[] names = getTypeAndNames(name);
                    if (log.isDebugEnabled()) {
                        log.debug("search for {} as {} \"{}\" ({})", name, names[0], names[1], names[2]);
                    }
            Severity: Major
            Found in java/src/jmri/jmrit/beantable/Maintenance.java - About 3 days to fix

              File RobotThrottle2.py has 1509 lines of code (exceeds 300 allowed). Consider refactoring.
              Open

              # This script runs a loco around the track, controlling the speed
              # according to signals and following the blocks.
              #
              # Author: Ken Cameron, copyright 2009
              # Part of the JMRI distribution
              Severity: Major
              Found in jython/RobotThrottle2.py - About 3 days to fix

                Method setRoute has a Cognitive Complexity of 204 (exceeds 20 allowed). Consider refactoring.
                Open

                    void setRoute(boolean state) {
                        if (log.isDebugEnabled()) {
                            log.debug("Set route {}", src.getPoint().getDisplayName());  // NOI18N
                        }
                        if (disposed) {
                Severity: Minor
                Found in java/src/jmri/jmrit/entryexit/DestinationPoints.java - About 3 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 readDispatcherOptions has a Cognitive Complexity of 202 (exceeds 20 allowed). Consider refactoring.
                Open

                    public void readDispatcherOptions(DispatcherFrame f) throws org.jdom2.JDOMException, java.io.IOException {
                        // check if file exists
                        if (checkFile(defaultFileName)) {
                            // file is present,
                            log.debug("Reading Dispatcher options from file {}", defaultFileName);
                Severity: Minor
                Found in java/src/jmri/jmrit/dispatcher/OptionsFile.java - About 3 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

                TrackSegmentView has 190 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class TrackSegmentView extends LayoutTrackView {
                
                    public TrackSegmentView(@Nonnull TrackSegment track, @Nonnull LayoutEditor layoutEditor) {
                        super(track, layoutEditor);
                
                
                Severity: Major
                Found in java/src/jmri/jmrit/display/layoutEditor/TrackSegmentView.java - About 3 days to fix

                  Method vetoableChange has a Cognitive Complexity of 200 (exceeds 20 allowed). Consider refactoring.
                  Open

                      @Override
                      public void vetoableChange(
                              @Nonnull PropertyChangeEvent evt)
                              throws PropertyVetoException {
                          NamedBean nb = (NamedBean) evt.getOldValue();
                  Severity: Minor
                  Found in java/src/jmri/jmrit/display/layoutEditor/LayoutEditor.java - About 3 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 run has 755 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Override
                      public void run() {
                          File file = getFile();
                          if (file == null) {
                              return;
                  Severity: Major
                  Found in java/src/jmri/jmrit/operations/rollingstock/cars/tools/ImportCars.java - About 3 days to fix

                    Track has 189 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class Track extends PropertyChangeSupport {
                    
                        public static final String NONE = "";
                    
                        protected String _id = NONE;
                    Severity: Major
                    Found in java/src/jmri/jmrit/operations/locations/Track.java - About 3 days to fix

                      File RosterFrame.java has 1470 lines of code (exceeds 300 allowed). Consider refactoring.
                      Open

                      package jmri.jmrit.roster.swing;
                      
                      import java.awt.BorderLayout;
                      import java.awt.Color;
                      import java.awt.Component;
                      Severity: Major
                      Found in java/src/jmri/jmrit/roster/swing/RosterFrame.java - About 3 days to fix

                        File SpeedoConsoleFrame.java has 1450 lines of code (exceeds 300 allowed). Consider refactoring.
                        Open

                        package jmri.jmrix.bachrus;
                        
                        //<editor-fold defaultstate="collapsed" desc="Imports">
                        import java.awt.BorderLayout;
                        import java.awt.CardLayout;
                        Severity: Major
                        Found in java/src/jmri/jmrix/bachrus/SpeedoConsoleFrame.java - About 3 days to fix

                          Method runUpdate has a Cognitive Complexity of 195 (exceeds 20 allowed). Consider refactoring.
                          Open

                              private void runUpdate() {
                                  log.debug("run update");
                                  removePropertyChangeListerners();
                                  trainCommon.clearUtilityCarTypes(); // reset the utility car counts
                                  checkBoxes.clear();
                          Severity: Minor
                          Found in java/src/jmri/jmrit/operations/locations/YardmasterByTrackPanel.java - About 3 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 ClockMonPanel.java has 1426 lines of code (exceeds 300 allowed). Consider refactoring.
                          Open

                          package jmri.jmrix.nce.clockmon;
                          
                          import java.awt.GridBagConstraints;
                          import java.awt.GridBagLayout;
                          import java.awt.Insets;
                          Severity: Major
                          Found in java/src/jmri/jmrix/nce/clockmon/ClockMonPanel.java - About 3 days to fix

                            Method allocateSection has a Cognitive Complexity of 192 (exceeds 20 allowed). Consider refactoring.
                            Open

                                public AllocatedSection allocateSection(AllocationRequest ar, Section ns) {
                                    log.trace("{}: Checking Section [{}]", ar.getActiveTrain().getTrainName(), (ns != null ? ns.getDisplayName(USERSYS) : "auto"));
                                    AllocatedSection as = null;
                                    Section nextSection = null;
                                    int nextSectionSeqNo = 0;
                            Severity: Minor
                            Found in java/src/jmri/jmrit/dispatcher/DispatcherFrame.java - About 3 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

                            LayoutTurnoutView has 180 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            public class LayoutTurnoutView extends LayoutTrackView {
                            
                                public LayoutTurnoutView(@Nonnull LayoutTurnout turnout,
                                        @Nonnull Point2D c, double rot,
                                        @Nonnull LayoutEditor layoutEditor) {
                            Severity: Major
                            Found in java/src/jmri/jmrit/display/layoutEditor/LayoutTurnoutView.java - About 3 days to fix
                              Severity
                              Category
                              Status
                              Source
                              Language