Showing 14,752 of 14,752 total issues
Avoid deeply nested control flow statements. Open
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"));
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (row0 != null) {
String kennzahl = rs.getMetaData().getColumnName(i);
String colStr = columnName + "-" + kennzahl;
int theCol;
if (kennzahl.equals("Wert")) {//if (kennzahl.equals("Einzelwert")) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (actTablename.equals(tableName) || actTablename.equals(DBKernel.getCodesName(tableName))) {
myDB.setTable(myDB.getActualTable());
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (actTablename.equals(tableName) || actTablename.equals(DBKernel.getCodesName(tableName))) {
myTR.setTable(myTR.getActualTable());
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
for (int i = 0; i < newO.length; i++) {
if (deleted) {
if (i > modifiedCol) {
newO[i] = o[i + 1];
} else if (i < modifiedCol) {
- Create a ticketCreate a ticket
Method openNewWindow
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Object openNewWindow(final MyTable theNewTable, final Object value, final Object headerValue, final MyDBTable dbTable, final Integer row, final Integer col) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
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")
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
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);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (ft != null && ft.equals("DoubleKennzahlen")) {
kzS[j] = getKZ(fieldName, dbFieldName);
dbFieldnames[j] = dbFieldName;
} else if (!dbFieldNames.containsKey(dbFieldName)) {
dbFieldNames.put(dbFieldName, dbFieldName);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if ((current.length() > 0)
&& !Character.isWhitespace(current.charAt(current.length()-1))
&& !Character.isWhitespace(fields[j+1].charAt(0)))
current.append(' ');
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
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) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (oe > 0) {
oldEntry = oldEntry.substring(0, oe) + "\n" + ae;
} else {
oldEntry = oldEntry + "\n" + ae;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (localConn != null) localConn.close();
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
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";
- Create a ticketCreate a ticket
Method getValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static Object getValue(Connection conn, final String tablename, final String[] feldname, final String[] feldVal, final String desiredColumn, boolean suppressWarnings) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (value.trim().equalsIgnoreCase(val.trim())) {
result = row;
break;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
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]});
}
- Create a ticketCreate a ticket
Method getLastRelevantChange
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
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++) {
- Read upRead up
- Create a ticketCreate a ticket
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
Open
private boolean is1SurelyNewer(Object day1, Object month1, Object year1, Object day2, Object month2, Object year2) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (oldEntry.startsWith("Unknown\n\t")) {
oe = oldEntry.indexOf("\n\t", oe + 1);
}
- Create a ticketCreate a ticket