SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Avoid deeply nested control flow statements.
Open

                        if (!globalIds.containsKey(id)) {
                            globalIds.put(id,
                                    MathUtilities.getRandomNegativeInt());
                        }

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

    @Override
    protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
        /*
         * filename = settings.getString( PARAM_FILENAME ); login =
         * settings.getString( PARAM_LOGIN ); passwd = settings.getString(

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 (agentID != id) return false;

Avoid deeply nested control flow statements.
Open

                        if (indep.unit != null) {
                            units.put(indep.name, indep.unit);
                        }

Avoid deeply nested control flow statements.
Open

                        if (misc.unit != null && !misc.unit.equals(unit)) {
                            Category cat = Categories.getCategoryByUnit(misc.unit);
                            
                            try {
                                misc.value = cat.convert(misc.value, misc.unit, unit);                            

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

        private static OneStepTertiaryModel parse(List<List<KnimeTuple>> tupleList, boolean isPMFX, String mdName,
                int mdNum, Metadata metadata, String notes) {

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

        private static ManualTertiaryModel parse(List<KnimeTuple> tupleList, boolean isPMFX, String mdName,
                int modelNum, Metadata metadata, String notes) {

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

    private List<String> getPrimParamsFromCategory(String category) {
        List<String> params = new ArrayList<>();

        for (String param : primaryParameterCategories.keySet()) {
            String paramCat = primaryParameterCategories.get(param);

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 (!m1s.containsKey(m1EstID)) {
                                if (mlist.containsKey(m1EstID)) m1s.put(m1EstID, mlist.get(m1EstID));
                                else m1s.put(m1EstID, pm1);                                
                            }

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

    @Override
    public JComponent createPanel(String assignments) {
        JPanel panel = new JPanel();
        JPanel topPanel = new JPanel();

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 (set.getSelectedValuesX().get(param).get(i)) {
                            usedValues.add(valuesList.get(i));
                        }

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

                        if (literatureID != id) return false;

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

    private KnimeSchema getInSchema(final DataTableSpec inSpec) throws InvalidSettingsException {
        KnimeSchema result = null;
        String errorMsg = "Unexpected format - Model definitions are not present in the columns of the incoming table";
        KnimeSchema inSchema = new Model1Schema();
        try {

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 (id != modelID) {
                            continue;
                        }

Avoid deeply nested control flow statements.
Open

                            if (level == 2 || checkPrimaryDeletion(conn, emx.id))
                                numDBSuccesses += deleteFMID(conn, level, emx.id);

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

        private static OneStepSecondaryModel parse(List<KnimeTuple> tuples, boolean isPMFX, String mdName, int modelNum,
                Metadata metadata, String notes) {

Avoid deeply nested control flow statements.
Open

                        if (pname != null) {
                            formula = MathUtilities.replaceVariable(formula, dep, pname.toString());
                            cmx.formula = formula;
                            dx.name = pname.toString();
                        }

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

        private static OneStepTertiaryModel parse(List<List<KnimeTuple>> tupleList, boolean isPMFX, String mdName,
                int mdNum, Metadata metadata, String notes) {

            final String modelExtension = isPMFX ? "pmf" : "sbml";

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 (matrixID != id) return false;
Severity
Category
Status
Source
Language