PMD Results

The following document contains the results of PMD 7.17.0.

Violations By Priority

Priority 3

de/spiritscorp/datasync/Main.java

Rule Violation Line
AssignmentInOperand Avoid assignment to firstStart in operand 161
AssignmentInOperand Avoid assignment to debug in operand 162

de/spiritscorp/datasync/controller/BgController.java

Rule Violation Line
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 109
LawOfDemeter Call to `getBgTime` on foreign value `pref` (degree 2) 206
CognitiveComplexity The method 'checkAndQueueJobs()' has a cognitive complexity of 15, current threshold is 15 232
LawOfDemeter Call to `getBgTime` on foreign value `pref` (degree 2) 241
LocalVariableCouldBeFinal Local variable 'destPath' could be declared final 244
ConfusingTernary Avoid if (x != y) ..; else ..; 245268
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 253
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 259
AvoidLiteralsInIfCondition Avoid using literals such as 0.0 in if statements 337

de/spiritscorp/datasync/controller/LogFormatter.java

Rule Violation Line
CognitiveComplexity The method 'formatMaps(ScanType, Map<Path, FileAttributes>, Map<Path, FileAttributes>, Map<Path, FileAttributes>)' has a cognitive complexity of 16, current threshold is 15 131
CyclomaticComplexity The method 'formatMaps(ScanType, Map<Path, FileAttributes>, Map<Path, FileAttributes>, Map<Path, FileAttributes>)' has a cyclomatic complexity of 10. 131

de/spiritscorp/datasync/controller/MainViewController.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 47302

de/spiritscorp/datasync/controller/SyncJobContext.java

Rule Violation Line
CommentRequired Field comments are required 47
CommentRequired Field comments are required 48
CommentRequired Field comments are required 49
CommentRequired Field comments are required 50
CommentRequired Field comments are required 51
CommentRequired Field comments are required 53
LongVariable Avoid excessively long variable names like activeWorkerThread 54
CommentRequired Field comments are required 54
CommentRequired Field comments are required 56
AvoidSynchronizedAtMethodLevel Use block level locking rather than method level synchronization 82
ConfusingTernary Avoid if (x != y) ..; else ..; 101109
CommentRequired Public method and constructor comments are required 136
CommentRequired Public method and constructor comments are required 150
CommentRequired Public method and constructor comments are required 156
CommentRequired Public method and constructor comments are required 170
CommentRequired Public method and constructor comments are required 180
CommentRequired Public method and constructor comments are required 186
CommentRequired Public method and constructor comments are required 194
CommentRequired Field comments are required 202
CommentRequired Field comments are required 203
CommentRequired Field comments are required 204
CommentRequired Field comments are required 205
CommentRequired Field comments are required 206
CommentRequired Field comments are required 207
CommentRequired Public method and constructor comments are required 209
CommentRequired Public method and constructor comments are required 217
CommentRequired Public method and constructor comments are required 227
CommentRequired Public method and constructor comments are required 231
CommentRequired Public method and constructor comments are required 235
CommentRequired Public method and constructor comments are required 239

de/spiritscorp/datasync/controller/SyncJobService.java

Rule Violation Line
CognitiveComplexity The method 'startSynchronize(SyncJobContext)' has a cognitive complexity of 17, current threshold is 15 81
AvoidLiteralsInIfCondition Avoid using literals such as 1 in if statements 106
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 114
ExceptionAsFlowControl Exception thrown at line 112 is caught in this block. 141145
ExceptionAsFlowControl Exception thrown at line 117 is caught in this block. 141145
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 145
NcssCount The method 'startBackup(SyncJobContext)' has a NCSS line count of 60. 163
CognitiveComplexity The method 'startBackup(SyncJobContext)' has a cognitive complexity of 18, current threshold is 15 163
LongVariable Avoid excessively long variable names like backupTimeFormatted 200
ExceptionAsFlowControl Exception thrown at line 191 is caught in this block. 225229
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 229
ExceptionAsFlowControl Exception thrown at line 267 is caught in this block. 287290
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 290
CognitiveComplexity The method 'deleteSelectedDuplicates(SyncJobContext)' has a cognitive complexity of 17, current threshold is 15 308
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 309
ExceptionAsFlowControl Exception thrown at line 329 is caught in this block. 341346
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 346
LinguisticNaming Linguistics Antipattern - The setter 'setOSAutostart' should not return any type except void linguistically 366
CognitiveComplexity The method 'setOSAutostart(boolean)' has a cognitive complexity of 23, current threshold is 15 366
CyclomaticComplexity The method 'setOSAutostart(boolean)' has a cyclomatic complexity of 13. 366
ShortVariable Avoid variables with short names like pb 385
ShortVariable Avoid variables with short names like pb 388
ShortVariable Avoid variables with short names like pb 405
ShortVariable Avoid variables with short names like pb 415
AvoidInstanceofChecksInCatchClause An instanceof check is being performed on the caught exception. Create a separate catch clause for InterruptedException. 421

de/spiritscorp/datasync/controller/ViewController.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 31152

de/spiritscorp/datasync/gui/Gui.java

Rule Violation Line
CommentRequired Field comments are required 61
CommentRequired Field comments are required 62
CommentRequired Field comments are required 64
CommentRequired Field comments are required 65
CommentRequired Field comments are required 67
CommentRequired Field comments are required 71
CommentRequired Field comments are required 73
CommentRequired Field comments are required 74
SingularField Perhaps 'sidebarView' could be replaced by a local variable. 74
CommentRequired Field comments are required 75
CommentRequired Field comments are required 76
CommentRequired Field comments are required 77
CommentRequired Field comments are required 99
LocalVariableCouldBeFinal Local variable 'prefMan' could be declared final 120
LocalVariableCouldBeFinal Local variable 'theme' could be declared final 121
CommentRequired Public method and constructor comments are required 255

de/spiritscorp/datasync/gui/NotifyStatus.java

Rule Violation Line
CommentRequired Enum comments are required 23
CommentRequired Field comments are required 28

de/spiritscorp/datasync/gui/SidebarView.java

Rule Violation Line
CommentRequired Field comments are required 58
CommentRequired Field comments are required 59
CommentRequired Field comments are required 60
CommentRequired Field comments are required 62
CommentRequired Field comments are required 63
CommentRequired Field comments are required 64
LongVariable Avoid excessively long variable names like dragAndDropEnabled 66
ImmutableField Field 'dragAndDropEnabled' may be declared final 66
CommentRequired Field comments are required 66
CallSuperInConstructor It is a good practice to call super() in a constructor 74
CognitiveComplexity The method 'setupCellFactory()' has a cognitive complexity of 47, current threshold is 15 129
ShortVariable Avoid variables with short names like db 189
LooseCoupling Avoid using implementation types like 'ClipboardContent'; use the interface instead 190
ShortVariable Avoid variables with short names like db 225

de/spiritscorp/datasync/gui/WorkspaceView.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 1356

de/spiritscorp/datasync/io/ConfigException.java

Rule Violation Line
CommentRequired Class comments are required 23

de/spiritscorp/datasync/io/IOSyncMap.java

Rule Violation Line
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 7885
LooseCoupling Avoid using implementation types like 'HashMap'; use the interface instead 118
CloseResource it is recommended to wrap resource 'jsonWriter' in try-with-resource declaration directly 123

de/spiritscorp/datasync/io/Logrotater.java

Rule Violation Line
LocalVariableCouldBeFinal Local variable 'actualSize' could be declared final 62

de/spiritscorp/datasync/io/Preference.java

Rule Violation Line
GodClass Possible God Class (WMC=65, ATFD=13, TCC=13.782%) 52
TooManyMethods This class has too many methods, consider refactoring it. 52372
CommentRequired Field comments are required 54
CommentRequired Field comments are required 55
CommentRequired Field comments are required 56
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 58
CommentRequired Field comments are required 58
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 59
CommentRequired Field comments are required 59
CommentRequired Field comments are required 60
CommentRequired Field comments are required 62
CommentRequired Field comments are required 63
CommentRequired Field comments are required 65
CommentRequired Field comments are required 66
CommentRequired Field comments are required 68
CommentRequired Field comments are required 69
CommentRequired Field comments are required 70
CommentRequired Field comments are required 71
CommentRequired Field comments are required 72
CommentRequired Field comments are required 73
CognitiveComplexity The method 'deserialize(JsonObject)' has a cognitive complexity of 26, current threshold is 15 136
CyclomaticComplexity The method 'deserialize(JsonObject)' has a cyclomatic complexity of 20. 136
NPathComplexity The method 'deserialize(JsonObject)' has an NPath complexity of 2431, current threshold is 200 136
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 204
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 314
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 316
CommentRequired Public method and constructor comments are required 321
CommentRequired Public method and constructor comments are required 325
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 329
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 331

de/spiritscorp/datasync/io/PreferenceManager.java

Rule Violation Line
GodClass Possible God Class (WMC=78, ATFD=13, TCC=25.000%) 58
TooManyMethods This class has too many methods, consider refactoring it. 58558
LocalVariableCouldBeFinal Local variable 'pref' could be declared final 177
LinguisticNaming Linguistics Antipattern - The setter 'setNewProfile' should not return any type except void linguistically 191
LocalVariableCouldBeFinal Local variable 'newPref' could be declared final 196
EmptyCatchBlock Avoid empty catch blocks 202204
LocalVariableCouldBeFinal Local variable 'pref' could be declared final 295
AvoidDuplicateLiterals The String literal "globalSettings" appears 4 times in this file; the first occurrence is on line 344 344
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 351
LiteralsFirstInComparisons Position literals first in String comparisons 453

de/spiritscorp/datasync/model/BgModel.java

Rule Violation Line
CommentRequired Class comments are required 33
CommentRequired Field comments are required 35
CommentRequired Field comments are required 36
CommentRequired Field comments are required 37
CommentRequired Field comments are required 38
CommentRequired Field comments are required 39
CommentRequired Public method and constructor comments are required 41
NcssCount The method 'runBgJob()' has a NCSS line count of 76. 55
CognitiveComplexity The method 'runBgJob()' has a cognitive complexity of 34, current threshold is 15 55
CyclomaticComplexity The method 'runBgJob()' has a cyclomatic complexity of 15. 55
AvoidLiteralsInIfCondition Avoid using literals such as 1_000 in if statements 146

de/spiritscorp/datasync/model/FileAnalyzer.java

Rule Violation Line
GodClass Possible God Class (WMC=51, ATFD=40, TCC=4.762%) 41
CognitiveComplexity The method 'findDuplicates(Map<Path, FileAttributes>)' has a cognitive complexity of 23, current threshold is 15 65
CyclomaticComplexity The method 'findDuplicates(Map<Path, FileAttributes>)' has a cyclomatic complexity of 10. 65
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 69
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 69
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 76
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 81
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 83
AvoidLiteralsInIfCondition Avoid using literals such as 1 in if statements 84
CognitiveComplexity The method 'equalsFiles(Map<Path, FileAttributes>, Map<Path, FileAttributes>)' has a cognitive complexity of 28, current threshold is 15 106
CyclomaticComplexity The method 'equalsFiles(Map<Path, FileAttributes>, Map<Path, FileAttributes>)' has a cyclomatic complexity of 12. 106
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 108
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 108
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 169
CognitiveComplexity The method 'getSyncFiles(Map<Path, FileAttributes>, Map<Path, FileAttributes>, Path, Path, Map<Path, FileAttributes>)' has a cognitive complexity of 25, current threshold is 15 169
CyclomaticComplexity The method 'getSyncFiles(Map<Path, FileAttributes>, Map<Path, FileAttributes>, Path, Path, Map<Path, FileAttributes>)' has a cyclomatic complexity of 11. 169
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 172
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 173
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 184
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 184

de/spiritscorp/datasync/model/FileAttributes.java

Rule Violation Line
CommentRequired Field comments are required 40
CommentRequired Field comments are required 41
CommentRequired Field comments are required 42
CommentRequired Field comments are required 43
CommentRequired Field comments are required 44
CommentRequired Field comments are required 45
CommentRequired Field comments are required 46
CommentRequired Field comments are required 47
ShortVariable Avoid variables with short names like o 86
CognitiveComplexity The method 'equals(Object)' has a cognitive complexity of 20, current threshold is 15 103
CyclomaticComplexity The method 'equals(Object)' has a cyclomatic complexity of 17. 103
SimplifyBooleanReturns This if statement can be replaced by `return !{condition};` 131132

de/spiritscorp/datasync/model/FileScan.java

Rule Violation Line
CommentRequired Class comments are required 39
CommentRequired Field comments are required 41
CommentRequired Field comments are required 42
CommentRequired Field comments are required 43
CommentRequired Field comments are required 44
CommentRequired Field comments are required 45
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 107111

de/spiritscorp/datasync/model/FileVisit.java

Rule Violation Line
CommentRequired Class comments are required 34
CommentRequired Field comments are required 35
CommentRequired Field comments are required 36
CommentRequired Field comments are required 37
CommentRequired Field comments are required 38
CollapsibleIfStatements This if statement could be combined with its parent 5659

de/spiritscorp/datasync/model/Model.java

Rule Violation Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 170
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 172
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 214
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 246

Priority 4

de/spiritscorp/datasync/gui/Gui.java

Rule Violation Line
ShortClassName Avoid short class names like Gui 57

Files

de/spiritscorp/datasync/Main.java

Rule Violation Priority Line
AssignmentInOperand Avoid assignment to firstStart in operand 3 161
AssignmentInOperand Avoid assignment to debug in operand 3 162

de/spiritscorp/datasync/controller/BgController.java

Rule Violation Priority Line
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 109
LawOfDemeter Call to `getBgTime` on foreign value `pref` (degree 2) 3 206
CognitiveComplexity The method 'checkAndQueueJobs()' has a cognitive complexity of 15, current threshold is 15 3 232
LawOfDemeter Call to `getBgTime` on foreign value `pref` (degree 2) 3 241
LocalVariableCouldBeFinal Local variable 'destPath' could be declared final 3 244
ConfusingTernary Avoid if (x != y) ..; else ..; 3 245268
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 253
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 259
AvoidLiteralsInIfCondition Avoid using literals such as 0.0 in if statements 3 337

de/spiritscorp/datasync/controller/LogFormatter.java

Rule Violation Priority Line
CognitiveComplexity The method 'formatMaps(ScanType, Map<Path, FileAttributes>, Map<Path, FileAttributes>, Map<Path, FileAttributes>)' has a cognitive complexity of 16, current threshold is 15 3 131
CyclomaticComplexity The method 'formatMaps(ScanType, Map<Path, FileAttributes>, Map<Path, FileAttributes>, Map<Path, FileAttributes>)' has a cyclomatic complexity of 10. 3 131

de/spiritscorp/datasync/controller/MainViewController.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 47302

de/spiritscorp/datasync/controller/SyncJobContext.java

Rule Violation Priority Line
CommentRequired Field comments are required 3 47
CommentRequired Field comments are required 3 48
CommentRequired Field comments are required 3 49
CommentRequired Field comments are required 3 50
CommentRequired Field comments are required 3 51
CommentRequired Field comments are required 3 53
LongVariable Avoid excessively long variable names like activeWorkerThread 3 54
CommentRequired Field comments are required 3 54
CommentRequired Field comments are required 3 56
AvoidSynchronizedAtMethodLevel Use block level locking rather than method level synchronization 3 82
ConfusingTernary Avoid if (x != y) ..; else ..; 3 101109
CommentRequired Public method and constructor comments are required 3 136
CommentRequired Public method and constructor comments are required 3 150
CommentRequired Public method and constructor comments are required 3 156
CommentRequired Public method and constructor comments are required 3 170
CommentRequired Public method and constructor comments are required 3 180
CommentRequired Public method and constructor comments are required 3 186
CommentRequired Public method and constructor comments are required 3 194
CommentRequired Field comments are required 3 202
CommentRequired Field comments are required 3 203
CommentRequired Field comments are required 3 204
CommentRequired Field comments are required 3 205
CommentRequired Field comments are required 3 206
CommentRequired Field comments are required 3 207
CommentRequired Public method and constructor comments are required 3 209
CommentRequired Public method and constructor comments are required 3 217
CommentRequired Public method and constructor comments are required 3 227
CommentRequired Public method and constructor comments are required 3 231
CommentRequired Public method and constructor comments are required 3 235
CommentRequired Public method and constructor comments are required 3 239

de/spiritscorp/datasync/controller/SyncJobService.java

Rule Violation Priority Line
CognitiveComplexity The method 'startSynchronize(SyncJobContext)' has a cognitive complexity of 17, current threshold is 15 3 81
AvoidLiteralsInIfCondition Avoid using literals such as 1 in if statements 3 106
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 114
ExceptionAsFlowControl Exception thrown at line 112 is caught in this block. 3 141145
ExceptionAsFlowControl Exception thrown at line 117 is caught in this block. 3 141145
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 145
NcssCount The method 'startBackup(SyncJobContext)' has a NCSS line count of 60. 3 163
CognitiveComplexity The method 'startBackup(SyncJobContext)' has a cognitive complexity of 18, current threshold is 15 3 163
LongVariable Avoid excessively long variable names like backupTimeFormatted 3 200
ExceptionAsFlowControl Exception thrown at line 191 is caught in this block. 3 225229
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 229
ExceptionAsFlowControl Exception thrown at line 267 is caught in this block. 3 287290
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 290
CognitiveComplexity The method 'deleteSelectedDuplicates(SyncJobContext)' has a cognitive complexity of 17, current threshold is 15 3 308
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 309
ExceptionAsFlowControl Exception thrown at line 329 is caught in this block. 3 341346
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 346
LinguisticNaming Linguistics Antipattern - The setter 'setOSAutostart' should not return any type except void linguistically 3 366
CognitiveComplexity The method 'setOSAutostart(boolean)' has a cognitive complexity of 23, current threshold is 15 3 366
CyclomaticComplexity The method 'setOSAutostart(boolean)' has a cyclomatic complexity of 13. 3 366
ShortVariable Avoid variables with short names like pb 3 385
ShortVariable Avoid variables with short names like pb 3 388
ShortVariable Avoid variables with short names like pb 3 405
ShortVariable Avoid variables with short names like pb 3 415
AvoidInstanceofChecksInCatchClause An instanceof check is being performed on the caught exception. Create a separate catch clause for InterruptedException. 3 421

de/spiritscorp/datasync/controller/ViewController.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 31152

de/spiritscorp/datasync/gui/Gui.java

Rule Violation Priority Line
ShortClassName Avoid short class names like Gui 4 57
CommentRequired Field comments are required 3 61
CommentRequired Field comments are required 3 62
CommentRequired Field comments are required 3 64
CommentRequired Field comments are required 3 65
CommentRequired Field comments are required 3 67
CommentRequired Field comments are required 3 71
CommentRequired Field comments are required 3 73
CommentRequired Field comments are required 3 74
SingularField Perhaps 'sidebarView' could be replaced by a local variable. 3 74
CommentRequired Field comments are required 3 75
CommentRequired Field comments are required 3 76
CommentRequired Field comments are required 3 77
CommentRequired Field comments are required 3 99
LocalVariableCouldBeFinal Local variable 'prefMan' could be declared final 3 120
LocalVariableCouldBeFinal Local variable 'theme' could be declared final 3 121
CommentRequired Public method and constructor comments are required 3 255

de/spiritscorp/datasync/gui/NotifyStatus.java

Rule Violation Priority Line
CommentRequired Enum comments are required 3 23
CommentRequired Field comments are required 3 28

de/spiritscorp/datasync/gui/SidebarView.java

Rule Violation Priority Line
CommentRequired Field comments are required 3 58
CommentRequired Field comments are required 3 59
CommentRequired Field comments are required 3 60
CommentRequired Field comments are required 3 62
CommentRequired Field comments are required 3 63
CommentRequired Field comments are required 3 64
LongVariable Avoid excessively long variable names like dragAndDropEnabled 3 66
ImmutableField Field 'dragAndDropEnabled' may be declared final 3 66
CommentRequired Field comments are required 3 66
CallSuperInConstructor It is a good practice to call super() in a constructor 3 74
CognitiveComplexity The method 'setupCellFactory()' has a cognitive complexity of 47, current threshold is 15 3 129
ShortVariable Avoid variables with short names like db 3 189
LooseCoupling Avoid using implementation types like 'ClipboardContent'; use the interface instead 3 190
ShortVariable Avoid variables with short names like db 3 225

de/spiritscorp/datasync/gui/WorkspaceView.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 1356

de/spiritscorp/datasync/io/ConfigException.java

Rule Violation Priority Line
CommentRequired Class comments are required 3 23

de/spiritscorp/datasync/io/IOSyncMap.java

Rule Violation Priority Line
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 7885
LooseCoupling Avoid using implementation types like 'HashMap'; use the interface instead 3 118
CloseResource it is recommended to wrap resource 'jsonWriter' in try-with-resource declaration directly 3 123

de/spiritscorp/datasync/io/Logrotater.java

Rule Violation Priority Line
LocalVariableCouldBeFinal Local variable 'actualSize' could be declared final 3 62

de/spiritscorp/datasync/io/Preference.java

Rule Violation Priority Line
GodClass Possible God Class (WMC=65, ATFD=13, TCC=13.782%) 3 52
TooManyMethods This class has too many methods, consider refactoring it. 3 52372
CommentRequired Field comments are required 3 54
CommentRequired Field comments are required 3 55
CommentRequired Field comments are required 3 56
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 58
CommentRequired Field comments are required 3 58
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 59
CommentRequired Field comments are required 3 59
CommentRequired Field comments are required 3 60
CommentRequired Field comments are required 3 62
CommentRequired Field comments are required 3 63
CommentRequired Field comments are required 3 65
CommentRequired Field comments are required 3 66
CommentRequired Field comments are required 3 68
CommentRequired Field comments are required 3 69
CommentRequired Field comments are required 3 70
CommentRequired Field comments are required 3 71
CommentRequired Field comments are required 3 72
CommentRequired Field comments are required 3 73
CognitiveComplexity The method 'deserialize(JsonObject)' has a cognitive complexity of 26, current threshold is 15 3 136
CyclomaticComplexity The method 'deserialize(JsonObject)' has a cyclomatic complexity of 20. 3 136
NPathComplexity The method 'deserialize(JsonObject)' has an NPath complexity of 2431, current threshold is 200 3 136
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 204
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 314
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 316
CommentRequired Public method and constructor comments are required 3 321
CommentRequired Public method and constructor comments are required 3 325
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 329
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 331

de/spiritscorp/datasync/io/PreferenceManager.java

Rule Violation Priority Line
GodClass Possible God Class (WMC=78, ATFD=13, TCC=25.000%) 3 58
TooManyMethods This class has too many methods, consider refactoring it. 3 58558
LocalVariableCouldBeFinal Local variable 'pref' could be declared final 3 177
LinguisticNaming Linguistics Antipattern - The setter 'setNewProfile' should not return any type except void linguistically 3 191
LocalVariableCouldBeFinal Local variable 'newPref' could be declared final 3 196
EmptyCatchBlock Avoid empty catch blocks 3 202204
LocalVariableCouldBeFinal Local variable 'pref' could be declared final 3 295
AvoidDuplicateLiterals The String literal "globalSettings" appears 4 times in this file; the first occurrence is on line 344 3 344
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 351
LiteralsFirstInComparisons Position literals first in String comparisons 3 453

de/spiritscorp/datasync/model/BgModel.java

Rule Violation Priority Line
CommentRequired Class comments are required 3 33
CommentRequired Field comments are required 3 35
CommentRequired Field comments are required 3 36
CommentRequired Field comments are required 3 37
CommentRequired Field comments are required 3 38
CommentRequired Field comments are required 3 39
CommentRequired Public method and constructor comments are required 3 41
NcssCount The method 'runBgJob()' has a NCSS line count of 76. 3 55
CognitiveComplexity The method 'runBgJob()' has a cognitive complexity of 34, current threshold is 15 3 55
CyclomaticComplexity The method 'runBgJob()' has a cyclomatic complexity of 15. 3 55
AvoidLiteralsInIfCondition Avoid using literals such as 1_000 in if statements 3 146

de/spiritscorp/datasync/model/FileAnalyzer.java

Rule Violation Priority Line
GodClass Possible God Class (WMC=51, ATFD=40, TCC=4.762%) 3 41
CognitiveComplexity The method 'findDuplicates(Map<Path, FileAttributes>)' has a cognitive complexity of 23, current threshold is 15 3 65
CyclomaticComplexity The method 'findDuplicates(Map<Path, FileAttributes>)' has a cyclomatic complexity of 10. 3 65
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 69
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 69
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 76
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 81
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 83
AvoidLiteralsInIfCondition Avoid using literals such as 1 in if statements 3 84
CognitiveComplexity The method 'equalsFiles(Map<Path, FileAttributes>, Map<Path, FileAttributes>)' has a cognitive complexity of 28, current threshold is 15 3 106
CyclomaticComplexity The method 'equalsFiles(Map<Path, FileAttributes>, Map<Path, FileAttributes>)' has a cyclomatic complexity of 12. 3 106
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 108
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 108
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 169
CognitiveComplexity The method 'getSyncFiles(Map<Path, FileAttributes>, Map<Path, FileAttributes>, Path, Path, Map<Path, FileAttributes>)' has a cognitive complexity of 25, current threshold is 15 3 169
CyclomaticComplexity The method 'getSyncFiles(Map<Path, FileAttributes>, Map<Path, FileAttributes>, Path, Path, Map<Path, FileAttributes>)' has a cyclomatic complexity of 11. 3 169
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 172
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 173
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 184
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 184

de/spiritscorp/datasync/model/FileAttributes.java

Rule Violation Priority Line
CommentRequired Field comments are required 3 40
CommentRequired Field comments are required 3 41
CommentRequired Field comments are required 3 42
CommentRequired Field comments are required 3 43
CommentRequired Field comments are required 3 44
CommentRequired Field comments are required 3 45
CommentRequired Field comments are required 3 46
CommentRequired Field comments are required 3 47
ShortVariable Avoid variables with short names like o 3 86
CognitiveComplexity The method 'equals(Object)' has a cognitive complexity of 20, current threshold is 15 3 103
CyclomaticComplexity The method 'equals(Object)' has a cyclomatic complexity of 17. 3 103
SimplifyBooleanReturns This if statement can be replaced by `return !{condition};` 3 131132

de/spiritscorp/datasync/model/FileScan.java

Rule Violation Priority Line
CommentRequired Class comments are required 3 39
CommentRequired Field comments are required 3 41
CommentRequired Field comments are required 3 42
CommentRequired Field comments are required 3 43
CommentRequired Field comments are required 3 44
CommentRequired Field comments are required 3 45
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 3 107111

de/spiritscorp/datasync/model/FileVisit.java

Rule Violation Priority Line
CommentRequired Class comments are required 3 34
CommentRequired Field comments are required 3 35
CommentRequired Field comments are required 3 36
CommentRequired Field comments are required 3 37
CommentRequired Field comments are required 3 38
CollapsibleIfStatements This if statement could be combined with its parent 3 5659

de/spiritscorp/datasync/model/Model.java

Rule Violation Priority Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 170
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 172
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 214
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 246