java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java

Summary

Maintainability
F
3 wks
Test Coverage

File StlEditorPane.java has 2314 lines of code (exceeds 300 allowed). Consider refactoring.
Open

package jmri.jmrix.openlcb.swing.stleditor;

import java.awt.*;
import java.awt.event.*;
import java.io.*;
Severity: Major
Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 6 days to fix

    StlEditorPane has 79 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class StlEditorPane extends jmri.util.swing.JmriPanel
            implements jmri.jmrix.can.swing.CanPanelInterface {
    
        /**
         * The STL Editor is dependent on the Tower LCC+Q software version
    Severity: Major
    Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 1 day to fix

      Method nameToVariable has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring.
      Open

          private String nameToVariable(String name) {
              if (name != null && !name.isEmpty()) {
                  if (!name.contains("~")) {
                      // Search input and output tables
                      for (int i = 0; i < 16; i++) {
      Severity: Minor
      Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 5 hrs 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 decode has a Cognitive Complexity of 39 (exceeds 20 allowed). Consider refactoring.
      Open

          private void decode(GroupRow groupRow) {
              String[] lines = groupRow.getMultiLine().split("\\n");
      
              for (int i = 0; i < lines.length; i++) {
                  if (lines[i].isEmpty()) {
      Severity: Minor
      Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 3 hrs 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 initComponents has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          public void initComponents(CanSystemConnectionMemo memo) {
              _canMemo = memo;
              _iface = memo.get(OlcbInterface.class);
              _store = memo.get(MimicNodeStore.class);
      Severity: Major
      Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 2 hrs to fix

        Method encode has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private void encode(GroupRow groupRow) {
                String longLine = "";
        
                var logicList = groupRow.getLogicList();
                for (var row : logicList) {
        Severity: Major
        Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 2 hrs to fix

          Method decode has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void decode(GroupRow groupRow) {
                  String[] lines = groupRow.getMultiLine().split("\\n");
          
                  for (int i = 0; i < lines.length; i++) {
                      if (lines[i].isEmpty()) {
          Severity: Major
          Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 2 hrs to fix

            Method encode has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
            Open

                private void encode(GroupRow groupRow) {
                    String longLine = "";
            
                    var logicList = groupRow.getLogicList();
                    for (var row : logicList) {
            Severity: Minor
            Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 2 hrs 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 loadBackupData has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private void loadBackupData(ActionEvent m) {
                    if (!replaceData()) {
                        return;
                    }
            
            
            Severity: Minor
            Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 2 hrs to fix

              Method nameToVariable has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private String nameToVariable(String name) {
                      if (name != null && !name.isEmpty()) {
                          if (!name.contains("~")) {
                              // Search input and output tables
                              for (int i = 0; i < 16; i++) {
              Severity: Minor
              Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 1 hr to fix

                Method variableToName has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private String variableToName(String variable) {
                        String name = "";
                
                        if (variable.length() > 1) {
                            var varType = variable.substring(0, 1);
                Severity: Minor
                Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 1 hr to fix

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

                          @Override
                          public void setValueAt(Object type, int r, int c) {
                              var logicList = _groupList.get(_groupRow).getLogicList();
                              switch (c) {
                                  case LABEL_COLUMN:
                  Severity: Minor
                  Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 1 hr to fix

                    Method importGroupLogic has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private void importGroupLogic() {
                            List<CSVRecord> records = getCsvRecords("group_logic.csv");
                            if (records.isEmpty()) {
                                return;
                            }
                    Severity: Minor
                    Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 1 hr to fix

                      Method displayStoreDone has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private void displayStoreDone() {
                              _csvMessages.add(Bundle.getMessage("StoreDone"));
                              var msgType = JmriJOptionPane.ERROR_MESSAGE;
                              if (_csvMessages.size() == 1) {
                                  msgType = JmriJOptionPane.INFORMATION_MESSAGE;
                      Severity: Minor
                      Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 1 hr to fix

                        Avoid too many return statements within this method.
                        Open

                                return null;
                        Severity: Major
                        Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java - About 30 mins to fix

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

                              class OutputModel extends AbstractTableModel {
                                  OutputModel() {
                                  }
                          
                                  public static final int OUTPUT_COLUMN = 0;
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2422..2520

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

                          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

                              class InputModel extends AbstractTableModel {
                          
                                  InputModel() {
                                  }
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2525..2622

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

                          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

                              class ReceiverModel extends AbstractTableModel {
                          
                                  ReceiverModel() {
                                  }
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2718..2804

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

                          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

                              class TransmitterModel extends AbstractTableModel {
                          
                                  TransmitterModel() {
                                  }
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2627..2713

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

                          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 storeOutputs() {
                                  int currentCount = 0;
                          
                                  for (int i = 0; i < 16; i++) {
                                      for (int j = 0; j < 8; j++) {
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1240..1270

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

                          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 storeInputs() {
                                  int currentCount = 0;
                          
                                  for (int i = 0; i < 16; i++) {
                                      for (int j = 0; j < 8; j++) {
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1272..1302

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

                          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 exportOutputs() throws IOException {
                                  var fileWriter = new FileWriter(_csvDirectoryPath + "outputs.csv");
                                  var bufferedWriter = new BufferedWriter(fileWriter);
                                  var csvFile = new CSVPrinter(bufferedWriter, CSVFormat.DEFAULT);
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1751..1770

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

                          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 exportInputs() throws IOException {
                                  var fileWriter = new FileWriter(_csvDirectoryPath + "inputs.csv");
                                  var bufferedWriter = new BufferedWriter(fileWriter);
                                  var csvFile = new CSVPrinter(bufferedWriter, CSVFormat.DEFAULT);
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1772..1791

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

                          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 importOutputs() {
                                  List<CSVRecord> records = getCsvRecords("outputs.csv");
                                  if (records.isEmpty()) {
                                      return;
                                  }
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1555..1581

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

                          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 importInputs() {
                                  List<CSVRecord> records = getCsvRecords("inputs.csv");
                                  if (records.isEmpty()) {
                                      return;
                                  }
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1583..1609

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

                          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 loadCdiInputs() {
                                  for (int i = 0; i < 16; i++) {
                                      for (int j = 0; j < 8; j++) {
                                          var inputRow = _inputList.get((i * 8) + j);
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1152..1166

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

                          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 loadCdiOutputs() {
                                  for (int i = 0; i < 16; i++) {
                                      for (int j = 0; j < 8; j++) {
                                          var outputRow = _outputList.get((i * 8) + j);
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1136..1150

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

                          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

                              static class InputRow {
                                  String _name;
                                  String _eventTrue;
                                  String _eventFalse;
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2108..2150

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

                          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

                              static class OutputRow {
                                  String _name;
                                  String _eventTrue;
                                  String _eventFalse;
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2061..2103

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

                          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 importReceivers() {
                                  List<CSVRecord> records = getCsvRecords("receivers.csv");
                                  if (records.isEmpty()) {
                                      return;
                                  }
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1638..1663

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

                          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 importTransmitters() {
                                  List<CSVRecord> records = getCsvRecords("transmitters.csv");
                                  if (records.isEmpty()) {
                                      return;
                                  }
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1611..1636

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

                          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 exportTransmitters() throws IOException {
                                  var fileWriter = new FileWriter(_csvDirectoryPath + "transmitters.csv");
                                  var bufferedWriter = new BufferedWriter(fileWriter);
                                  var csvFile = new CSVPrinter(bufferedWriter, CSVFormat.DEFAULT);
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1793..1810

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

                          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 exportReceivers() throws IOException {
                                  var fileWriter = new FileWriter(_csvDirectoryPath + "receivers.csv");
                                  var bufferedWriter = new BufferedWriter(fileWriter);
                                  var csvFile = new CSVPrinter(bufferedWriter, CSVFormat.DEFAULT);
                          
                          
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1812..1829

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

                          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

                              static class TransmitterRow {
                                  String _name;
                                  String _eventid;
                          
                                  TransmitterRow(String name, String eventid) {
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2155..2183

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

                          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

                              static class ReceiverRow {
                                  String _name;
                                  String _eventid;
                          
                                  ReceiverRow(String name, String eventid) {
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2188..2216

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

                          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 loadCdiTransmitters() {
                                  for (int i = 0; i < 16; i++) {
                                      var transmitterRow = _transmitterList.get(i);
                          
                                      var entry = (ConfigRepresentation.StringEntry) _cdi.getVariableForKey(String.format(TRANSMITTER_NAME, i));
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1168..1178

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

                          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 loadCdiReceivers() {
                                  for (int i = 0; i < 16; i++) {
                                      var receiverRow = _receiverList.get(i);
                          
                                      var entry = (ConfigRepresentation.StringEntry) _cdi.getVariableForKey(String.format(RECEIVER_NAME, i));
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1180..1190

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

                          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 JScrollPane buildOutputPanel() {
                                  // Create scroll pane
                                  var model = new OutputModel();
                                  _outputTable = new JTable(model);
                                  var scrollPane = new JScrollPane(_outputTable);
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 303..318
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 337..352
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 354..369

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

                          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 JScrollPane buildReceiverPanel() {
                                  // Create scroll pane
                                  var model = new ReceiverModel();
                                  _receiverTable = new JTable(model);
                                  var scrollPane = new JScrollPane(_receiverTable);
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 303..318
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 320..335
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 354..369

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

                          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 JScrollPane buildTransmitterPanel() {
                                  // Create scroll pane
                                  var model = new TransmitterModel();
                                  _transmitterTable = new JTable(model);
                                  var scrollPane = new JScrollPane(_transmitterTable);
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 303..318
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 320..335
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 337..352

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

                          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 JScrollPane buildInputPanel() {
                                  // Create scroll pane
                                  var model = new InputModel();
                                  _inputTable = new JTable(model);
                                  var scrollPane = new JScrollPane(_inputTable);
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 320..335
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 337..352
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 354..369

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

                          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 loadBackupInputs(int index, List<String> lines) {
                                  for (int i = 0; i < 128; i++) {
                                      var inputRow = _inputList.get(i);
                          
                                      inputRow.setName(getLineValue(lines.get(index)));
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1429..1440

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

                          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 loadBackupOutputs(int index, List<String> lines) {
                                  for (int i = 0; i < 128; i++) {
                                      var outputRow = _outputList.get(i);
                          
                                      outputRow.setName(getLineValue(lines.get(index)));
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1416..1427

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

                          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 pushedMoveUpButton(ActionEvent e) {
                                  var logicList = _groupList.get(_groupRow).getLogicList();
                                  if (_logicRow >= 0 && _logicRow < logicList.size()) {
                                      var logicRow = logicList.remove(_logicRow);
                                      logicList.add(_logicRow - 1, logicRow);
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 463..473

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

                          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 pushedMoveDownButton(ActionEvent e) {
                                  var logicList = _groupList.get(_groupRow).getLogicList();
                                  if (_logicRow >= 0 && _logicRow < logicList.size()) {
                                      var logicRow = logicList.remove(_logicRow);
                                      logicList.add(_logicRow + 1, logicRow);
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 451..461

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

                          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 < 16; i++) {
                                              for (int j = 0; j < 8; j++) {
                                                  int row = (i * 8) + j;
                                                  if (_outputList.get(row).getName().equals(name)) {
                                                      return "Q" + i + "." + j;
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 490..497

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

                          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 < 16; i++) {
                                              for (int j = 0; j < 8; j++) {
                                                  int row = (i * 8) + j;
                                                  if (_inputList.get(row).getName().equals(name)) {
                                                      return "I" + i + "." + j;
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 499..506

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

                          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 loadBackupReceivers(int index, List<String> lines) {
                                  for (int i = 0; i < 16; i++) {
                                      var receiverRow = _receiverList.get(i);
                          
                                      receiverRow.setName(getLineValue(lines.get(index)));
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1454..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 83.

                          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 loadBackupTransmitters(int index, List<String> lines) {
                                  for (int i = 0; i < 16; i++) {
                                      var transmitterRow = _transmitterList.get(i);
                          
                                      transmitterRow.setName(getLineValue(lines.get(index)));
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 1442..1452

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

                          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

                                          if (operName.equals("Cp")) {
                                              operName = ")";
                                          } else if (operName.equals("EQ")) {
                                              operName = "=";
                                          } else if (operName.contains("p")) {
                          Severity: Major
                          Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java and 2 other locations - About 50 mins to fix
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 763..769
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2026..2032

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

                          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

                                      if (name.equals("=")) {
                                          temp = "EQ";
                                      } else if (name.equals(")")) {
                                          temp = "Cp";
                                      } else if (name.endsWith("(")) {
                          Severity: Major
                          Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java and 2 other locations - About 50 mins to fix
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 611..617
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 2026..2032

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

                          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

                                      if (operName.equals("Cp")) {
                                          operName = ")";
                                      } else if (operName.equals("EQ")) {
                                          operName = "=";
                                      } else if (operName.contains("p")) {
                          Severity: Major
                          Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java and 2 other locations - About 50 mins to fix
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 611..617
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 763..769

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

                          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

                                              case "I":
                                                  row = (first * 8) + second;
                                                  name = _inputList.get(row).getName();
                                                  if (name.isEmpty()) {
                                                      name = variable;
                          Severity: Minor
                          Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java and 1 other location - About 45 mins to fix
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 570..576

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

                          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

                                              case "Q":
                                                  row = (first * 8) + second;
                                                  name = _outputList.get(row).getName();
                                                  if (name.isEmpty()) {
                                                      name = variable;
                          Severity: Minor
                          Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java and 1 other location - About 45 mins to fix
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 563..569

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

                          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 < 16; i++) {
                                              if (_receiverList.get(i).getName().equals(baseName)) {
                                                  return "Y" + i + "." + aspectNumber;
                                              }
                                          }
                          Severity: Minor
                          Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java and 1 other location - About 40 mins to fix
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 531..535

                          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

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

                                          for (int i = 0; i < 16; i++) {
                                              if (_transmitterList.get(i).getName().equals(baseName)) {
                                                  return "Z" + i + "." + aspectNumber;
                                              }
                                          }
                          Severity: Minor
                          Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java and 1 other location - About 40 mins to fix
                          java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java on lines 525..529

                          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

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

                                      int response = JmriJOptionPane.showOptionDialog(this,
                                              Bundle.getMessage("MessageCdiReboot"),
                                              Bundle.getMessage("TitleCdiReboot"),
                                              JmriJOptionPane.YES_NO_OPTION,
                                              JmriJOptionPane.QUESTION_MESSAGE,
                          Severity: Major
                          Found in java/src/jmri/jmrix/openlcb/swing/stleditor/StlEditorPane.java and 6 other locations - About 30 mins to fix
                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2151..2156
                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2261..2266
                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2332..2337
                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2372..2377
                          java/src/jmri/jmrit/timetable/swing/TimeTableFrame.java on lines 2791..2796
                          java/src/jmri/jmrix/loconet/ds64/Ds64TabbedPanel.java on lines 1965..1969

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

                          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 12 locations. Consider refactoring.
                          Open

                                  LogicRow(String label, Operator oper, String name, String comment) {
                                      _label = label;
                                      _oper = oper;
                                      _name = name;
                                      _comment = comment;
                          java/src/jmri/Conditional.java on lines 349..354
                          java/src/jmri/TransitSection.java on lines 48..53
                          java/src/jmri/jmrit/ctc/CTCException.java on lines 21..26
                          java/src/jmri/jmrit/ctc/TrafficLocking.java on lines 109..115
                          java/src/jmri/jmrit/ctc/topology/TopologyInfo.java on lines 25..30
                          java/src/jmri/jmrit/display/layoutEditor/LayoutBlock.java on lines 4451..4456
                          java/src/jmri/jmrit/entryexit/DestinationPoints.java on lines 1021..1026
                          java/src/jmri/jmrit/logixng/util/parser/RecursiveDescentParser.java on lines 95..100
                          java/src/jmri/jmrit/timetable/swing/TimeTablePrintGraph.java on lines 21..26
                          java/src/jmri/jmrit/vsdecoder/listener/ListeningSpot.java on lines 66..71
                          java/src/jmri/jmrix/can/cbus/CbusOpCodes.java on lines 594..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 41.

                          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