[#12016] Added method into every service as a prototype for fetching specific data
- Added first prototype versions of service methods that will fetch specific data
- Added some basic comments and TODOs to problems I already faced or problems we will need to resolve with Mr. Pícha (e.g. not existing properties or optional properties)
This is just a prototype and this should serve (mainly) to managers @vandl & @JakubHomolka so they can see future structure and how the data is downloaded using the maven library
Merge request reports
Activity
requested review from @jpvlck
assigned to @janochmi
172 log.info("------------------------------------"); 173 log.info("Issue fetching completed"); 174 } 175 176 /** 177 * Formats a DateTime object to a readable string 178 */ 179 private String formatDateTime(DateTime dateTime) { 180 return dateTime != null ? dateTime.toString("yyyy-MM-dd HH:mm:ss") : "N/A"; 181 } 182 183 /** 184 * Formats bytes to a human-readable size 185 */ 186 private String formatBytes(Long bytes) { 187 if (bytes == null) return "Unknown"; Reporter: PMD
Rule: ControlStatementBraces
Severity: WARN
File: /builds/aswi/aswi-2025/aswi2025skibidi-ohio-rizzlers/src/main/java/com/pump/jira/service/IssueService.java L187
This statement should have braces
Code Style https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#controlstatementbraces
171 172 log.info("------------------------------------"); 173 log.info("Issue fetching completed"); 174 } 175 176 /** 177 * Formats a DateTime object to a readable string 178 */ 179 private String formatDateTime(DateTime dateTime) { 180 return dateTime != null ? dateTime.toString("yyyy-MM-dd HH:mm:ss") : "N/A"; 181 } 182 183 /** 184 * Formats bytes to a human-readable size 185 */ 186 private String formatBytes(Long bytes) { Reporter: PMD
Rule: UnusedPrivateMethod
Severity: WARN
File: /builds/aswi/aswi-2025/aswi2025skibidi-ohio-rizzlers/src/main/java/com/pump/jira/service/IssueService.java L186
Avoid unused private methods such as 'formatBytes(Long)'.
Best Practices https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unusedprivatemethod
48 log.info("Issue ID: {}", issue.getId()); 49 log.info("Key: {}", issue.getKey()); 50 log.info("Summary: {}", issue.getSummary()); 51 52 if (issue.getDescription() != null) { 53 String desc = issue.getDescription(); 54 // Truncate long descriptions for logging 55 if (desc.length() > 100) { 56 desc = desc.substring(0, 97) + "..."; 57 } 58 log.info("Description: {}", desc); 59 } 60 61 // Custom Fields 62 for (IssueField field : issue.getFields()) { 63 if (field.getName() != null && field.getName().equalsIgnoreCase("severity") && field.getValue() != null) { Reporter: PMD
Rule: LiteralsFirstInComparisons
Severity: WARN
File: /builds/aswi/aswi-2025/aswi2025skibidi-ohio-rizzlers/src/main/java/com/pump/jira/service/IssueService.java L63
Position literals first in String comparisons
Best Practices https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#literalsfirstincomparisons
100 if (description != null) { 101 log.info(" Description: {}", description); 102 } 103 } catch (Exception e) { 104 // Description method not available 105 } 106 107 // Try to get lead using reflection 108 try { 109 Object lead = component.getClass().getMethod("getLead").invoke(component); 110 if (lead != null) { 111 Object displayName = lead.getClass().getMethod("getDisplayName").invoke(lead); 112 Object name = lead.getClass().getMethod("getName").invoke(lead); 113 log.info(" Lead: {} ({})", displayName, name); 114 } 115 } catch (Exception e) { Reporter: PMD
Rule: EmptyCatchBlock
Severity: WARN
File: /builds/aswi/aswi-2025/aswi2025skibidi-ohio-rizzlers/src/main/java/com/pump/jira/service/ProjectService.java L115
Avoid empty catch blocks
Error Prone https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_errorprone.html#emptycatchblock
88 try { 89 Object id = component.getClass().getMethod("getId").invoke(component); 90 if (id != null) { 91 log.info(" ID: {}", id); 92 } 93 } catch (Exception e) { 94 // ID method not available 95 } 96 97 // Try to get description using reflection 98 try { 99 Object description = component.getClass().getMethod("getDescription").invoke(component); 100 if (description != null) { 101 log.info(" Description: {}", description); 102 } 103 } catch (Exception e) { Reporter: PMD
Rule: EmptyCatchBlock
Severity: WARN
File: /builds/aswi/aswi-2025/aswi2025skibidi-ohio-rizzlers/src/main/java/com/pump/jira/service/ProjectService.java L103
Avoid empty catch blocks
Error Prone https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_errorprone.html#emptycatchblock
78 } 79 } 80 81 // Log components 82 log.info("Components:"); 83 if (project.getComponents().iterator().hasNext()) { 84 for (BasicComponent component : project.getComponents()) { 85 log.info(" Component Name: {}", component.getName()); 86 87 // Try to get ID using reflection since API implementations may vary 88 try { 89 Object id = component.getClass().getMethod("getId").invoke(component); 90 if (id != null) { 91 log.info(" ID: {}", id); 92 } 93 } catch (Exception e) { Reporter: PMD
Rule: EmptyCatchBlock
Severity: WARN
File: /builds/aswi/aswi-2025/aswi2025skibidi-ohio-rizzlers/src/main/java/com/pump/jira/service/ProjectService.java L93
Avoid empty catch blocks
Error Prone https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_errorprone.html#emptycatchblock
Static Analysis Summary
PMD Overview Report
Total Violations: 25
SpotBugs Overview Report
Total Bugs: 8
mentioned in commit dcdf49e1