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

package de.bund.bfr.knime.fsklab.nodes.environment;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
de.bund.bfr.knime.fsklab.deprecatednodes/src-1_9_0/de/bund/bfr/knime/fsklab/nodes/environment/DefaultEnvironmentManager.java on lines 1..53

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

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

  public static ScriptHandler createHandler(String script_type, List<String> packages) throws Exception {
    
    final ScriptHandler handler;
    
    if (script_type == null) {
de.bund.bfr.knime.fsklab.deprecatednodes/src-1_9_0/de/bund/bfr/knime/fsklab/nodes/v1_9/ScriptHandler.java on lines 158..177

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

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

    @Test
    public void testConstructors() {
        final Indep indep = new Indep();
        assertThat(indep.name, is(nullValue()));
        assertThat(indep.origname, is(nullValue()));
de.bund.bfr.knime.pmm.nodes.tests/src/de/bund/bfr/knime/pmm/js/common/DepTest.java on lines 28..38

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

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

    @Test
    public void testConstructor() {
        final Dep dep = new Dep();
        assertThat(dep.name, is(nullValue()));
        assertThat(dep.origname, is(nullValue()));
de.bund.bfr.knime.pmm.nodes.tests/src/de/bund/bfr/knime/pmm/js/common/IndepTest.java on lines 28..38

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

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

    public GenericModelDataBackground retrieveBackground(Sheet sheet) {

        GenericModelDataBackground background = new GenericModelDataBackground();

        try {

Method retrieveBackground has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public GenericModelDataBackground retrieveBackground(Sheet sheet) {

        GenericModelDataBackground background = new GenericModelDataBackground();

        try {

Method joinModels has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Model joinModels(JsonNode modelA, JsonNode modelB, ModelClass targetModelType) throws JsonProcessingException {

        String modelAType = modelA.get("modelType").textValue();
        Map<String, Object> modelAClass = ModelClass.valueOf(modelAType).swaggerDefinition;

Method retrieveBackground has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public GenericModelDataBackground retrieveBackground(Sheet sheet) {

        final GenericModelDataBackground background = new GenericModelDataBackground();

        try {

Method retrieveBackground has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public GenericModelDataBackground retrieveBackground(Sheet sheet) {
        final GenericModelDataBackground background = new GenericModelDataBackground();

        try {
            final Study study = retrieveStudy(sheet);

Method retrieveBackground has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public GenericModelDataBackground retrieveBackground(Sheet sheet) {

        GenericModelDataBackground background = new GenericModelDataBackground();

        try {

Method retrieveBackground has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public GenericModelDataBackground retrieveBackground(Sheet sheet) {

        final GenericModelDataBackground background = new GenericModelDataBackground();

        try {

Method retrieveBackground has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public GenericModelDataBackground retrieveBackground(Sheet sheet) {
        GenericModelDataBackground background = new GenericModelDataBackground();

        try {
            Study study = retrieveStudy(sheet);

Method eIsSet has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case MetadataPackage.STUDY__STUDY_IDENTIFIER:
                return STUDY_IDENTIFIER_EDEFAULT == null ? studyIdentifier != null : !STUDY_IDENTIFIER_EDEFAULT.equals(studyIdentifier);

Method eGet has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case MetadataPackage.STUDY__STUDY_IDENTIFIER:
                return getStudyIdentifier();

Method saveSettingsTo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    protected void saveSettingsTo(NodeSettingsWO settings)
            throws InvalidSettingsException {
        if (!selectionPanel.getSelectedIDs().isEmpty()) {
            set.setSelectedID(selectionPanel.getSelectedIDs().get(0));

Method getInSchema has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private KnimeSchema getInSchema(final DataTableSpec inSpec) throws InvalidSettingsException {
        KnimeSchema result = null;
        KnimeSchema inSchema = new TimeSeriesSchema();
        boolean hasTS = false;
        try {

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

  protected BufferedDataTable[] execute(final BufferedDataTable[] inData,
      final ExecutionContext exec) {

    BufferedDataContainer container = exec.createDataContainer(TABLE_SPEC);

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

    @Override
    protected void loadSettingsFrom(NodeSettingsRO settings, DataTableSpec[] specs) throws NotConfigurableException {
        String fileName;
        int useStartValue;
        double startElim;

Method replaceCelsiusAndFahrenheit has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        private static void replaceCelsiusAndFahrenheit(KnimeTuple tuple) {
            final String CELSIUS = "°C";
            final String FAHRENHEIT = "°F";
            final String KELVIN = "K";

Method saveSettingsTo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    protected void saveSettingsTo( final NodeSettingsWO settings ) {
        try {            
            /*
              Config c = settings.addConfig("DbConfigurationUi");
Severity
Category
Status
Source
Language