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

    @Override
    public String toString() {
        if (eIsProxy()) return super.toString();

        StringBuffer result = new StringBuffer(super.toString());
de.bund.bfr.knime.fsklab.metadata.model/gen/metadata/impl/ExposureImpl.java on lines 335..346
de.bund.bfr.knime.fsklab.metadata.model/gen/metadata/impl/LaboratoryImpl.java on lines 263..274

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

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

    private HashMap<String, HashMap<String, HashMap<Integer, Integer>>> checkID(Connection conn, boolean before, String dbuuid, KnimeTuple row, Integer oldID, Integer newID,
            HashMap<String, HashMap<String, HashMap<Integer, Integer>>> foreignDbIds, String rowuuid) throws PmmException {

Method setSettings has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public void setSettings(Config c, Integer defAgent, Integer defMatrix, Double defTemp, Double defPh, Double defAw, Double agentConc, Callable<Void> refresher) throws InvalidSettingsException {

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Consider simplifying this complex logical expression.
Open

        if (!matrixString.isEmpty() || !agentString.isEmpty() || !literatureString.isEmpty() || matrixID > 0 || agentID > 0 || literatureID > 0 || parameter.size() > 0) filterEnabled = true;

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Method passesFilter has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        final String matrixString,
        final String agentString,
        final String literatureString,
        int matrixID, int agentID, int literatureID,
        final LinkedHashMap<String, Double[]> parameter,

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Method write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Consider simplifying this complex logical expression.
Open

                                        if ((!showOnlyDataFromCurrentUser || v != null && v.containsKey(id)) &&
                                                (id1 < 0 && id2 < 0 || id >= id1 && id <= id2)) {
                                            String toAdd = tn2 + " (ID=" + getFormattedID(id) + "): ";
                                            if (tblname != null) {
                                                toAdd += tblname + " (ID=" + getFormattedID(rs.getInt(2)) + "): ";
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

                if (headerValue != null && mnTable != null && col != null && col > 0 && col - 1 < mnTable.length && mnTable[col - 1] != null && mnTable[col - 1].length() > 0) { // headerValue.toString().equals("Kits")
                    if (!mnTable[col - 1].equals("INT")) {
                        String mntname = mnTable[col - 1];
                        MyTable myMNTable = DBKernel.myDBi.getTable(mntname);
                        String tname = myT.getTablename();
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java - About 1 hr to fix

Method openNewWindow has 8 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) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java - About 1 hr to fix

Method insertParam has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private int insertParam(final int modelId, final String paramName, final int paramType, final Double min, final Double max, final String category, final String unit,
            final String description) {

Method insertEstParam has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private void insertEstParam(final int estModelId, final int paramId, final Double value, final Double paramErr, String unit, ParametricModel pm, boolean isDepIndep,
            String paramName) {
Severity
Category
Status
Source
Language