java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java

Summary

Maintainability
F
1 mo
Test Coverage
F
10%

Method cabUpdateUsb has a Cognitive Complexity of 434 (exceeds 20 allowed). Consider refactoring.
Open

    private void cabUpdateUsb() {

        if (firstTime) {
            try {
                Thread.sleep(FIRST_TIME_SLEEP); // wait for panel to display
Severity: Minor
Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 1 wk 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 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
Severity: Minor
Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 4 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 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 cabUpdateUsb has 420 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private void cabUpdateUsb() {
    
            if (firstTime) {
                try {
                    Thread.sleep(FIRST_TIME_SLEEP); // wait for panel to display
    Severity: Major
    Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 2 days to fix

      Method cabUpdateSerial has 259 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void cabUpdateSerial() {
      
              if (firstTime) {
                  try {
                      Thread.sleep(FIRST_TIME_SLEEP); // wait for panel to display
      Severity: Major
      Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 1 day to fix

        NceShowCabPanel has 41 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class NceShowCabPanel extends jmri.jmrix.nce.swing.NcePanel implements jmri.jmrix.nce.NceListener {
        
            private int replyLen = 0; // expected byte length
            private int waiting = 0; // to catch responses not
            // intended for this module
        Severity: Minor
        Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 5 hrs to fix

          Method getValueAt has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  @Override
                  public Object getValueAt(int row, int col) {
                      int cabId = getCabIdForRow(row);
                      if (cabId == -1 && !getShowAllCabs()) {
                          return null; // no active rows
          Severity: Major
          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 4 hrs to fix

            Method initComponents has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Override
                public void initComponents(NceSystemConnectionMemo m) {
                    this.memo = m;
                    this.tc = m.getNceTrafficController();
            
            
            Severity: Minor
            Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 1 hr to fix

              Method processMemory has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private void processMemory(boolean doPurge, boolean doUpdate, int cabId) {
                      if (doPurge) {
                          purgeRequested = true;
                          purgeCabId = cabId;
                      }
              Severity: Minor
              Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 1 hr to fix

                Method reply has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @SuppressFBWarnings(value = "NN_NAKED_NOTIFY", justification = "Thread wait from main transfer loop")
                    @Override
                    public void reply(NceReply r) {
                        log.debug("Receive character");
                        if (waiting <= 0) {
                Severity: Minor
                Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                              } else if (c == 1 || c == 3 || c == 6 || c == 7 || c == 9 || (c >= 39 && c <= 41)) {
                                  return String.class;
                              } else if (c >= 10 && c <= 38) {
                                  return Boolean.class;
                              } else if (c == 2) {
                  Severity: Major
                  Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 40 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                            return;
                    Severity: Major
                    Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                              return;
                      Severity: Major
                      Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                                return;
                        Severity: Major
                        Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                                  return;
                          Severity: Major
                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                    return;
                            Severity: Major
                            Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                      return;
                              Severity: Major
                              Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                        return;
                                Severity: Major
                                Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                          return;
                                  Severity: Major
                                  Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                            return;
                                    Severity: Major
                                    Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                              return;
                                      Severity: Major
                                      Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                                return;
                                        Severity: Major
                                        Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                                  return;
                                          Severity: Major
                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                                    return;
                                            Severity: Major
                                            Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                                      return;
                                              Severity: Major
                                              Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                        return;
                                                Severity: Major
                                                Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                          return;
                                                  Severity: Major
                                                  Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                            return;
                                                    Severity: Major
                                                    Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                              return;
                                                      Severity: Major
                                                      Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                                return;
                                                        Severity: Major
                                                        Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java - About 30 mins to fix

                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                          Open

                                                              private void procFunctions5_12(int currCabId, int c) {
                                                                  cabData[currCabId].F5 = (c & NceCmdStationMemory.FUNC_H_F5) != 0;
                                                                  cabData[currCabId].F6 = (c & NceCmdStationMemory.FUNC_H_F6) != 0;
                                                                  cabData[currCabId].F7 = (c & NceCmdStationMemory.FUNC_H_F7) != 0;
                                                                  cabData[currCabId].F8 = (c & NceCmdStationMemory.FUNC_H_F8) != 0;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 2 other locations - About 3 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1282..1291
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1297..1306

                                                          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 213.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                          Open

                                                              private void procFunctions13_20(int currCabId, int c) {
                                                                  cabData[currCabId].F13 = (c & NceCmdStationMemory.FUNC_H_F13) != 0;
                                                                  cabData[currCabId].F14 = (c & NceCmdStationMemory.FUNC_H_F14) != 0;
                                                                  cabData[currCabId].F15 = (c & NceCmdStationMemory.FUNC_H_F15) != 0;
                                                                  cabData[currCabId].F16 = (c & NceCmdStationMemory.FUNC_H_F16) != 0;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 2 other locations - About 3 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1267..1276
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1297..1306

                                                          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 213.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                          Open

                                                              private void procFunctions21_28(int currCabId, int c) {
                                                                  cabData[currCabId].F21 = (c & NceCmdStationMemory.FUNC_H_F21) != 0;
                                                                  cabData[currCabId].F22 = (c & NceCmdStationMemory.FUNC_H_F22) != 0;
                                                                  cabData[currCabId].F23 = (c & NceCmdStationMemory.FUNC_H_F23) != 0;
                                                                  cabData[currCabId].F24 = (c & NceCmdStationMemory.FUNC_H_F24) != 0;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 2 other locations - About 3 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1267..1276
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1282..1291

                                                          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 213.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              if (foundChange > 0 || cabLastChangeArray[currCabId] == null) {
                                                                                  cabLastChangeArray[currCabId] = now;
                                                                                  StringBuilder txt = new StringBuilder();
                                                                                  int h = cabLastChangeArray[currCabId].get(Calendar.HOUR_OF_DAY);
                                                                                  int m = cabLastChangeArray[currCabId].get(Calendar.MINUTE);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 3 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1217..1238

                                                          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 206.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              if (foundChange > 0 || cabLastChangeArray[currCabId] == null) {
                                                                                  cabLastChangeArray[currCabId] = now;
                                                                                  StringBuilder txt = new StringBuilder();
                                                                                  int h = cabLastChangeArray[currCabId].get(Calendar.HOUR_OF_DAY);
                                                                                  int m = cabLastChangeArray[currCabId].get(Calendar.MINUTE);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 3 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 755..776

                                                          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 206.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                          Open

                                                                              for (ptrData = 0; ptrData < 4; ptrData++, ptrCabLine++) {
                                                                                  if (cabLine1Array[currCabId][ptrCabLine] != recChars[ptrData]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine1[{}] {}<->{}", currCabId, ptrCabLine, recChars[ptrData], cabLine1Array[currCabId][ptrCabLine]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 7 other locations - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1058..1072
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1077..1091
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1115..1129
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1140..1154
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1159..1173
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1178..1192
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1197..1211

                                                          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 174.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                          Open

                                                                              for (ptrData = 0; ptrData < 4; ptrData++, ptrCabLine++) {
                                                                                  if (cabLine2Array[currCabId][ptrCabLine] != recChars[ptrData]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine2[{}] {}<->{}", currCabId, ptrCabLine, recChars[ptrData], cabLine2Array[currCabId][ptrCabLine]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 7 other locations - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1058..1072
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1077..1091
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1096..1110
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1115..1129
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1140..1154
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1159..1173
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1178..1192

                                                          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 174.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                          Open

                                                                              for (ptrData = 0; ptrData < 4; ptrData++, ptrCabLine++) {
                                                                                  if (cabLine1Array[currCabId][ptrCabLine] != recChars[ptrData]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine1[{}] {}<->{}", currCabId, ptrCabLine, recChars[ptrData], cabLine1Array[currCabId][ptrCabLine]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 7 other locations - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1058..1072
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1096..1110
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1115..1129
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1140..1154
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1159..1173
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1178..1192
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1197..1211

                                                          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 174.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                          Open

                                                                              for (ptrData = 0; ptrData < 4; ptrData++, ptrCabLine++) {
                                                                                  if (cabLine2Array[currCabId][ptrCabLine] != recChars[ptrData]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine2[{}] {}<->{}", currCabId, ptrCabLine, recChars[ptrData], cabLine2Array[currCabId][ptrCabLine]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 7 other locations - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1058..1072
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1077..1091
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1096..1110
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1115..1129
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1140..1154
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1178..1192
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1197..1211

                                                          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 174.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                          Open

                                                                              for (ptrData = 0; ptrData < 4; ptrData++, ptrCabLine++) {
                                                                                  if (cabLine2Array[currCabId][ptrCabLine] != recChars[ptrData]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine2[{}] {}<->{}", currCabId, ptrCabLine, recChars[ptrData], cabLine2Array[currCabId][ptrCabLine]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 7 other locations - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1058..1072
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1077..1091
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1096..1110
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1115..1129
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1140..1154
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1159..1173
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1197..1211

                                                          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 174.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                          Open

                                                                              for (ptrData = 0; ptrData < 4; ptrData++, ptrCabLine++) {
                                                                                  if (cabLine1Array[currCabId][ptrCabLine] != recChars[ptrData]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine1[{}] {}<->{}", currCabId, ptrCabLine, recChars[ptrData], cabLine1Array[currCabId][ptrCabLine]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 7 other locations - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1077..1091
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1096..1110
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1115..1129
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1140..1154
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1159..1173
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1178..1192
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1197..1211

                                                          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 174.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                          Open

                                                                              for (ptrData = 0; ptrData < 4; ptrData++, ptrCabLine++) {
                                                                                  if (cabLine1Array[currCabId][ptrCabLine] != recChars[ptrData]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine1[{}] {}<->{}", currCabId, ptrCabLine, recChars[ptrData], cabLine1Array[currCabId][ptrCabLine]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 7 other locations - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1058..1072
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1077..1091
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1096..1110
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1140..1154
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1159..1173
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1178..1192
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1197..1211

                                                          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 174.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 8 locations. Consider refactoring.
                                                          Open

                                                                              for (ptrData = 0; ptrData < 4; ptrData++, ptrCabLine++) {
                                                                                  if (cabLine2Array[currCabId][ptrCabLine] != recChars[ptrData]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine2[{}] {}<->{}", currCabId, ptrCabLine, recChars[ptrData], cabLine2Array[currCabId][ptrCabLine]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 7 other locations - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1058..1072
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1077..1091
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1096..1110
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1115..1129
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1159..1173
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1178..1192
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1197..1211

                                                          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 174.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              for (int i = 0; i < CAB_LINE_LEN; i++) {
                                                                                  if (cabLine2Array[currCabId][i] != recChars[i]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine2[{}] {}<->{}", currCabId, i, recChars[i], cabLine2Array[currCabId][i]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 712..726

                                                          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 170.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              for (int i = 0; i < CAB_LINE_LEN; i++) {
                                                                                  if (cabLine1Array[currCabId][i] != recChars[i]) {
                                                                                      foundChange++;
                                                                                      if (log.isDebugEnabled()) {
                                                                                          log.debug("{}: CabLine1[{}] {}<->{}", currCabId, i, recChars[i], cabLine1Array[currCabId][i]);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 736..750

                                                          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 170.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                          } else if (cabType == NceCmdStationMemory.FLAGS1_CABTYPE_DISPLAY) {
                                                                              cabData[currCabId].cabType = Bundle.getMessage("TypeProCab");
                                                                          } else if (cabType == NceCmdStationMemory.FLAGS1_CABTYPE_NODISP) {
                                                                              cabData[currCabId].cabType = Bundle.getMessage("TypeCab04"); // Cab04 or Cab06
                                                                          } else if (cabType == NceCmdStationMemory.FLAGS1_CABTYPE_USB) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 838..848

                                                          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 148.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                          if (cabType == NceCmdStationMemory.FLAGS1_CABTYPE_DISPLAY) {
                                                                              cabData[currCabId].cabType = Bundle.getMessage("TypeProCab");
                                                                          } else if (cabType ==  NceCmdStationMemory.FLAGS1_CABTYPE_NODISP) {
                                                                              cabData[currCabId].cabType = Bundle.getMessage("TypeCab04"); // Cab04 or Cab06
                                                                          } else if (cabType ==  NceCmdStationMemory.FLAGS1_CABTYPE_USB) {
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 2 hrs to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 535..545

                                                          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 148.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                              private void readUsbCabMemoryN(int num) {
                                                                  switch (num) {
                                                                      case 1:
                                                                          replyLen = NceMessage.REPLY_1; // Expect 1 byte response
                                                                          break;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrix/nce/macro/NceMacroEditPanel.java on lines 1432..1451

                                                          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 114.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                          Open

                                                              protected void addItemTop(JPanel p, JComponent c, int x, int y) {
                                                                  GridBagConstraints gc = new GridBagConstraints();
                                                                  gc.gridx = x;
                                                                  gc.gridy = y;
                                                                  gc.weightx = 100.0;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 2 other locations - About 1 hr to fix
                                                          java/src/jmri/jmrit/operations/OperationsPanel.java on lines 94..102
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1499..1507

                                                          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 77.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                          Open

                                                              protected void addItemLeft(JPanel p, JComponent c, int x, int y) {
                                                                  GridBagConstraints gc = new GridBagConstraints();
                                                                  gc.gridx = x;
                                                                  gc.gridy = y;
                                                                  gc.weightx = 100.0;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 2 other locations - About 1 hr to fix
                                                          java/src/jmri/jmrit/operations/OperationsPanel.java on lines 94..102
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1509..1517

                                                          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 77.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                              private void readCabMemory1(int cabNum, int offset) {
                                                                  int nceCabAddr = getNceCabAddr(cabNum, offset);
                                                                  replyLen = NceMessage.REPLY_1; // Expect 1 byte response
                                                                  waiting++;
                                                                  byte[] bl = NceBinaryCommand.accMemoryRead1(nceCabAddr);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1421..1428

                                                          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 73.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                              private void readCabMemory16(int cabNum, int offset) {
                                                                  int nceCabAddr = getNceCabAddr(cabNum, offset);
                                                                  replyLen = NceMessage.REPLY_16; // Expect 16 byte response
                                                                  waiting++;
                                                                  byte[] bl = NceBinaryCommand.accMemoryRead(nceCabAddr);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 1 hr to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1411..1418

                                                          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 73.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 11 locations. Consider refactoring.
                                                          Open

                                                              @Override
                                                              public String getTitle() {
                                                                  StringBuilder x = new StringBuilder();
                                                                  if (memo != null) {
                                                                      x.append(memo.getUserName());
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 10 other locations - About 55 mins to fix
                                                          java/src/jmri/jmrix/mrc/swing/packetgen/MrcPacketGenPanel.java on lines 51..62
                                                          java/src/jmri/jmrix/nce/boosterprog/BoosterProgPanel.java on lines 52..63
                                                          java/src/jmri/jmrix/nce/clockmon/ClockMonPanel.java on lines 217..228
                                                          java/src/jmri/jmrix/nce/consist/NceConsistEditPanel.java on lines 229..240
                                                          java/src/jmri/jmrix/nce/macro/NceMacroEditPanel.java on lines 229..240
                                                          java/src/jmri/jmrix/nce/macro/NceMacroGenPanel.java on lines 60..71
                                                          java/src/jmri/jmrix/nce/packetgen/NcePacketGenPanel.java on lines 56..67
                                                          java/src/jmri/jmrix/nce/usbinterface/UsbInterfacePanel.java on lines 76..87
                                                          java/src/jmri/jmrix/ncemonitor/NcePacketMonitorPanel.java on lines 109..120
                                                          java/src/jmri/jmrix/zimo/swing/packetgen/Mx1PacketGenPanel.java on lines 50..61

                                                          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 67.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                          Open

                                                              protected void addItem(JPanel p, JComponent c, int x, int y) {
                                                                  GridBagConstraints gc = new GridBagConstraints();
                                                                  gc.gridx = x;
                                                                  gc.gridy = y;
                                                                  gc.weightx = 100.0;
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 2 other locations - About 55 mins to fix
                                                          java/src/jmri/jmrit/operations/OperationsPanel.java on lines 85..92
                                                          java/src/jmri/jmrix/nce/usbinterface/UsbInterfacePanel.java on lines 337..344

                                                          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 65.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                          Open

                                                              private void setUsbCabMemoryPointer(int cab, int offset) {
                                                                  replyLen = NceMessage.REPLY_1; // Expect 1 byte response
                                                                  waiting++;
                                                                  byte[] bl = NceBinaryCommand.usbMemoryPointer(cab, offset);
                                                                  NceMessage m = NceMessage.createBinaryMessage(tc, bl, NceMessage.REPLY_1);
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 3 other locations - About 55 mins to fix
                                                          java/src/jmri/jmrix/nce/macro/NceMacroEditPanel.java on lines 1423..1429
                                                          java/src/jmri/jmrix/nce/macro/NceMacroEditPanel.java on lines 1476..1482
                                                          java/src/jmri/jmrix/nce/macro/NceMacroEditPanel.java on lines 1485..1491

                                                          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 63.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              if (cabConsistArray[currCabId] != 0) {
                                                                                  if (pos > 0) {
                                                                                      cabData[currCabId].consistPos = Bundle.getMessage("IsRear");
                                                                                  } else {
                                                                                      cabData[currCabId].consistPos = Bundle.getMessage("IsLead");
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 50 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1001..1007

                                                          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 62.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              if (cabConsistArray[currCabId] != 0) {
                                                                                  if (pos > 0) {
                                                                                      cabData[currCabId].consistPos = Bundle.getMessage("IsRear");
                                                                                  } else {
                                                                                      cabData[currCabId].consistPos = Bundle.getMessage("IsLead");
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 50 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 645..651

                                                          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 62.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                              private void writeUsbCabMemory1(int value) {
                                                                  replyLen = NceMessage.REPLY_1; // Expect 1 byte response
                                                                  waiting++;
                                                                  byte[] bl = NceBinaryCommand.usbMemoryWrite1((byte) value);
                                                                  NceMessage m = NceMessage.createBinaryMessage(tc, bl, NceMessage.REPLY_1);
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 50 mins to fix
                                                          java/src/jmri/jmrix/nce/macro/NceMacroEditPanel.java on lines 1458..1464

                                                          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 62.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                  while (waiting > 0) {
                                                                      synchronized (this) {
                                                                          try {
                                                                              wait(100);
                                                                          } catch (InterruptedException e) {
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 50 mins to fix
                                                          java/src/jmri/jmrix/nce/usbinterface/UsbInterfacePanel.java on lines 300..313

                                                          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 62.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                  for (int col = 0; col < cabTable.getColumnCount(); col++) {
                                                                      int width = cabModel.getPreferredWidth(col);
                                                                      TableColumn c = cabTable.getColumnModel().getColumn(col);
                                                                      c.setPreferredWidth(width);
                                                                  }
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 45 mins to fix
                                                          java/src/jmri/jmrit/roster/swing/speedprofile/SpeedProfileTable.java on lines 82..86

                                                          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 56.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              if (cabType != NceCmdStationMemory.FLAGS1_CABTYPE_USB) {
                                                                                  if (mode > 0) {
                                                                                      cabData[currCabId].mode = "128";
                                                                                  } else {
                                                                                      cabData[currCabId].mode = "28";
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 40 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 941..947

                                                          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 52.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              if (cabType != NceCmdStationMemory.FLAGS1_CABTYPE_USB) {
                                                                                  if (mode > 0) {
                                                                                      cabData[currCabId].mode = "128";
                                                                                  } else {
                                                                                      cabData[currCabId].mode = "28";
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 40 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 593..599

                                                          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 52.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                          Open

                                                                  if (replyLen == NceMessage.REPLY_2) {
                                                                      // Looking for proper response
                                                                      for (int i = 0; i < NceMessage.REPLY_2; i++) {
                                                                          recChars[i] = r.getElement(i);
                                                                      }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 2 other locations - About 40 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1381..1386
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1388..1393

                                                          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 50.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                          Open

                                                                  if (replyLen == NceMessage.REPLY_16) {
                                                                      // Looking for proper response
                                                                      for (int i = 0; i < NceMessage.REPLY_16; i++) {
                                                                          recChars[i] = r.getElement(i);
                                                                      }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 2 other locations - About 40 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1374..1379
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1381..1386

                                                          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 50.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                          Open

                                                                  if (replyLen == NceMessage.REPLY_4) {
                                                                      // Looking for proper response
                                                                      for (int i = 0; i < NceMessage.REPLY_4; i++) {
                                                                          recChars[i] = r.getElement(i);
                                                                      }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 2 other locations - About 40 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1374..1379
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1388..1393

                                                          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 50.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabF13Array[currCabId] != recChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: F13 {}<->{}", currCabId, recChar, cabF13Array[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabSpeedArray[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Speed {}<->{}", currCabId, readChar, cabSpeedArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabF21Array[currCabId] != recChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: F21 {}<->{}", currCabId, recChar, cabF21Array[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabLongShortArray[currCabId] != aType) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Long {}<->{}", currCabId, aType, cabLongShortArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabF5Array[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: F5 {}<->{}", currCabId, readChar, cabF5Array[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabFlagsArray[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Flags {}<->{}", currCabId, readChar, cabFlagsArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabConsistArray[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Consist {}<->{}", currCabId, readChar, cabConsistArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabLocoArray[currCabId] != locoAddress) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Loco {}<->{}", currCabId, locoAddress, cabLocoArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabSpeedArray[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Speed {}<->{}", currCabId, readChar, cabSpeedArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabConsistArray[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Consist {}<->{}", currCabId, readChar, cabConsistArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabF0Array[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: F0 {}<->{}", currCabId, readChar, cabF0Array[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabFlagsArray[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Flags {}<->{}", currCabId, readChar, cabFlagsArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabF21Array[currCabId] != recChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: F21 {}<->{}", currCabId, recChar, cabF21Array[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabF0Array[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: F0 {}<->{}", currCabId, readChar, cabF0Array[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabF13Array[currCabId] != recChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: F13 {}<->{}", currCabId, recChar, cabF13Array[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabLocoArray[currCabId] != locoAddress) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Loco {}<->{}", currCabId, locoAddress, cabLocoArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabF5Array[currCabId] != readChar) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: F5 {}<->{}", currCabId, readChar, cabF5Array[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 890..895
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 18 locations. Consider refactoring.
                                                          Open

                                                                              if (cabLongShortArray[currCabId] != aType) {
                                                                                  foundChange++;
                                                                                  if (log.isDebugEnabled()) {
                                                                                      log.debug("{}: Long {}<->{}", currCabId, aType, cabLongShortArray[currCabId]);
                                                                                  }
                                                          Severity: Major
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 17 other locations - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 565..570
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 577..582
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 606..611
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 622..627
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 633..638
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 655..660
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 667..672
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 682..687
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 696..701
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 871..876
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 910..915
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 925..930
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 955..960
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 973..978
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 989..994
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1018..1023
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 1036..1041

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                          if (recChar != cabFlag1Array[currCabId]) {
                                                                              foundChange++;
                                                                              if (log.isDebugEnabled()) {
                                                                                  log.debug("{}: Flag1 {}<->{}", currCabId, recChar, cabFlag1Array[currCabId]);
                                                                              }
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 518..523

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                          if (recChar != cabFlag1Array[currCabId]) {
                                                                              foundChange++;
                                                                              if (log.isDebugEnabled()) {
                                                                                  log.debug("{}: Flag1 {}<->{}", currCabId, recChar, cabFlag1Array[currCabId]);
                                                                              }
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 822..827

                                                          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 46.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              if (aType) {
                                                                                  cabData[currCabId].longShort = Bundle.getMessage("IsLongAddr");
                                                                              } else {
                                                                                  cabData[currCabId].longShort = Bundle.getMessage("IsShortAddr");
                                                                              }
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 613..617

                                                          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 44.

                                                          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

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                              if (aType) {
                                                                                  cabData[currCabId].longShort = Bundle.getMessage("IsLongAddr");
                                                                              } else {
                                                                                  cabData[currCabId].longShort = Bundle.getMessage("IsShortAddr");
                                                                              }
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 35 mins to fix
                                                          java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java on lines 897..901

                                                          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 44.

                                                          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

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                              public void buttonActionPerformed(ActionEvent ae) {
                                                                  Object src = ae.getSource();
                                                                  if (src == refreshButton) {
                                                                      refreshPanel();
                                                                  } else {
                                                          Severity: Minor
                                                          Found in java/src/jmri/jmrix/nce/cab/NceShowCabPanel.java and 1 other location - About 30 mins to fix
                                                          java/src/jmri/jmrix/nce/usbinterface/UsbInterfacePanel.java on lines 157..164

                                                          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 40.

                                                          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

                                                          Further Reading

                                                          There are no issues that match your filters.

                                                          Category
                                                          Status