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

      try {
        double min = Double.parseDouble(v.min);
        double max = Double.parseDouble(v.max);
        LimitsConstraint lc = new LimitsConstraint(param.getId(), min, max);
        if (lc.getConstraint() != null) {
de.bund.bfr.knime.fsklab.deprecatednodes/src-1_0_2/de/bund/bfr/knime/fsklab/nodes/MetadataDocument.java on lines 216..225

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

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 (String param : miscParams) {
                Double paramValue = null;

                for (PmmXmlElementConvertable el : misc.getElementSet()) {
                    MiscXml element = (MiscXml) el;
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/modelestimation/SecondaryEstimationThread.java on lines 160..173

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

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

    public AgentsSetting getSetting() throws InvalidSettingsException {        
        AgentsSetting as;

        as = new AgentsSetting();
        

Method convertAssay has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static Assay convertAssay(JsonNode node) {

        Assay assay = new Assay();

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

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

    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case MetadataPackage.POPULATION_GROUP__POPULATION_NAME:
                return POPULATION_NAME_EDEFAULT == null ? populationName != null : !POPULATION_NAME_EDEFAULT.equals(populationName);

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

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

Method getInvalidIds has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private Map<String, String> getInvalidIds(List<String> selectedIDs)
            throws ConvertException {
        Map<String, String> invalid = new LinkedHashMap<>();
        Set<String> nonVariables = new LinkedHashSet<>();

Method getValueAt has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public Object getValueAt(int rowIndex, int columnIndex) {
            if (thePM == null) return null;
            if (rowIndex == 0) {
                DepXml dx = thePM.getDepXml();
                if (columnIndex < 2) return thePM.getDepVar();

Method getColumnClass has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        @Override
        public Class<?> getColumnClass(int columnIndex) {
            switch (columnIndex) {
            case 0:
                return String.class;

Method getWhere has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private String getWhere() {
        String result = " WHERE TRUE";

        if (agentID > 0) result += " AND \"Agens\" = " + agentID;
        if (agentString != null && !agentString.trim().isEmpty()) {

Method saveSettings has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void saveSettings(NodeSettingsWO settings) {
        settings.addString(CFG_SELECTEDID, selectedID);
        settings.addString(CFG_CURRENTPARAMX, currentParamX);
        settings.addString(CFG_SELECTEDVALUESX,
                XmlConverter.objectToXml(selectedValuesX));

Method readPrimaryTable has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void readPrimaryTable(BufferedDataTable table) {
        modelNames = new LinkedHashMap<>();
        parameters = new LinkedHashMap<>();
        minValues = new LinkedHashMap<>();
        maxValues = new LinkedHashMap<>();

Method copyKennzahlen has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void copyKennzahlen(final MyTable myT, final Integer oldID, final Integer newID, final Integer toRow) throws Exception {
        MyTable[] foreignFields = myT.getForeignFields();
        if (foreignFields != null) {
            for (int i=0; i<foreignFields.length; i++) {
                if (foreignFields[i] != null && foreignFields[i].getTablename().equals("DoubleKennzahlen")) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 1 hr to fix

Method isCellEditable has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public boolean isCellEditable(EventObject anEvent) {
      if (anEvent == null) { // null wird übergeben bei selectCell(row, column) in der Funktion setSelectedRowCol in MyDBTable
          return false;
      }
      else {

Method deleteRow has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    void deleteRow() {
        String tablename = this.getActualTable().getTablename();
        int selRow = this.getSelectedRow();
        if (!this.actualTable.isReadOnly() && this.getRowCount() > 0 && selRow >= 0 && selRow < this.getRowCount()) {
            int id = this.getSelectedID();
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 1 hr to fix

Method paintComponent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  @Override
  public void paintComponent( Graphics g ) {
      MyTable myT = myDBTable1.getActualTable();
          if (myDBTable1 != null && myT != null) {
              button1.setEnabled(!myT.isReadOnly());
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBPanel.java - About 1 hr to fix

Method myPasteFromClipboard has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      private void myPasteFromClipboard() { 
            int row = this.getTable().getSelectedRow(); 
            int column = this.getTable().getSelectedColumn();
            if (row >= 0 && row < this.getRowCount() && column >= 0 && column < this.getColumnCount()) {
                  String pasteString = ""; 
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 1 hr to fix

Method handleField has 29 lines of code (exceeds 25 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) {
        String result = "";
        if (id == null) {
            ;
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 1 hr to fix

Method backupNZip has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private String backupNZip(String filename) {
        String result = sendRequestGetErr("BACKUP DATABASE TO '" + filename + "' BLOCKING");

        byte[] buffer = new byte[1024];
        try {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/MyDBI.java - About 1 hr to fix

Method saveSettings has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public void saveSettings(final NodeSettingsWO settings) {
    settings.addString("originalModelScript", originalModelScript);
    settings.addString("originalParametersScript", originalParametersScript);
    settings.addString("originalVisualizationScript", originalVisualizationScript);
Severity
Category
Status
Source
Language