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

            if (!portObject.libs.isEmpty()) {
                out.putNextEntry(new ZipEntry("library.list"));
                List<String> libNames = portObject.libs.stream().map(f -> f.getName().split("\\_")[0])
                        .collect(Collectors.toList());
                IOUtils.writeLines(libNames, "\n", out, "UTF-8");
de.bund.bfr.knime.fsklab.deprecatednodes/src-prerakip/de/bund/bfr/knime/fsklab/nodes/port/FskPortObject.java on lines 179..185

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

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 (dbTable == null) {
                f.setSize(DBKernel.mainFrame.getRightSize());
            } else {
                Dimension dim = dbTable.getSize();
                try {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java and 1 other location - About 1 hr to fix
org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java on lines 165..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 78.

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 (result.getObject(Bfrdb.ATT_TEMPERATURE) != null) {
                    double dbl = result.getDouble(Bfrdb.ATT_TEMPERATURE);
                    MiscXml mx = new MiscXml(AttributeUtilities.ATT_TEMPERATURE_ID,AttributeUtilities.ATT_TEMPERATURE,AttributeUtilities.ATT_TEMPERATURE,dbl,Arrays.asList(Categories.getTempCategory().getName()),Categories.getTempCategory().getStandardUnit(), dbuuid);//"°C"); // Categories.getTempCategory().getStandardUnit()
                    miscDoc.add(mx);
                }
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/timeseriesreader/TimeSeriesReaderNodeModel.java on lines 188..193

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

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

package de.bund.bfr.knime.fsklab.v1_9;

import java.io.Serializable;
import java.util.LinkedHashMap;

de.bund.bfr.knime.fsklab.deprecatednodes/src-1_7_2/de/bund/bfr/knime/fsklab/FskSimulation.java on lines 1..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 78.

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

  public void loadSettings(final NodeSettingsRO settings) throws InvalidSettingsException {

    m_selectedSimulationIndex = settings.getInt(SIMULATION_INDEX);
    m_modelMath = settings.getString(CFG_MODEL_MATH);

de.bund.bfr.knime.fsklab.nodes/src/de/bund/bfr/knime/fsklab/v2_0/simulator/JSSimulatorViewValue.java on lines 75..88

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

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

  @Override
  public void loadFromNodeSettings(NodeSettingsRO settings) throws InvalidSettingsException {
    selectedSimulationIndex = settings.getInt(CFG_SIMULATION_INDEX);
    modelMath = settings.getString(CFG_MODEL_MATH);
de.bund.bfr.knime.fsklab.nodes/src/de/bund/bfr/knime/fsklab/v2_0/simulator/JSSimulatorConfig.java on lines 71..84

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

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 write has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
            boolean splitModels, String notes, ExecutionContext exec, ModelType modelType) throws Exception {

Method openNewWindow has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public Object openNewWindow(final MyTable theNewTable, final Object value, final Object headerValue, final MyDBTable dbTable, final Integer row, final Integer col, final Object[][] conditions, boolean fromMMC, Filter mf) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java - About 1 hr to fix

Method defineTable4NewDBTable has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private boolean defineTable4NewDBTable(MyTable myT, MyDBTable dbTable, final Object value, final Object headerValue, final MyTable theNewTable, MyDBTable newDBTable, final Integer row, final Integer col, final Object[][] conditions) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java - About 1 hr to fix

Method handleField has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private static String handleField(final Object id, final MyTable[] foreignFields, final String[] mnTable, final int i, final boolean goDeeper, final String startDelim,
            final String delimiter, final String endDelim, HashSet<MyTable> alreadyUsed) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 1 hr to fix

Method handleField has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private String handleField(final Object id, final MyTable[] foreignFields, final String[] mnTable, final int i, final boolean goDeeper, final String startDelim,
            final String delimiter, final String endDelim, HashSet<MyTable> alreadyUsed) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/MyDBI.java - About 1 hr to fix

Method addParam has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public void addParam(final String paramName, final Boolean isStartParam, final Double value, final Double error,
            final Double min, final Double max, String category, String unit, String description) {

Method convertStringLists2TSXmlDoc has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static PmmXmlDoc convertStringLists2TSXmlDoc(Array t, Array tu, Array l, Array lu, Array lot, Array stddevs, Array wdhs, String modelUnit, String timeUnit) {

Function createAtomic has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function createAtomic(x, y, width, height, modelName, inputs, outputs, modelIndex,simulations) {

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

    public OtherModelDataBackground retrieveBackground(Sheet sheet) {

        OtherModelDataBackground background = new OtherModelDataBackground();

        try {

Method deserialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        @Override
        public GenericModelModelMath deserialize(JsonParser parser, DeserializationContext context)
                throws IOException, JsonProcessingException {

            JsonNode node = parser.readValueAsTree();

Method convertModel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Model convertModel(JsonNode originalMetadata, ModelClass targetClass) throws JsonProcessingException {

        String originalClass = originalMetadata.get("modelType").textValue();
        Map<String, Object> originalModelClass = ModelClass.valueOf(originalClass).swaggerDefinition;
        Map<String, Object> targetModelClass = targetClass.swaggerDefinition;

Method deserialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        @Override
        public GenericModelScope deserialize(JsonParser parser, DeserializationContext context)
                throws IOException, JsonProcessingException {

            JsonNode node = parser.readValueAsTree();

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

    public PredictiveModelDataBackground retrieveBackground(Sheet sheet) {
        PredictiveModelDataBackground background = new PredictiveModelDataBackground();
        try {
            Study study = retrieveStudy(sheet);
            background.setStudy(study);

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

    public void loadSettings( final Config config ) throws InvalidSettingsException {        
        int i;
        Config c;
        
        processName = config.getString(PARAM_PROCESSNAME);
Severity
Category
Status
Source
Language