SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Method createChart has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private void createChart() {
        String id = null;

        if (configPanel.isDisplayFocusedRow()) {
            id = selectionPanel.getFocusedID();

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 loadSettings has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public void loadSettings(NodeSettingsRO settings) {
        try {
            selectedIDs = XmlConverter.xmlToObject(
                    settings.getString(CFG_SELECTEDIDS),
                    new ArrayList<String>());

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 combase2XML has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private PmmXmlDoc combase2XML(String misc) {
        PmmXmlDoc result = null;
        if (misc != null) {
            result = new PmmXmlDoc();
            List<String> conds = condSplit(misc);

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 getForeignVal has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private String getForeignVal(final String tablename, final int id, final String fields) {
        String result = "";
        String sql= "SELECT " + fields + " FROM " + DBKernel.delimitL(tablename) + " WHERE " + DBKernel.delimitL("ID") + "=" + id;
        ResultSet rs = DBKernel.getResultSet(sql, false);
        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

Method showAndFilterVals has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean showAndFilterVals(String tablename, LinkedHashMap<String[], LinkedHashSet<String[]>> vals, int idColumn,
            int lfd, int total) {
        int i=0;
        Integer lastShownID = -1;
        for (String[] p : vals.keySet()) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java - About 2 hrs to fix

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 saveValue has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private void saveValue(final PreparedStatement ps, final int index, final String tfText, final JTextField tf_exp, final JCheckBox cb, final boolean isString) {
        try {
            boolean hasExponent = (tf_exp != null);
            if (tfText.trim().length() > 0) {
                if (isString) {

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 getDouble has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private Double getDouble(String val) {
        Double result = null;
        try {
            if (val.indexOf("d") < 0  && val.indexOf("D") < 0) result = Double.parseDouble(val.trim());
            else Double.parseDouble("wsd");

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 manageBoolean has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private Boolean manageBoolean(PreparedStatement ps, PreparedStatement psUpdate, int lfdCol, HSSFCell cell) throws SQLException {
        Boolean result = null;
        if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) {
            if (ps != null) ps.setNull(lfdCol, java.sql.Types.BOOLEAN);
            if (psUpdate != null) psUpdate.setNull(lfdCol, java.sql.Types.BOOLEAN);
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 2 hrs to fix

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 cleanReihenfolgeListe has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

        private void cleanReihenfolgeListe(Vector<Integer> indexReihenfolge, LinkedHashMap<Integer, Integer> index_processID, Vector<Integer[]> org_dst) {
            for (int ii=0;ii<indexReihenfolge.size();ii++) {
                Integer key = indexReihenfolge.get(ii);
                Integer carverID = index_processID.get(key);
                //System.out.println(key + "\t" + carverID + "\t" + isBlacklisted(carverID));

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 checkPlausibleDBL has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unused")
    private static String checkPlausibleDBL(Object kzID, String tname, String spaltenname, Integer tableID) {
        String ergebnis = null;        
        if (kzID != null) {
            String msg = GuiMessages.getString("Wenn die Anzahl der Wiederholungen = 1 ist, dann sollte ein Einzelwert eingetragen werden! Anzahl Wiederholungen < 1 machen keinen Sinn!");
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/PlausibilityChecker.java - About 2 hrs to fix

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 handleField has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private String handleField(final Object id, final MyTable[] foreignFields, final String[] mnTable, final int i, final boolean goDeeper, final String startDelim,
            final String delimiter, final String endDelim, HashSet<MyTable> alreadyUsed) {
        String result = "";
        if (id == null) {
            ;
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/MyDBI.java - About 2 hrs to fix

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 saveSettingsTo has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  protected void saveSettingsTo(NodeSettingsWO settings) {

    File directory =
        NodeContext.getContext().getWorkflowManager().getContext().getCurrentLocation();

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 performExecute has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  protected PortObject[] performExecute(PortObject[] inObjects, ExecutionContext exec)
      throws Exception {

    MAPPER.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);

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 runSnippet has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  public final void runSnippet(final FskPortObject fskObj, final FskSimulation simulation,
      final ExecutionContext exec, NodeLogger logger, File imageFile,
      List<JoinRelationAdvanced> joinRelationList, String suffix) throws Exception {

    // Sets up working directory with resource files. This directory needs to be deleted.

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    private boolean checkPrimaryDeletion(Connection conn, Integer estID) {
        boolean result = true;
        if (estID == null)
            return false;
        String sql = "SELECT " + DBKernel.delimitL("GeschaetztesSekundaermodell") + " FROM "
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/dbdelete/DatabaseDeleteNodeModel.java on lines 170..191

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 185.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    private boolean checkTimeSeriesDeletion(Connection conn, Integer tsID) {
        boolean result = true;
        if (tsID == null)
            return false;
        String sql = "SELECT " + DBKernel.delimitL("ID") + " FROM " + DBKernel.delimitL("GeschaetzteModelle")
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/dbdelete/DatabaseDeleteNodeModel.java on lines 193..215

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 185.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File MMC_TS.java has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*******************************************************************************
 * Copyright (c) 2015 Federal Institute for Risk Assessment (BfR), Germany
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

File coffeescript.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE

/**
 * Link to the project's GitHub page:

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        if (indepDoc != null) {
            final Indep[] indepArray = new Indep[indepDoc.size()];
            for (int i = 0; i < indepDoc.size(); i++) {
                final IndepXml indepXml = (IndepXml) indepDoc.get(i);
                final Indep indep = new Indep();
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/editor/ModelEditorNodeModel.java on lines 474..491

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 184.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        if (indepSecDoc != null) {
            final Indep[] indepSecArray = new Indep[indepSecDoc.size()];
            for (int i = 0; i < indepSecDoc.size(); i++) {
                final IndepXml indepSecXml = (IndepXml) indepSecDoc.get(i);
                final Indep indepSec = new Indep();
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/editor/ModelEditorNodeModel.java on lines 455..471

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 184.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language