SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

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

                    if (rs.getObject("Lieferdatum") != null) {
                        cal.setTimeInMillis(rs.getTimestamp("Lieferdatum").getTime());
                        sql = "UPDATE " + DBKernel.delimitL("Lieferungen") + " SET " + DBKernel.delimitL("dd_day") + "="
                                + (cal.get(Calendar.HOUR_OF_DAY) == 12 ? "NULL" : cal.get(Calendar.DAY_OF_MONTH)) + "," + DBKernel.delimitL("dd_month") + "="
                                + (cal.get(Calendar.HOUR_OF_DAY) == 12 && cal.get(Calendar.MONTH) == 0 ? "NULL" : cal.get(Calendar.MONTH) + 1) + "," + DBKernel.delimitL("dd_year")
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/UpdateChecker.java and 2 other locations - About 3 hrs to fix
org.hsh.bfr.db/src/org/hsh/bfr/db/UpdateChecker.java on lines 368..375
org.hsh.bfr.db/src/org/hsh/bfr/db/UpdateChecker.java on lines 376..383

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

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 3 locations. Consider refactoring.
Open

                    if (rs.getObject("Herstellungsdatum") != null) {
                        cal.setTimeInMillis(rs.getTimestamp("Herstellungsdatum").getTime());
                        sql = "UPDATE " + DBKernel.delimitL("Chargen") + " SET " + DBKernel.delimitL("pd_day") + "="
                                + (cal.get(Calendar.HOUR_OF_DAY) == 12 ? "NULL" : cal.get(Calendar.DAY_OF_MONTH)) + "," + DBKernel.delimitL("pd_month") + "="
                                + (cal.get(Calendar.HOUR_OF_DAY) == 12 && cal.get(Calendar.MONTH) == 0 ? "NULL" : cal.get(Calendar.MONTH) + 1) + "," + DBKernel.delimitL("pd_year")
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/UpdateChecker.java and 2 other locations - About 3 hrs to fix
org.hsh.bfr.db/src/org/hsh/bfr/db/UpdateChecker.java on lines 368..375
org.hsh.bfr.db/src/org/hsh/bfr/db/UpdateChecker.java on lines 391..398

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

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

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(K).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(K).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

Method retrieveParameter has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(K).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");

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

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        agentLabel = new JLabel();
        agentField = new StringTextField(true);
        button1 = new JButton();

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

    function tokenBase(stream, state) {
      firstWordMatch = stream.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/);
      state.context.line.firstWord = firstWordMatch ? firstWordMatch[0].replace(/^\s*/, "") : "";
      state.context.line.indent = stream.indentation();
      ch = stream.peek();
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/stylus/stylus.js - About 3 hrs to fix

Function keydown has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        keydown: function(e){
            if (this.picker.is(':not(:visible)')){
                if (e.keyCode == 27) // allow escape to hide and re-show picker
                    this.show();
                return;

Function updateParameterSliders has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function updateParameterSliders()
    {
        var sliderWrapper = document.getElementById("sliderWrapper");
        var sliderIds = []; // ids of all sliders that correspond to a constant from the used models
        

Function 36 has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],36:[function(require,module,exports){
'use strict';
module.exports = function generate_uniqueItems(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;

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

    private HashMap<String, HashMap<String, HashMap<Integer, Integer>>> checkIDs(Connection conn, boolean before, String dbuuid, KnimeTuple row, KnimeTuple ts,
            HashMap<String, HashMap<String, HashMap<Integer, Integer>>> foreignDbIds, String[] schemaAttr, String[] dbTablename, String rowuuid, boolean checkAnywayDueToNegativeId)
            throws PmmException {
        if (checkAnywayDueToNegativeId || rowuuid == null || !rowuuid.equals(dbuuid)) {
            if (!foreignDbIds.containsKey(rowuuid)) foreignDbIds.put(rowuuid, new HashMap<String, HashMap<Integer, Integer>>());
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/timeserieswriter/TimeSeriesWriterNodeModel.java on lines 154..171

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

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 HashMap<String, HashMap<String, HashMap<Integer, Integer>>> checkIDs(Connection conn, boolean before, String dbuuid, KnimeTuple row, KnimeTuple ts,
            HashMap<String, HashMap<String, HashMap<Integer, Integer>>> foreignDbIds,
            String[] schemaAttr, String[] dbTablename, String rowuuid, boolean checkAnywayDueToNegativeId) throws PmmException {
        if (checkAnywayDueToNegativeId || rowuuid == null || !rowuuid.equals(dbuuid)) {
            if (!foreignDbIds.containsKey(rowuuid)) foreignDbIds.put(rowuuid, new HashMap<String, HashMap<Integer, Integer>>());
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/estimatedmodelwriter/EstimatedModelWriterNodeModel.java on lines 536..553

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

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