SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

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) {

Avoid deeply nested control flow statements.
Open

                        if (mx.name.equalsIgnoreCase(par)) {
                            if (mx.value == null) {
                                paramFound = true;
                                break;
                            }

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

    private void fillWithDefaults(Integer defAgent, Integer defMatrix, Double defTemp, Double defPh, Double defAw, LinkedHashMap<String, DoubleTextField[]> params) throws InvalidSettingsException {

Avoid deeply nested control flow statements.
Open

                        if (categories.containsKey(element.name)
                                && categories.get(element.name) == null) {
                            categories.put(element.name, Categories
                                    .getCategoryByUnit(element.unit)
                                    .getName());

Avoid deeply nested control flow statements.
Open

                            for (index2 = index - 1; index2 >= 0 && val.charAt(index2) != '('; index2--) {
                                ;
                            }

Avoid deeply nested control flow statements.
Open

                        if (!addWarningMsg.isEmpty()) this.setWarningMessage(this.getWarningMessage() + addWarningMsg);

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

        private static ManualSecondaryModel parse(KnimeTuple tuple, boolean isPMFX, String mdName, int mdNum,
                Metadata metadata, String notes) {

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

    @Override
    protected PortObject[] execute(PortObject[] inObjects, ExecutionContext exec)
            throws Exception {
        BufferedDataTable table = (BufferedDataTable) inObjects[0];
        TableReader reader = new TableReader(table,

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 (hasM2) {
                                ParametricModel pm2 = new ParametricModel(row, 2, null);
                                m2EstID = pm2.estModelId;
                                if (!m2s.containsKey(m2EstID)) {
                                    if (mlist.containsKey(m2EstID)) m2s.put(m2EstID, mlist.get(m2EstID));

Avoid deeply nested control flow statements.
Open

                        if (model.getIndependent().size() > 0) {
                            if (tupleM1 != null) {
                                if (hasEditFeature && tstuples != null && tstuples.size() > 1) {
                                    for (PmmTimeSeries tst : tstuples) {
                                        doBuf(tupleM1, tst, rowSec, buf, ks);                                        

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

    private int getNumDBSuccesses(boolean conform, int level, String dbuuid, DataRow row, DataTableSpec outSpec,
            Connection conn) {
Severity
Category
Status
Source
Language