Showing 10,007 of 24,911 total issues
Setup
has 284 methods (exceeds 20 allowed). Consider refactoring. Open
public class Setup extends PropertyChangeSupport implements InstanceManagerAutoDefault, Disposable {
public static final String NONE = "";
// scale ratios from NMRA
File RobotThrottle3.py
has 2083 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,2010
# Part of the JMRI distribution
File CamerawebThrottle.js
has 2039 lines of code (exceeds 300 allowed). Consider refactoring. Open
/**********************************************************************************************
*
* Javascript for 'webThrottle.html'
*
* This script defines the web throttle behaviour.
File Track.java
has 2013 lines of code (exceeds 300 allowed). Consider refactoring. Open
package jmri.jmrit.operations.locations;
import java.util.*;
import org.jdom2.Attribute;
File webThrottle.js
has 2003 lines of code (exceeds 300 allowed). Consider refactoring. Open
/**********************************************************************************************
*
* Javascript for 'webThrottle.html'
*
* This script defines the web throttle behaviour.
File WarrantFrame.java
has 1988 lines of code (exceeds 300 allowed). Consider refactoring. Open
package jmri.jmrit.logix;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
Train
has 262 methods (exceeds 20 allowed). Consider refactoring. Open
public class Train extends PropertyChangeSupport implements Identifiable, PropertyChangeListener {
/*
* WARNING DO NOT LOAD CAR OR ENGINE MANAGERS WHEN Train.java IS CREATED IT
* CAUSES A RECURSIVE LOOP AT LOAD TIME, SEE EXAMPLES BELOW CarManager
Method checkLocationsLoop
has a Cognitive Complexity of 272 (exceeds 20 allowed). Consider refactoring. Open
private boolean checkLocationsLoop() {
boolean noIssues = true;
// only report car type not serviced once
List<String> ignoreType = new ArrayList<String>();
for (Location destination : locationManager.getLocationsByNameList()) {
- Read upRead up
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 LayoutBlockManager.java
has 1962 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.Set;
Function JMRI
has 1034 lines of code (exceeds 25 allowed). Consider refactoring. Open
JMRI: function (url, bindings) {
var log = new Logger();
var jmri = new Object();
if (typeof (url) === 'string') {
jmri.url = url;
Method getTrackNode
has a Cognitive Complexity of 262 (exceeds 20 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public TrackNode getTrackNode(
@Nonnull LayoutTrack currentNode,
HitPointType currentNodeType,
- Read upRead up
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 processPanelXML
has 1005 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processPanelXML($returnedData, $success, $xhr) {
$('div#messageText').text("rendering panel from xml, please wait...");
$("#activity-alert").addClass("show").removeClass("hidden");
var $xml = $($returnedData); //jQuery-ize returned data for easier access
File PaneProgPane.java
has 1885 lines of code (exceeds 300 allowed). Consider refactoring. Open
package jmri.jmrit.symbolicprog.tabbedframe;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
File NodeConfigManagerFrame.java
has 1868 lines of code (exceeds 300 allowed). Consider refactoring. Open
package jmri.jmrix.cmri.serial.nodeconfigmanager;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
Method getFacingBean
has a Cognitive Complexity of 255 (exceeds 20 allowed). Consider refactoring. Open
@CheckReturnValue
@CheckForNull
public NamedBean getFacingBean(@CheckForNull Block facingBlock,
@CheckForNull Block protectedBlock,
@CheckForNull LayoutEditor panel, Class< ?> T) {
- Read upRead up
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 getTurnoutSetting
has a Cognitive Complexity of 252 (exceeds 20 allowed). Consider refactoring. Open
private Integer getTurnoutSetting(
@Nonnull LayoutTurnout layoutTurnout, HitPointType cType, boolean suppress) {
prevConnectTrack = layoutTurnout;
int setting = Turnout.THROWN;
LayoutTurnout.TurnoutType tType = layoutTurnout.getTurnoutType();
- Read upRead up
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 NceConsistEditPanel.java
has 1804 lines of code (exceeds 300 allowed). Consider refactoring. Open
package jmri.jmrix.nce.consist;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
Method buildSwitchList
has a Cognitive Complexity of 242 (exceeds 20 allowed). Consider refactoring. Open
public void buildSwitchList(Location location) {
boolean append = false; // add text to end of file when true
boolean checkFormFeed = true; // used to determine if FF needed between trains
- Read upRead up
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 SignallingPanel.java
has 1729 lines of code (exceeds 300 allowed). Consider refactoring. Open
package jmri.jmrit.signalling;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
Method cabUpdateSerial
has a Cognitive Complexity of 233 (exceeds 20 allowed). Consider refactoring. Open
private void cabUpdateSerial() {
if (firstTime) {
try {
Thread.sleep(FIRST_TIME_SLEEP); // wait for panel to display
- Read upRead up
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"