PMD Results

The following document contains the results of PMD 7.17.0.

Violations By Priority

Priority 1

coder - io/github/magwas/coder/FileDeletionService.java

Rule Violation Line
AvoidThrowingRawExceptionTypes Avoid throwing raw exception type RuntimeException. 17

coder - io/github/magwas/coder/FileWriterService.java

Rule Violation Line
AvoidThrowingRawExceptionTypes Avoid throwing raw exception type RuntimeException. 19

coder - io/github/magwas/coder/OpenRouterClientService.java

Rule Violation Line
AvoidThrowingRawExceptionTypes Avoid throwing raw exception type RuntimeException. 58

coder - io/github/magwas/coder/XMLFileWriterService.java

Rule Violation Line
AvoidThrowingRawExceptionTypes Avoid throwing raw exception type RuntimeException. 43

Priority 2

coder - io/github/magwas/coder/CoderApplication.java

Rule Violation Line
SystemPrintln Usage of System.out/err 44
SystemPrintln Usage of System.out/err 59
SystemPrintln Usage of System.out/err 65
SystemPrintln Usage of System.out/err 69
SystemPrintln Usage of System.out/err 73
SystemPrintln Usage of System.out/err 81
SystemPrintln Usage of System.out/err 83

coder - io/github/magwas/coder/SourceCodeReaderService.java

Rule Violation Line
SystemPrintln Usage of System.out/err 69

Priority 3

coder - io/github/magwas/coder/CoderApplication.java

Rule Violation Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 16
MethodArgumentCouldBeFinal Parameter 'args' is not assigned and could be declared final 35
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 35
CloseResource Ensure that resources like this AnnotationConfigApplicationContext object are closed after use 36
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 52
DoNotTerminateVM System.exit() should not be used in J2EE/JEE apps 60
MethodArgumentCouldBeFinal Parameter 'question' is not assigned and could be declared final 79
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 82
AvoidPrintStackTrace Avoid printStackTrace(); use a logger call instead. 84

coder - io/github/magwas/coder/ConfigService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 9
AutowiredFields @Autowired fields naming conventions 12
ServiceClassMethods Services have only public apply method 14
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 14
ServiceClassMethods Services have only public apply method 18

coder - io/github/magwas/coder/ConsoleInputService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 12
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 26

coder - io/github/magwas/coder/ConversationAddMessageService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 11
MethodArgumentCouldBeFinal Parameter 'message' is not assigned and could be declared final 13
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 18

coder - io/github/magwas/coder/ConversationClearService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 11
UseExplicitTypes Use Explicit Types 14

coder - io/github/magwas/coder/ConversationGetMessagesService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 9

coder - io/github/magwas/coder/ConversationHasSystemInstructionsService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 9

coder - io/github/magwas/coder/ConversationSetupService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 11
AutowiredFields @Autowired fields naming conventions 14
AutowiredFields @Autowired fields naming conventions 17
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 25
MethodArgumentCouldBeFinal Parameter 'instructions' is not assigned and could be declared final 34
MethodArgumentCouldBeFinal Parameter 'sourceCode' is not assigned and could be declared final 34
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 40
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 42
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 46
ServiceClassField Services have only @Autowired fields 46

coder - io/github/magwas/coder/ConversationSizeService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 9

coder - io/github/magwas/coder/ConversationStateComponent.java

Rule Violation Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 9

coder - io/github/magwas/coder/ConversationStateData.java

Rule Violation Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 7

coder - io/github/magwas/coder/DirectoryComponent.java

Rule Violation Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 9

coder - io/github/magwas/coder/ErrorMessages.java

Rule Violation Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 3

coder - io/github/magwas/coder/FileDeletionService.java

Rule Violation Line
MethodArgumentCouldBeFinal Parameter 'fileName' is not assigned and could be declared final 11

coder - io/github/magwas/coder/FileService.java

Rule Violation Line
MethodArgumentCouldBeFinal Parameter 'content' is not assigned and could be declared final 12

coder - io/github/magwas/coder/FileWriterService.java

Rule Violation Line
MethodArgumentCouldBeFinal Parameter 'fileName' is not assigned and could be declared final 12
MethodArgumentCouldBeFinal Parameter 'content' is not assigned and could be declared final 12

coder - io/github/magwas/coder/LineReaderComponent.java

Rule Violation Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 12

coder - io/github/magwas/coder/OpenRouterClientService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 14
AutowiredFields @Autowired fields naming conventions 17
AutowiredFields @Autowired fields naming conventions 20
AutowiredFields @Autowired fields naming conventions 23
AutowiredFields @Autowired fields naming conventions 26
AutowiredFields @Autowired fields naming conventions 29
ServiceClassField Services have only @Autowired fields 31
MethodArgumentCouldBeFinal Parameter 'question' is not assigned and could be declared final 33
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 57

coder - io/github/magwas/coder/OpenRouterRequestService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 12
MethodArgumentCouldBeFinal Parameter 'messages' is not assigned and could be declared final 14

coder - io/github/magwas/coder/OpenRouterResponseService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 16
AutowiredFields @Autowired fields naming conventions 19
AutowiredFields @Autowired fields naming conventions 22
MethodArgumentCouldBeFinal Parameter 'responseBody' is not assigned and could be declared final 24
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3133
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3437

coder - io/github/magwas/coder/PathUtil.java

Rule Violation Line
MethodArgumentCouldBeFinal Parameter 'path' is not assigned and could be declared final 8
MethodArgumentCouldBeFinal Parameter 'currentDir' is not assigned and could be declared final 8

coder - io/github/magwas/coder/SourceCodeReaderService.java

Rule Violation Line
ServiceClassField Services have only @Autowired fields 12
ServiceClassField Services have only @Autowired fields 13
MethodArgumentCouldBeFinal Parameter 'dir' is not assigned and could be declared final 26
MethodArgumentCouldBeFinal Parameter 'xml' is not assigned and could be declared final 26
MethodArgumentCouldBeFinal Parameter 'content' is not assigned and could be declared final 74

coder - io/github/magwas/coder/XMLFileWriterService.java

Rule Violation Line
AutowiredFields @Autowired fields naming conventions 15
AutowiredFields @Autowired fields naming conventions 18
AutowiredFields @Autowired fields naming conventions 21
MethodArgumentCouldBeFinal Parameter 'xmlContent' is not assigned and could be declared final 23
MethodArgumentCouldBeFinal Parameter 'path' is not assigned and could be declared final 41
MethodArgumentCouldBeFinal Parameter 'currentDir' is not assigned and could be declared final 41

coder - io/github/magwas/coder/XmlProcessingUtil.java

Rule Violation Line
MethodArgumentCouldBeFinal Parameter 'xmlContent' is not assigned and could be declared final 21
MethodArgumentCouldBeFinal Parameter 'xmlContent' is not assigned and could be declared final 33
MethodArgumentCouldBeFinal Parameter 'xmlContent' is not assigned and could be declared final 45

coder - io/github/magwas/coder/XmlUtil.java

Rule Violation Line
MethodArgumentCouldBeFinal Parameter 'content' is not assigned and could be declared final 6

coder - io/github/magwas/coder/tests/XMLFileWriterServiceTest.java

Rule Violation Line
JUnit5TestShouldBePackagePrivate JUnit 5 tests should be package-private. 18
UnitTestContainsTooManyAsserts Unit tests should not contain more than 1 assert(s). 25
UnitTestContainsTooManyAsserts Unit tests should not contain more than 1 assert(s). 39
UnitTestContainsTooManyAsserts Unit tests should not contain more than 1 assert(s). 53

Priority 4

coder - io/github/magwas/coder/FileWriterService.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary qualifier 'ErrorMessages': 'FILE_ERROR' is already in scope because it is inherited by an enclosing type 19

coder - io/github/magwas/coder/OpenRouterRequestService.java

Rule Violation Line
UseVarargs Consider using varargs for methods or constructors which take an array the last parameter. 14

Files

coder - io/github/magwas/coder/CoderApplication.java

Rule Violation Priority Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 3 16
MethodArgumentCouldBeFinal Parameter 'args' is not assigned and could be declared final 3 35
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 3 35
CloseResource Ensure that resources like this AnnotationConfigApplicationContext object are closed after use 3 36
SystemPrintln Usage of System.out/err 2 44
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 3 52
SystemPrintln Usage of System.out/err 2 59
DoNotTerminateVM System.exit() should not be used in J2EE/JEE apps 3 60
SystemPrintln Usage of System.out/err 2 65
SystemPrintln Usage of System.out/err 2 69
SystemPrintln Usage of System.out/err 2 73
MethodArgumentCouldBeFinal Parameter 'question' is not assigned and could be declared final 3 79
SystemPrintln Usage of System.out/err 2 81
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 82
SystemPrintln Usage of System.out/err 2 83
AvoidPrintStackTrace Avoid printStackTrace(); use a logger call instead. 3 84

coder - io/github/magwas/coder/ConfigService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 9
AutowiredFields @Autowired fields naming conventions 3 12
ServiceClassMethods Services have only public apply method 3 14
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 3 14
ServiceClassMethods Services have only public apply method 3 18

coder - io/github/magwas/coder/ConsoleInputService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 12
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 26

coder - io/github/magwas/coder/ConversationAddMessageService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 11
MethodArgumentCouldBeFinal Parameter 'message' is not assigned and could be declared final 3 13
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 18

coder - io/github/magwas/coder/ConversationClearService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 11
UseExplicitTypes Use Explicit Types 3 14

coder - io/github/magwas/coder/ConversationGetMessagesService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 9

coder - io/github/magwas/coder/ConversationHasSystemInstructionsService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 9

coder - io/github/magwas/coder/ConversationSetupService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 11
AutowiredFields @Autowired fields naming conventions 3 14
AutowiredFields @Autowired fields naming conventions 3 17
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 25
MethodArgumentCouldBeFinal Parameter 'instructions' is not assigned and could be declared final 3 34
MethodArgumentCouldBeFinal Parameter 'sourceCode' is not assigned and could be declared final 3 34
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 40
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 42
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 3 46
ServiceClassField Services have only @Autowired fields 3 46

coder - io/github/magwas/coder/ConversationSizeService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 9

coder - io/github/magwas/coder/ConversationStateComponent.java

Rule Violation Priority Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 3 9

coder - io/github/magwas/coder/ConversationStateData.java

Rule Violation Priority Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 3 7

coder - io/github/magwas/coder/DirectoryComponent.java

Rule Violation Priority Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 3 9

coder - io/github/magwas/coder/ErrorMessages.java

Rule Violation Priority Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 3 3

coder - io/github/magwas/coder/FileDeletionService.java

Rule Violation Priority Line
MethodArgumentCouldBeFinal Parameter 'fileName' is not assigned and could be declared final 3 11
AvoidThrowingRawExceptionTypes Avoid throwing raw exception type RuntimeException. 1 17

coder - io/github/magwas/coder/FileService.java

Rule Violation Priority Line
MethodArgumentCouldBeFinal Parameter 'content' is not assigned and could be declared final 3 12

coder - io/github/magwas/coder/FileWriterService.java

Rule Violation Priority Line
MethodArgumentCouldBeFinal Parameter 'fileName' is not assigned and could be declared final 3 12
MethodArgumentCouldBeFinal Parameter 'content' is not assigned and could be declared final 3 12
AvoidThrowingRawExceptionTypes Avoid throwing raw exception type RuntimeException. 1 19
UnnecessaryFullyQualifiedName Unnecessary qualifier 'ErrorMessages': 'FILE_ERROR' is already in scope because it is inherited by an enclosing type 4 19

coder - io/github/magwas/coder/LineReaderComponent.java

Rule Violation Priority Line
ClassesShouldBeKnown Classes should be either Data, Service,Controller,Repository 3 12

coder - io/github/magwas/coder/OpenRouterClientService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 14
AutowiredFields @Autowired fields naming conventions 3 17
AutowiredFields @Autowired fields naming conventions 3 20
AutowiredFields @Autowired fields naming conventions 3 23
AutowiredFields @Autowired fields naming conventions 3 26
AutowiredFields @Autowired fields naming conventions 3 29
ServiceClassField Services have only @Autowired fields 3 31
MethodArgumentCouldBeFinal Parameter 'question' is not assigned and could be declared final 3 33
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 57
AvoidThrowingRawExceptionTypes Avoid throwing raw exception type RuntimeException. 1 58

coder - io/github/magwas/coder/OpenRouterRequestService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 12
UseVarargs Consider using varargs for methods or constructors which take an array the last parameter. 4 14
MethodArgumentCouldBeFinal Parameter 'messages' is not assigned and could be declared final 3 14

coder - io/github/magwas/coder/OpenRouterResponseService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 16
AutowiredFields @Autowired fields naming conventions 3 19
AutowiredFields @Autowired fields naming conventions 3 22
MethodArgumentCouldBeFinal Parameter 'responseBody' is not assigned and could be declared final 3 24
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 3133
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 3437

coder - io/github/magwas/coder/PathUtil.java

Rule Violation Priority Line
MethodArgumentCouldBeFinal Parameter 'path' is not assigned and could be declared final 3 8
MethodArgumentCouldBeFinal Parameter 'currentDir' is not assigned and could be declared final 3 8

coder - io/github/magwas/coder/SourceCodeReaderService.java

Rule Violation Priority Line
ServiceClassField Services have only @Autowired fields 3 12
ServiceClassField Services have only @Autowired fields 3 13
MethodArgumentCouldBeFinal Parameter 'dir' is not assigned and could be declared final 3 26
MethodArgumentCouldBeFinal Parameter 'xml' is not assigned and could be declared final 3 26
SystemPrintln Usage of System.out/err 2 69
MethodArgumentCouldBeFinal Parameter 'content' is not assigned and could be declared final 3 74

coder - io/github/magwas/coder/XMLFileWriterService.java

Rule Violation Priority Line
AutowiredFields @Autowired fields naming conventions 3 15
AutowiredFields @Autowired fields naming conventions 3 18
AutowiredFields @Autowired fields naming conventions 3 21
MethodArgumentCouldBeFinal Parameter 'xmlContent' is not assigned and could be declared final 3 23
MethodArgumentCouldBeFinal Parameter 'path' is not assigned and could be declared final 3 41
MethodArgumentCouldBeFinal Parameter 'currentDir' is not assigned and could be declared final 3 41
AvoidThrowingRawExceptionTypes Avoid throwing raw exception type RuntimeException. 1 43

coder - io/github/magwas/coder/XmlProcessingUtil.java

Rule Violation Priority Line
MethodArgumentCouldBeFinal Parameter 'xmlContent' is not assigned and could be declared final 3 21
MethodArgumentCouldBeFinal Parameter 'xmlContent' is not assigned and could be declared final 3 33
MethodArgumentCouldBeFinal Parameter 'xmlContent' is not assigned and could be declared final 3 45

coder - io/github/magwas/coder/XmlUtil.java

Rule Violation Priority Line
MethodArgumentCouldBeFinal Parameter 'content' is not assigned and could be declared final 3 6

coder - io/github/magwas/coder/tests/XMLFileWriterServiceTest.java

Rule Violation Priority Line
JUnit5TestShouldBePackagePrivate JUnit 5 tests should be package-private. 3 18
UnitTestContainsTooManyAsserts Unit tests should not contain more than 1 assert(s). 3 25
UnitTestContainsTooManyAsserts Unit tests should not contain more than 1 assert(s). 3 39
UnitTestContainsTooManyAsserts Unit tests should not contain more than 1 assert(s). 3 53