The following document contains the results of SpotBugs
SpotBugs Version is 4.8.3
Threshold is low
Effort is max
| Classes | Bugs | Errors | Missing Classes |
|---|---|---|---|
| 25 | 33 | 0 | 5 |
| Bug | Category | Details | Line | Priority |
|---|---|---|---|---|
| Exception is caught when Exception is not thrown in com.app.controller.AuthController.register(RegisterRequest, Authentication) | STYLE | REC_CATCH_EXCEPTION | 47 | Low |
| com.app.controller.AuthController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 55 | Low |
| com.app.controller.AuthController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 42 | Low |
| Bug | Category | Details | Line | Priority |
|---|---|---|---|---|
| new com.app.controller.FileController(FileService) may expose internal representation by storing an externally mutable object into FileController.fileService | MALICIOUS_CODE | EI_EXPOSE_REP2 | 20 | Medium |
| Exception is caught when Exception is not thrown in com.app.controller.FileController.downloadFile(String) | STYLE | REC_CATCH_EXCEPTION | 49 | Low |
| com.app.controller.FileController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 57 | Low |
| com.app.controller.FileController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 42 | Low |
| com.app.controller.FileController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 27 | Low |
| Bug | Category | Details | Line | Priority |
|---|---|---|---|---|
| com.app.controller.HelloController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 11 | Low |
| Bug | Category | Details | Line | Priority |
|---|---|---|---|---|
| new com.app.controller.MessageController(MessageService) may expose internal representation by storing an externally mutable object into MessageController.messageService | MALICIOUS_CODE | EI_EXPOSE_REP2 | 19 | Medium |
| com.app.controller.MessageController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 34 | Low |
| com.app.controller.MessageController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 40 | Low |
| com.app.controller.MessageController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 24 | Low |
| com.app.controller.MessageController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 29 | Low |
| Bug | Category | Details | Line | Priority |
|---|---|---|---|---|
| new com.app.controller.ProductController(ProductService) may expose internal representation by storing an externally mutable object into ProductController.productService | MALICIOUS_CODE | EI_EXPOSE_REP2 | 21 | Medium |
| com.app.controller.ProductController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 26 | Low |
| com.app.controller.ProductController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 56 | Low |
| com.app.controller.ProductController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 32 | Low |
| com.app.controller.ProductController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 38 | Low |
| com.app.controller.ProductController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 68 | Low |
| com.app.controller.ProductController is a Spring endpoint (Controller) | SECURITY | SPRING_ENDPOINT | 47 | Low |
| Bug | Category | Details | Line | Priority |
|---|---|---|---|---|
| com.app.model.ProductFile.getProduct() may expose internal representation by returning ProductFile.product | MALICIOUS_CODE | EI_EXPOSE_REP | 33 | Medium |
| new com.app.model.ProductFile(String, Product, String) may expose internal representation by storing an externally mutable object into ProductFile.product | MALICIOUS_CODE | EI_EXPOSE_REP2 | 27 | Medium |
| Bug | Category | Details | Line | Priority |
|---|---|---|---|---|
| com.app.model.User is Serializable; consider declaring a serialVersionUID | BAD_PRACTICE | SE_NO_SERIALVERSIONID | 31 | Low |
| Bug | Category | Details | Line | Priority |
|---|---|---|---|---|
| Disabling Spring Security's CSRF protection is unsafe for standard web applications | SECURITY | SPRING_CSRF_PROTECTION_DISABLED | 22 | High |
| Bug | Category | Details | Line | Priority |
|---|---|---|---|---|
| Exception thrown in class com.app.service.FileService at new com.app.service.FileService(String, ProductFileRepository, ProductRepository) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 34 | Medium |
| Dead store to productFile in com.app.service.FileService.loadFileAsResource(String) | STYLE | DLS_DEAD_LOCAL_STORE | 69 | Medium |
| Possible null pointer dereference in com.app.service.FileService.deleteFile(String) due to return value of called method | STYLE | NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE | 102 | Medium |
| Possible null pointer dereference in com.app.service.FileService.loadFileAsResource(String) due to return value of called method | STYLE | NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE | 75 | Medium |
| Possible null pointer dereference in com.app.service.FileService.uploadFile(MultipartFile, Long) due to return value of called method | STYLE | NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE | 54 | Medium |
| This API (java/nio/file/Paths.get(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;) reads a file whose location might be specified by user input | SECURITY | PATH_TRAVERSAL_IN | 30 | Medium |
| Exception is caught when Exception is not thrown in com.app.service.FileService.isValidRealMimeType(MultipartFile) | STYLE | REC_CATCH_EXCEPTION | 134 | Low |
| Exception is caught when Exception is not thrown in com.app.service.FileService.loadFileAsResource(String) | STYLE | REC_CATCH_EXCEPTION | 85 | Low |