SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

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

    private PmmXmlDoc toDoc() throws InvalidSettingsException {
        PmmXmlDoc doc = new PmmXmlDoc();

        ParametricModel pm = finalizePM(-1);

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 (row == 0) {
                            pm.setDepCategory(categoryStr);
                            pm.setDepUnit(unit);
                        } else if (isIndep != null && isIndep instanceof Boolean && ((Boolean) isIndep)) {
                            pm.setIndepCategory(param, categoryStr);

Avoid deeply nested control flow statements.
Open

                            if (diff.getChanges().size() == 0) {
                                doc.remove(pxecL);
                                break;
                            }

Avoid deeply nested control flow statements.
Open

                        if (el instanceof CatalogModelXml) {
                            cmx = (CatalogModelXml) el;
                            break;
                        }

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

    private void readDataTable() {
        dependentParameters = new LinkedHashMap<>();
        primaryModelNames = new LinkedHashMap<>();
        independentParameterCategories = new LinkedHashMap<>();

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 (primaryModelNames.get(id).equals(modelName)) {
                            modelID = id;
                            break;
                        }

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

    private List<String> condSplit(final String misc) {
        if (misc == null) {
            return null;
        }
        List<String> result = new ArrayList<>();

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 (tslist.containsKey(condID)) tss.put(condID, tslist.get(condID));
                            else tss.put(condID, ts);

Avoid deeply nested control flow statements.
Open

                        if (!CellIO.getNameList(params).contains(
                                newDepVarSecName)) {
                            continue;
                        }

Avoid deeply nested control flow statements.
Open

                        for (PmmXmlElementConvertable el : miscs
                                .getElementSet()) {
                            MiscXml element = (MiscXml) el;

                            if (paramsConvertTo.containsKey(element.name)) {

Avoid deeply nested control flow statements.
Open

                            if (!Double.isNaN(guess.y)) {
                                maxGuessValues.add(guess.y);
                            } else {
                                maxGuessValues.add(null);
                            }

Avoid deeply nested control flow statements.
Open

                            for (PmmXmlElementConvertable el : estModel.getElementSet()) {
                                if (el instanceof EstModelXml) {
                                    emx = (EstModelXml) el;
                                    break;
                                }

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 (String param : miscParams) {
                            miscs.get(param).remove(i);
                        }

Avoid deeply nested control flow statements.
Open

                        for (int i = 0; i < set.getSelectedValuesX().get(param)
                                .size(); i++) {
                            if (set.getSelectedValuesX().get(param).get(i)) {
                                usedValues.add(valuesList.get(i));
                            }

Avoid deeply nested control flow statements.
Open

                        if (el instanceof CatalogModelXml) {
                            cmx = (CatalogModelXml) el;
                            break;
                        }

Avoid deeply nested control flow statements.
Open

                        if (!replace.containsKey(iv.name)) {
                            error = true;
                            break;
                        }

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

    public static Map<Integer, Map<Integer, List<KnimeTuple>>> sortGlobalModels(List<KnimeTuple> tuples) {
        // Sort tertiary models
        Map<Integer, Map<Integer, List<KnimeTuple>>> gms = new HashMap<>();
        for (KnimeTuple tuple : tuples) {
            Integer gmID = tuple.getInt(Model2Schema.ATT_GLOBAL_MODEL_ID);

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 (miscValues.containsKey(indepVars.get(i))) {
                            parameters.put(indepVars.get(i),
                                    miscValues.get(indepVars.get(i)));
                        }

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

        private static TwoStepTertiaryModel parse(List<List<KnimeTuple>> tupleList, boolean isPMFX, int modelNum,
                String mdName, Metadata metadata, String notes) {
Severity
Category
Status
Source
Language