SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

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

                        for (PmmXmlElementConvertable el : catModel.getElementSet()) {
                            if (el instanceof CatalogModelXml) {
                                cmx = (CatalogModelXml) el;
                                break;
                            }

Avoid deeply nested control flow statements.
Open

                            if (!oneStepFitTs.containsKey(m1EstID)) oneStepFitTs.put(m1EstID, new HashSet<Integer>());

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

    private void doLit(LiteratureItem oldLi, Boolean isEM) {
        MyTable lit = DBKernel.myDBi.getTable("Literatur");
        Integer litID = (oldLi != null && (dbuuid != null && dbuuid.equals(oldLi.dbuuid))) ? oldLi.id : null;
        Integer newVal = (Integer) DBKernel.mainFrame.openNewWindow(lit, litID, (Object) "Literatur", null, 1, 1, null, true, null, this);
        if (newVal != null && newVal instanceof Integer) {

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 (alreadyInsertedGModel.containsKey(gmSchemaID)) {
                            newGlobalModelId = alreadyInsertedGModel.get(gmSchemaID);
                        } else {
                            foreignDbIds = checkID(conn, true, dbuuid, row, gmSchemaID, null, foreignDbIds, row.getString(Model2Schema.ATT_DBUUID));
                            newGlobalModelId = db.insertGm(row.getInt(Model2Schema.ATT_GLOBAL_MODEL_ID));

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

    private void checkSec(HashMap<ParametricModel, HashMap<String, ParametricModel>> m_secondaryModels, ParametricModel pm) {
        boolean idFound = false;
        for (HashMap<String, ParametricModel> sm : m_secondaryModels.values()) {
            for (String dep : sm.keySet()) {
                ParametricModel pms = sm.get(dep);

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 (mOut.estModelId == mIn.estModelId) {
                                Diff diff = javers.compare(mIn, mOut);
                                if (diff.getChanges().size() > 0) {
                                    System.out.println(mOut.estModelId + "\n" + diff);
                                    for (ValueChange c : diff.getChangesByType(ValueChange.class)) {

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

        public Class<?> getColumnClass(int columnIndex) {
            if (columnIndex == 0) return Object.class;
            else if (columnIndex == 1) return Object.class;
            else if (columnIndex == 2) return Boolean.class;
            else if (columnIndex == 3) return Double.class;

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 (o != null) setValue(pm, property, o[0], o[1]);

Avoid deeply nested control flow statements.
Open

                        if (!globalModels.containsKey(newGlobalModelId)) globalModels.put(newGlobalModelId, new HashSet<Integer>());

Avoid deeply nested control flow statements.
Open

                        if (e.isShiftDown()) {
                            pm.setDepCategory(null);
                            pm.setDepUnit(null);
                            return;
                        }

Avoid deeply nested control flow statements.
Open

                        if (!pm_.equals(pmAll) && pmAll.estModelId == pm_.estModelId) {
                            System.err.println("WEW");
                        }

Avoid deeply nested control flow statements.
Open

                        for (String param : miscParams) {
                            miscs.get(param).remove(i);
                        }

Avoid deeply nested control flow statements.
Open

                        if (el instanceof EstModelXml) {
                            emx = (EstModelXml) el;
                            break;
                        }

Avoid deeply nested control flow statements.
Open

                        if (psmt.executeUpdate() > 0) {
                            result = DBKernel.getLastInsertedID(psmt);
                            File zipFile = new File(zipfile);
                            DBKernel.insertBLOB("PMMLabWorkflows", "Workflow", zipFile, result);
                        }

Avoid deeply nested control flow statements.
Open

                        if ((min != null && value < min)
                                || (max != null && value > max)) {
                            setWarningMessage(entry.getKey() + " = " + value
                                    + " is not in range " + min + " -> " + max);
                        }

Avoid deeply nested control flow statements.
Open

                        if (!hasArguments) {
                            plotable.getFunctionArguments().put(
                                    miscParams.get(i),
                                    new ArrayList<>(Arrays.asList(0.0)));
                        }

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 (!secModels.containsKey(spm.estModelId)) secModels.put(spm.estModelId, new ArrayList<Integer>());
Severity
Category
Status
Source
Language