SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

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

Avoid deeply nested control flow statements.
Open

                            if (!b) {
                                if (feldVals[i] != null && !feldVals[i].equalsIgnoreCase("null")) {
                                    if (sql.endsWith(")")) sql += ",";
                                    if (isStringType != null && isStringType[i]) sql += DBKernel.delimitL(feldnames[i]) + "=CASEWHEN(" + DBKernel.delimitL(feldnames[i]) + "='"
                                            + feldVals[i] + "' OR INSTR(" + DBKernel.delimitL(feldnames[i]) + ",'\n" + feldVals[i] + "')>0," + DBKernel.delimitL(feldnames[i])

Avoid deeply nested control flow statements.
Open

                        if (is1SurelyNewer(cBack[3], c[3])) {
                            //System.err.println("- Dates not in temporal order, dateOut < dateIn!!! Serial: " + serial + "; PreviousSerial: " + backS);
                            String msg = "Dates not in temporal order, dateOut < dateIn!!! Serial: " + serial + "; PreviousSerial: " + backS;
                            System.err.println(msg);
                            logMessages += msg + "\n";

Avoid deeply nested control flow statements.
Open

                            if (rs != null && rs.first()) {
                                do {
                                    if (rs.getObject(1) != null) {
                                        Integer dkzID = rs.getInt(1);
                                        if (hash.containsKey(dkzID)) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/MergeDBsAPriori.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if (myDB.getActualTable() != null) {
                                myDB.getActualTable().restoreProperties(myDB);
                            }
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/Backup.java - About 45 mins to fix

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

    public static LinkedHashMap<Object, String> fillHashtable(final MyTable theTable, final String startDelim, final String delimiter, final String endDelim,
            final boolean goDeeper, final boolean forceUpdate) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 45 mins to fix

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

    public static Object insertDBL(final String tablename, final String fieldname, final Integer tableID, Object kzID, String kz, Object value) {
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 (rs.next()) {
                                        if (i==0) DBKernel.insertBLOB("Prozessdaten", "Workflow", xmlFile, rs.getInt(1));
                                        index_ProzessdatenID.put(key, rs.getInt(1));
                                        importedCarverIDs.add(value);
                                    }

Avoid deeply nested control flow statements.
Open

                            if (indexReihenfolgeNewEnde.get(j) == indexReihenfolge.get(k)) {
                                if (k == indexReihenfolge.size()-1) errorMessage += "Ups, 2.Ende... hier ist was schiefgelaufen!\nBitte die Carver Datei (*.pex,*.xml) an Armin senden!\n";
                                System.err.println(indexReihenfolgeNewEnde.get(j));
                                
                                for (int l=1;j+l < indexReihenfolgeNewEnde.size();l++) {

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

    public static String[] getItemListMisc(Connection conn) {
        HashSet<String> hs = new HashSet<>();
        try {
            ResultSet rs = null;
            String sql = "SELECT " + DBKernel.delimitL("Parameter") + " FROM " + DBKernel.delimitL("SonstigeParameter");
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

Severity
Category
Status
Source
Language