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.*;
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;
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;
- 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 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;
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.*;
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;
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
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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;
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;
}
- 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
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)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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;
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.*;
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;
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;
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;
- 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 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.*;
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.*;
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;