SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Avoid deeply nested control flow statements.
Open

                                if (showMessages) {
                                    if (deleted) {
                                        System.out.println("before: " + newO[modifiedCol - 1] + "\tdeleted: " + newO[modifiedCol] + "\tafter: " + newO[modifiedCol + 1]);
                                    } else {
                                        System.out.println("before: " + newO[modifiedCol - 1] + (modifiedCol + 1 < newO.length ? "\tafter: " + newO[modifiedCol + 1] : "\tnix"));
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/UpdateChecker.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if (row0 != null) {
                                String kennzahl = rs.getMetaData().getColumnName(i);
                                String colStr = columnName + "-" + kennzahl;
                                int theCol;
                                if (kennzahl.equals("Wert")) {//if (kennzahl.equals("Einzelwert")) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/exports/ExcelExport.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                    if (actTablename.equals(tableName) || actTablename.equals(DBKernel.getCodesName(tableName))) {
                                        myDB.setTable(myDB.getActualTable());
                                    }
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                    if (actTablename.equals(tableName) || actTablename.equals(DBKernel.getCodesName(tableName))) {
                                        myTR.setTable(myTR.getActualTable());
                                    }
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                for (int i = 0; i < newO.length; i++) {
                                    if (deleted) {
                                        if (i > modifiedCol) {
                                            newO[i] = o[i + 1];
                                        } else if (i < modifiedCol) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/UpdateChecker.java - About 45 mins to fix

Method openNewWindow has 6 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) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                    if (ssql1.length() > 0 && ssql2.length() > 0 && ssql3.length() > 0) {
                                        sql = "INSERT INTO " + DBKernel.delimitL(entry.getKey().getTablename()) + " (" + ssql1.substring(1) + ") VALUES (" + ssql2.substring(1)
                                                + ")";
                                        psForeign.put(entry.getKey(), DBKernel.getDBConnection().prepareStatement(sql, Statement.RETURN_GENERATED_KEYS));
                                        sql = "UPDATE " + DBKernel.delimitL(entry.getKey().getTablename()) + " SET " + ssql3.substring(1) + " WHERE " + DBKernel.delimitL("ID")
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                    for (Map.Entry<MyTable, PreparedStatement> entry : psForeignUpdate.entrySet()) {
                                        MyTable myT1 = entry.getKey();
                                        psForeign.get(myT1).clearParameters();
                                        psForeignUpdate.get(myT1).clearParameters();
                                        lfdColsForeign.put(myT1, 0);
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                    if (ft != null && ft.equals("DoubleKennzahlen")) {
                                        kzS[j] = getKZ(fieldName, dbFieldName);
                                        dbFieldnames[j] = dbFieldName;
                                    } else if (!dbFieldNames.containsKey(dbFieldName)) {
                                        dbFieldNames.put(dbFieldName, dbFieldName);
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if ((current.length() > 0)
                            && !Character.isWhitespace(current.charAt(current.length()-1))
                            && !Character.isWhitespace(fields[j+1].charAt(0)))
                        current.append(' ');
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/custom/MyRisImporter.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                    if (int2[0] == indexReihenfolge.get(ii)) {
                                        psmt.clearParameters();
                                        psmt.setInt(1, index_ProzessdatenID.get(int2[0]));
                                        Integer pid = index_ProzessdatenID.get(int2[1]);
                                        if (pid != null) {

Avoid deeply nested control flow statements.
Open

                                if (oe > 0) {
                                    oldEntry = oldEntry.substring(0, oe) + "\n" + ae;
                                } else {
                                    oldEntry = oldEntry + "\n" + ae;
                                }
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if (localConn != null) localConn.close();
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (c[2] == null) {
                            //System.err.println("Fehlerchenchen_1!! Serial: " + backS);
                            String msg = "Error Type 1 (Batches)!! Serial: " + backS; // Fehlerchenchen_1
                            System.err.println(msg);
                            logMessages += msg + "\n";

Method getValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private static Object getValue(Connection conn, final String tablename, final String[] feldname, final String[] feldVal, final String desiredColumn, boolean suppressWarnings) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (value.trim().equalsIgnoreCase(val.trim())) {
                            result = row;
                            break;
                        }

Avoid deeply nested control flow statements.
Open

                            for (int iii=0;iii<org_dst.size();iii++) {
                                Integer[] int22 = org_dst.get(iii);
                                if (int22[0] == int2[1]) {
                                    org_dst.add(new Integer[]{int2[0],int22[1]});
                                }

Method getLastRelevantChange has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static long getLastRelevantChange(Connection conn, String[] relevantTables) {
        long result = 0;
        if (relevantTables.length > 0) {
            String where = delimitL("Tabelle") + " = '" + relevantTables[0] + "'";
            for (int i = 1; i < relevantTables.length; i++) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method is1SurelyNewer has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private boolean is1SurelyNewer(Object day1, Object month1, Object year1, Object day2, Object month2, Object year2) {

Avoid deeply nested control flow statements.
Open

                                if (oldEntry.startsWith("Unknown\n\t")) {
                                    oe = oldEntry.indexOf("\n\t", oe + 1);
                                }
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 45 mins to fix
Severity
Category
Status
Source
Language