SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

Avoid deeply nested control flow statements.
Open

                                for (String u : category.getAllUnits()) {
                                    unitBoxes.get(column).addItem(u);
                                }

Method equals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean equals(final Object obj) {
        if (obj == null) {
            return false;
        }

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

Avoid deeply nested control flow statements.
Open

                        if (miscParams.get(i).equals(element.name)) {
                            value = element.value;
                            unit = element.unit;
                            break;
                        }

Avoid deeply nested control flow statements.
Open

                        if (miscValues.containsKey(indepVars.get(i))) {
                            parameters.put(indepVars.get(i),
                                    miscValues.get(indepVars.get(i)));
                        }

Method equals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }

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

Avoid deeply nested control flow statements.
Open

                        if ((min != null && value < min)
                                || (max != null && value > max)) {
                            invalid.put(id, param + " of " + value + " " + unit
                                    + " is not in range of model " + min + " "
                                    + unit + " to " + max + " " + unit);

Avoid deeply nested control flow statements.
Open

                        if (param.equals(element.name)) {
                            paramValue = element.value;
                            miscUnitMaps.get(id).put(param, element.unit);
                            break;
                        }

Avoid deeply nested control flow statements.
Open

                        for (PmmXmlElementConvertable el : tuple.getPmmXml(
                                TimeSeriesSchema.ATT_MISC).getElementSet()) {
                            MiscXml element = (MiscXml) el;

                            if (miscParams.get(i).equals(element.name)) {

Avoid deeply nested control flow statements.
Open

                        if (lagParams.containsKey(oldID)) {
                            newLagParams.put(newID, lagParams.get(oldID));
                        }

Method getConcentrationRange has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private static Point2D getConcentrationRange(List<KnimeTuple> tuples) {
        double min = Double.POSITIVE_INFINITY;
        double max = Double.NEGATIVE_INFINITY;

        for (KnimeTuple tuple : tuples) {

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 getTableCellRendererComponent has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
                int row, int column) {

Avoid deeply nested control flow statements.
Open

                        if (initParams.containsKey(oldID)) {
                            newInitParams.put(newID, initParams.get(oldID));
                        }

Avoid deeply nested control flow statements.
Open

                        if (miscParams.get(i).equals(element.name)) {
                            min = element.min;
                            max = element.max;
                            unit = element.unit;
                            break;

Method getTableCellRendererComponent has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
                int row, int column) {

Avoid deeply nested control flow statements.
Open

                            if (hasM2) {
                                ParametricModel pm2 = new ParametricModel(row, 2, null);
                                m2EstID = pm2.estModelId;
                                if (!m2s.containsKey(m2EstID)) {
                                    m2s.put(m2EstID, pm2);                                

Avoid deeply nested control flow statements.
Open

                                if (m1s.containsKey(id)) {
                                    for (String property : hm.keySet()) {
                                        Object[] o = hm.get(property);
                                        if (o != null) setValue(m1s.get(id), property, o[0], o[1]);
                                    }

Method getTableCellRendererComponent has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

          public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int columnIndex) {

Avoid deeply nested control flow statements.
Open

                        if (unit != null) {
                            units.put(miscParams.get(i), unit);
                            categories.put(
                                    miscParams.get(i),
                                    Arrays.asList(Categories.getCategoryByUnit(

Avoid deeply nested control flow statements.
Open

                            if (!m1s.containsKey(m1EstID)) {
                                m1s.put(m1EstID, pm1);                                
                            }

Avoid deeply nested control flow statements.
Open

                            for (int i=1;i<this.getRowCount();i++) {
                                if (i != rowIndex && this.getValueAt(i, 2) != null && (Boolean) this.getValueAt(i, 2)) {
                                    this.setValueAt(false, i, 2);
                                }
                            }
Severity
Category
Status
Source
Language