SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Method getTableCellRendererComponent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

        @Override
        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus, int row,
                int column) {
            int statusColumn = -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

Method getMiscUnits has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static Map<String, String> getMiscUnits(List<KnimeTuple> tuples) {
        Map<String, Map<String, Integer>> occurences = new LinkedHashMap<>();
        Map<String, String> map = new LinkedHashMap<>();

        for (KnimeTuple tuple : tuples) {

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

    private Category createCategory(Map<Integer, UnitsFromDB> units, String categoryName) {
        DJep parser = MathUtilities.createParser();
        Map<String, Node> fromFormulas = new LinkedHashMap<>();
        Map<String, Node> toFormulas = new LinkedHashMap<>();
        Map<String, String> fromFormulaStrings = 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

Method getColor has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private Color getColor(String param, Color lastBG, String lastParam) {
        Color bg = Color.WHITE;
        @SuppressWarnings("unused")
        Color fg = Color.BLACK;
        if (JCheckboxWithObject.isTemperature(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

Method release has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

        public synchronized void release() throws RException {
            if (!m_available) {
                // Either m_pendingDestructionTask is null, which means
                // this resource is being held, or the resource is available
                // and has destruction pending.

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

Function createForm has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

var createForm = (prop, value, port) =>   {
    let isMandatory = prop.required ? prop.required : false;

    if (prop.type === "text" || prop.type === "number" || prop.type === "url" ||
        prop.type === "date" || prop.type === "email"  || prop.type === "year_date")
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.utils.js - 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

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

  @Override
  public JSSimulatorViewValue getViewValue() {
    JSSimulatorViewValue val;
    synchronized (getLock()) {
      val = super.getViewValue();
de.bund.bfr.knime.fsklab.deprecatednodes/src-1_7_2/de/bund/bfr/knime/fsklab/nodes/v1_7_2/simulator/JSSimulatorNodeModel.java on lines 113..133

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 135.

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

  @Override
  public JSSimulatorViewValue getViewValue() {
    JSSimulatorViewValue val;
    synchronized (getLock()) {
      val = super.getViewValue();
de.bund.bfr.knime.fsklab.deprecatednodes/src-1_9_0/de/bund/bfr/knime/fsklab/v1_9/simulator/JSSimulatorNodeModel.java on lines 101..121

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 135.

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

     private int[] getAllFilter(TableModel tm, Vector<Integer> vv) {
         if (vv == null) {
             int numRows = tm.getRowCount();
             int arr[] = new int[numRows];
             for (int row = 0; row < numRows; row++) {
org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/editoren/MyStringFilter.java on lines 75..91

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 135.

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

     private int[] getAllFilter(TableModel tm, Vector<Integer> vv) {
         if (vv == null) {
             int numRows = tm.getRowCount();
             int arr[] = new int[numRows];
             for (int row = 0; row < numRows; row++) {
org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/editoren/MyFilter.java on lines 158..174

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 135.

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

Method convertParameter has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static Parameter convertParameter(JsonNode node) {

        Parameter parameter = new Parameter();

        if (node.has("parameterID")) {

Method eSet has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case MetadataPackage.POPULATION_GROUP__POPULATION_NAME:

Method loadSettingsFrom has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs)
            throws NotConfigurableException {
        set = new SettingsHelper();
        set.loadSettings(settings);

Method checkForeignWindow2Open has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private void checkForeignWindow2Open(final int row, final int col) {
    MyTable[] myTs = actualTable.getForeignFields();
    //System.out.println(lastClickedRow + "\t" + lastClickedCol + "\t" + myTs.length);
    if (col > 0 && col <= myTs.length && myTs[col-1] != null &&
            !myTs[col-1].getTablename().equals("DoubleKennzahlen")) { 
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 2 hrs to fix

Method dbBackup has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static void dbBackup(final JFrame frame, final File backupFile, final boolean silent) {
        if (backupFile != null && backupFile.getParentFile().exists() && DBKernel.DBFilesDa(DBKernel.HSHDB_PATH, DBKernel.dbKennung)) {
            try {
                if (backupFile.exists()) {
                    backupFile.delete();
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/Backup.java - About 2 hrs to fix

Method execute has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  @Override
  protected PortObject[] execute(final PortObject[] inData, final ExecutionContext exec)
      throws Exception {
    try {
      FskPortObject portObj = new FskPortObject();

Method getPoints has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public double[][] getPoints(String paramX, String paramY, String unitX,
            String unitY, String transformX, String transformY,
            Map<String, Integer> choice) throws ConvertException {
        List<Double> xList = valueLists.get(paramX);
        List<Double> yList = valueLists.get(paramY);

Method createPcData has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void createPcData(PCMLDocument pcmlDoc, final PortObject[] inObjects) {
        PCML pcml = pcmlDoc.getPCML();
        ProcessChain pChain = pcml.addNewProcessChain();

        // Fetches model metadata from the 1st table (metadata table)

Function formatStringFactory has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function formatStringFactory(delimiter, tokenOuter) {
      while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
        delimiter = delimiter.substr(1);

      var singleline = delimiter.length == 1;
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/python/python.js - About 2 hrs to fix

Function Display has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function Display(place, doc, input, options) {
    var d = this;
    this.input = input;

    // Covers bottom-right square when both scrollbars are present.
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/lib/codemirror.js - About 2 hrs to fix
Severity
Category
Status
Source
Language