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());
Severity: Minor
Found in java/src/jmri/jmrix/dcc4pc/Dcc4PcBoardManager.java - About 25 mins 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 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());
Severity: Minor
Found in java/src/jmri/jmrix/AbstractUsbConnectionConfig.java - About 25 mins 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 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);
Severity: Minor
Found in java/src/jmri/jmrix/zimo/Mx1Throttle.java - About 25 mins 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 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("");
        }
Severity: Minor
Found in java/src/jmri/jmrix/lenz/XNetTrafficController.java - About 25 mins 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 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;
Severity: Minor
Found in java/src/jmri/jmrix/lenz/swing/stackmon/StackMonFrame.java - About 25 mins 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 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 {
Severity: Minor
Found in java/src/jmri/jmrix/ipocs/IpocsClientHandler.java - About 25 mins 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 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");
Severity: Minor
Found in java/src/jmri/jmrix/sprog/update/SprogIIUpdateFrame.java - About 25 mins 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 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) {
Severity: Minor
Found in java/src/jmri/jmrix/srcp/SRCPTrafficController.java - About 25 mins 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 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) {
Severity: Minor
Found in java/src/jmri/web/servlet/roster/RosterServlet.java - About 25 mins 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 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) {
Severity: Minor
Found in java/src/jmri/web/servlet/panel/ControlPanelServlet.java - About 25 mins 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 $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;
Severity: Minor
Found in web/js/panel.js - About 25 mins 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 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()
Severity: Minor
Found in jython/YetAnotherAutoTrain.py - About 25 mins 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 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:
Severity: Minor
Found in jython/YetAnotherAutoTrain.py - About 25 mins 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 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
Severity: Minor
Found in jython/AutoDispatcher2.py - About 25 mins 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 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()
Severity: Minor
Found in jython/LocoNetSlotsReadCSV.py - About 25 mins 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 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 :
Severity: Minor
Found in jython/AutoDispatcher2.py - About 25 mins 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 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"
Severity: Minor
Found in jython/DispatcherSystem/RunDispatch.py - About 25 mins 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 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"
Severity: Minor
Found in jython/DispatcherSystem/RunDispatch.py - About 25 mins 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 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)
Severity: Minor
Found in jython/DispatcherSystem/ResetButtonMaster.py - About 25 mins 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 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) :
Severity: Minor
Found in jython/RobotThrottle3.py - About 25 mins 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

Severity
Category
Status
Source
Language