SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

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

/*
 ***************************************************************************************************
 * Copyright (c) 2017 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
de.bund.bfr.knime.fsklab.deprecatednodes/src-1_9_0/de/bund/bfr/knime/fsklab/nodes/v1_9/WorkflowReaderNodeSettings.java on lines 1..50

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

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

/*
 ***************************************************************************************************
 * Copyright (c) 2017 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
de.bund.bfr.knime.fsklab.nodes/src/de/bund/bfr/knime/fsklab/nodes/WorkflowReaderNodeSettings.java on lines 1..50

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

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 retrievePopulationGroup has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static PopulationGroup retrievePopulationGroup(Row row, Map<String, Integer> columns) {

        // Check mandatory properties
        Cell nameCell = row.getCell(columns.get("name"));
        if (nameCell.getCellTypeEnum() != CellType.STRING) {

Method createMainComponent has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private JComponent createMainComponent() {
        if (set.isStandardVisibleColumns()) {
            set.setVisibleColumns(reader.getStandardVisibleColumns());
        }

Method flush16le has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void flush16le() throws UnsupportedEncodingException, FileNotFoundException, IOException, PmmException {
        StringBuffer buf = new StringBuffer();
        for (PmmTimeSeries candidate : buffer) {
            String organism = "";
            String matrix = "";

Method actionPerformed has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == computeButton) {
            UnitDefinition unit = new UnitDefinition(idField.getText().trim(),
                    LEVEL, VERSION);

Method parse has 55 lines of code (exceeds 25 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";

Method initComponents has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        ResourceBundle bundle = ResourceBundle.getBundle("org.hsh.bfr.db.gui.PanelProps");
        dialogPane = new JPanel();
        contentPanel = new JPanel();
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/SelectionDialog.java - About 2 hrs to fix

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

  @Override
  protected PortObject[] execute(PortObject[] inObjects, ExecutionContext exec) throws Exception {
    exec.setMessage("Creating virtual workflow");
    // Get current node context and workflow
    NodeContext nodeContext = NodeContext.getContext();

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

  @Override
  protected PortObject[] execute(PortObject[] inObjects, ExecutionContext exec) throws Exception {
    exec.setMessage("Creating virtual workflow");
    // Get current node context and workflow
    NodeContext nodeContext = NodeContext.getContext();

Function wellKnownWords has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var wellKnownWords = (function() {
    var wkw = {};
    function setType(t) {
      return function () {
        for (var i = 0; i < arguments.length; i++)
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haskell/haskell.js - About 2 hrs to fix

Function tokenBase has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function tokenBase(stream, state) {
    var ch;

    // get next character
    ch = stream.next();

Function tokenBase has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function tokenBase(stream, state) {
    // Handle Comments
    //var ch = stream.peek();

    var parent = state.returnStack[state.returnStack.length - 1];

Function makeChangeFromHistory has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function makeChangeFromHistory(doc, type, allowSelectionOnly) {
    var suppress = doc.cm && doc.cm.state.suppressEdits;
    if (suppress && !allowSelectionOnly) { return }

    var hist = doc.history, event, selAfter = doc.sel;
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/lib/codemirror.js - About 2 hrs to fix

Function append has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        append: function () {
            var container_html = '<span class="irs irs--' + this.options.skin + ' js-irs-' + this.plugin_count + ' ' + this.options.extra_classes + '"></span>';
            this.$cache.input.before(container_html);
            this.$cache.input.prop("readonly", true);
            this.$cache.cont = this.$cache.input.prev();
Severity: Major
Found in de.bund.bfr.knime.js/src/js/lib/ion.rangeSlider.js - About 2 hrs to fix

Function setValue has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        setValue: function(value) {
            if(!value) {
                return;
            }
            

Function submit has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        submit: function(e) {
            e.stopPropagation();
            e.preventDefault();
            
            //get new value from input

Function _setOption has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _setOption: function( key, value ) {
        var i,
            valsLength = 0;

        if ( key === "range" && this.options.range === true ) {

Function makeChangeFromHistory has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function makeChangeFromHistory(doc, type, allowSelectionOnly) {
  var suppress = doc.cm && doc.cm.state.suppressEdits
  if (suppress && !allowSelectionOnly) { return }

  var hist = doc.history, event, selAfter = doc.sel

Function create_body2 has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function create_body2() {
        let body = `
    <div class="container">
      
      <form class="form-horizontal">
Severity
Category
Status
Source
Language