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

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
de.bund.bfr.knime.fsklab.nodes/src/de/bund/bfr/knime/fsklab/v2_0/editor/FSKEditorJSViewValue.java on lines 125..140

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

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

            else if(modelNode.get("version") != null) {
              GenericModel gm = new GenericModel();
              gm.setModelType("genericModel");
              gm.setGeneralInformation(SwaggerUtil.convert(MAPPER103.treeToValue(modelNode.get("generalInformation"), metadata.GeneralInformation.class)));
              gm.setScope(SwaggerUtil.convert(MAPPER103.treeToValue(modelNode.get("scope"), metadata.Scope.class)));
de.bund.bfr.knime.fsklab.deprecatednodes/src-1_7_2/de/bund/bfr/knime/fsklab/nodes/v1_7_2/reader/ReaderNodeModel.java on lines 532..543

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

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

            for (int i = 0; i < indepVars.length; i++) {
                final Variable variable = new Variable();
                variable.name = indepVars[i].trim();
                variable.unit = indepVarUnits[i].trim();
                variable.min = mins[i].trim();
de.bund.bfr.knime.fsklab.deprecatednodes/src-1_0_2/de/bund/bfr/knime/fsklab/nodes/creator/FskCreatorNodeModel.java on lines 285..294

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

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 boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
de.bund.bfr.knime.fsklab.deprecatednodes/src-1_9_0/de/bund/bfr/knime/fsklab/v1_9/editor/FSKEditorJSViewValue.java on lines 122..137

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

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 (set.getColumnMappings().get(column) instanceof MiscXml) {
                    MiscXml condition = (MiscXml) set.getColumnMappings().get(column);
                    List<String> allUnits = new ArrayList<>();

                    for (String cat : condition.categories) {
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/xlstimeseriesreader/XLSTimeSeriesReaderNodeDialog.java on lines 826..840

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

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

    static Product convertProduct(JsonNode node) {

        Product product = new Product();

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

Method convertReference has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static Reference convertReference(JsonNode node) {
        Reference reference = new Reference();

        reference.setIsReferenceDescription(
                node.has("isReferenceDescription") ? node.get("isReferenceDescription").asBoolean() : false);

Method retrieveReference has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static Reference retrieveReference(Row row, Map<String, Integer> columns) {

        // Check mandatory properties and throw exception if missing
        if (row.getCell(columns.get("referenceDescription")).getCellTypeEnum() != CellType.STRING) {
            throw new IllegalArgumentException("Missing Is reference description?");

Method loadSettings has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void loadSettings(NodeSettingsRO settings) {
        try {
            literature = XmlConverter.xmlToObject(
                    settings.getString(CFGKEY_LITERATURE),
                    new ArrayList<LiteratureItem>());

Method setMetaDataFromAnnotation has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  void setMetaDataFromAnnotation(final Annotation annotation) {
    Metadata metadata = new MetadataAnnotation(annotation).getMetadata();

    if (metadata.isSetGivenName())
      template.setCreator(metadata.getGivenName());

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

    @Override
    protected BufferedDataTable[] execute(final BufferedDataTable[] inData,
            final ExecutionContext exec) throws Exception {
        BufferedDataTable table = inData[0];
        DataTableSpec inSpec = table.getSpec();

Method setPM has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void setPM(ParametricModel pm) {
        if (pm != null) {
            if (pm.getLevel() == 2) {
                if (!radioButton2.isSelected()) {
                    radioButton2.setSelected(true);

Method createUnitFromDB has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static PMFUnitDefinition createUnitFromDB(String unit) throws XMLStreamException {
        if (!DBUnits.getDBUnits().containsKey(unit)) {
            return null;
        }

Method keyPressed has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public void keyPressed(final KeyEvent keyEvent) {
      //System.out.println(keyEvent.getKeyCode() + "\t" + keyEvent.getKeyChar() + "\t" + KeyEvent.VK_F + "\t" + keyEvent.isControlDown());
    if (keyEvent.isControlDown() && keyEvent.getKeyCode() == KeyEvent.VK_LEFT) { //Ctrl+<-, Aussredem geht auch F8
        keyEvent.consume();
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 1 hr to fix

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

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

Method createTable has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void createTable() {
        String fieldDefs = DBKernel.delimitL("ID") + " INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY";
        if (tableName.equals("ChangeLog")) {
            fieldDefs = DBKernel.delimitL("ID") + " INTEGER GENERATED BY DEFAULT AS SEQUENCE " + DBKernel.delimitL("ChangeLogSEQ") + " PRIMARY KEY";
        }
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/MyTable.java - About 1 hr to fix

Method doImportErlenbacherFW has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private int[] doImportErlenbacherFW(HSSFWorkbook wb, JProgressBar progress, String efsaID) {
        int numSuccess = 0;
        int numFails = 0;
        HSSFSheet businessSheet = wb.getSheet("Business_List");
        HSSFSheet transactionSheet = wb.getSheet("Receivers");

Method getSecModelById has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public KnimeTuple getSecModelById(int id) throws SQLException {
        KnimeTuple tuple = null;
        PreparedStatement stat = conn.prepareStatement(queryModelView + " WHERE \"" + ATT_LEVEL + "\"=2 AND \"Modellkatalog\".\"ID\"=?");
        try {
            stat.setInt(1, id);

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

    static metadata.Parameter retrieveParameter(String[][] values, int row) {

      // Check mandatory properties
      if (values[row][RakipColumn.L.ordinal()].isEmpty()) {
        throw new IllegalArgumentException("Missing parameter id");

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

    static metadata.Parameter retrieveParameter(String[][] values, int row) {

      // Check mandatory properties
      if (values[row][RakipColumn.L.ordinal()].isEmpty()) {
        throw new IllegalArgumentException("Missing parameter id");
Severity
Category
Status
Source
Language