Showing 10,024 of 24,937 total issues
Method reply
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
@Override
@SuppressFBWarnings(value="DLS_DEAD_LOCAL_STORE", justification="See issue #6132")
public void reply(Dcc4PcReply r) {
if (log.isDebugEnabled()) {
log.debug("Reply details sm: {}", r.toHexString());
- 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 refreshPortBox
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
public void refreshPortBox() {
log.debug("* refreshPortBox()");
if (!init) {
newList = getPortNames();
portBox.setRenderer(new ComboBoxRenderer());
- 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 sendSpeedCmd
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
void sendSpeedCmd() {
Mx1Message m;
int value = 0;
int cData1 = (isForward ? 0x00 : 0x20);
cData1 = cData1 + (getFunction(0) ? 0x10 : 0x00);
- 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 forwardReply
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
@Override
public void forwardReply(AbstractMRListener client, AbstractMRReply m) {
if (!(client instanceof XNetListener) || !(m instanceof XNetReply)) {
throw new IllegalArgumentException("");
}
- 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 message
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
@Override
public void message(XNetReply r) {
if (r.getElement(0) == XNetConstants.LOCO_INFO_RESPONSE) {
int address = r.getThrottleMsgAddr();
Integer intAddress = address;
- 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 completed
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
@Override
public void completed(final Integer bytesRead, final ByteBuffer recvBuffer) {
// connection closed by the server
if (bytesRead == -1) {
try {
- 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 stateEraseSent
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
@Override
synchronized protected void stateEraseSent() {
stopTimer();
if (log.isDebugEnabled()) {
log.debug("reply in ERASESENT state");
- 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 receiveLoop
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
@Override
public void receiveLoop() {
log.debug("SRCP receiveLoop starts");
SRCPClientParser parser = new SRCPClientParser(istream);
while (true) {
- 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 doImage
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
void doImage(HttpServletRequest request, HttpServletResponse response, File file) throws IOException {
BufferedImage image;
try {
image = ImageIO.read(file);
} catch (IOException ex) {
- 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 getXmlPanel
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
@Override
protected String getXmlPanel(String name) {
log.debug("Getting {} for {}", getPanelType(), name);
ControlPanelEditor editor = (ControlPanelEditor) getEditor(name);
if (editor == null) {
- 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 $plotBezier
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
function $plotBezier(points, depth, displacement) {
var len = points.length, idx, jdx;
// calculate flatness to determine if we need to recurse...
var outer_distance = 0;
- 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 setup
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
def setup(self, actionList, compileNeeded, fileName):
self.actionTokens = []
self.compileMessages = []
self.lineNumber = 0
self.threadName = self.getName()
- 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 doSetTurntable
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
def doSetTurntable(self, action):
act, turntableName, panelName, rayIndex = action
editorManager = jmri.InstanceManager.getDefault(jmri.jmrit.display.EditorManager)
for layout in editorManager.getAll(jmri.jmrit.display.layoutEditor.LayoutEditor):
if layout.getTitle() == panelName:
- 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 learningStop
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
def learningStop(self) :
# Train entering a stop block
# Were we controlling braking times?
if not self.brakeAdjusting :
# No, ignore call
- 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 init
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
def init(self):
myLocoNetConnection = jmri.InstanceManager.getList(jmri.jmrix.loconet.LocoNetSystemConnectionMemo).get(0);
self.slotManager = myLocoNetConnection.getSlotManager()
nowSlotsUsed = self.slotManager.getInUseCount()
MySystemPrefix = self.slotManager.getSystemPrefix()
- 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 changeTrainName
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
def changeTrainName(self) :
# Place/remove train name in jmri Memory Variable (if defined)
# and in jmri Blocks (only if user enabled this option)
if self.memoryVariable != None :
if self.allocated == None :
- 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 modify_individual_station_wait_time
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
def modify_individual_station_wait_time(self, sensor_changed, button_sensor_name, button_station_name):
msg = "selected station " + button_station_name + ". \nSelect the next station to modify the station wait time?"
title = "Select next Station"
opt1 = "Select next station"
- 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 modify_individual_stopping_length
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
def modify_individual_stopping_length(self, sensor_changed, button_sensor_name, button_station_name):
msg = "selected station " + button_station_name + ". \nSelect the next station to modify the stopping length?"
title = "Select next Station"
opt1 = "Select next station"
- 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 loadfromfile_action
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
def loadfromfile_action(self, event):
# load the file
dir = self.directory()
j = JFileChooser(dir);
j.setAcceptAllFileFilterUsed(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
Function whenSaveToRosterButtonClicked
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
def whenSaveToRosterButtonClicked(self, event):
if (self.locoAddress.text != "") :
if (self.rosterInstance == None) :
self.rosterInstance = jmri.jmrit.roster.Roster.getDefault()
if (self.debugLevel >= MediumDebug) :
- 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"