Skip to content

Add a parser for AWS CodeGuru Security JSON output#1515

Merged
uhafner merged 5 commits into
jenkinsci:mainfrom
akash-manna-sky:aws-codeguru
May 14, 2026
Merged

Add a parser for AWS CodeGuru Security JSON output#1515
uhafner merged 5 commits into
jenkinsci:mainfrom
akash-manna-sky:aws-codeguru

Conversation

@akash-manna-sky

Copy link
Copy Markdown
Contributor

Add a parser for AWS CodeGuru Security JSON output

See : https://docs.aws.amazon.com/cli/latest/reference/codeguru-security/get-findings.html

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@akash-manna-sky
akash-manna-sky marked this pull request as ready for review May 13, 2026 07:24
@uhafner uhafner added the feature New features label May 14, 2026

@uhafner uhafner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just some minor comments...

Comment on lines +68 to +71
var filePath = vulnerability == null ? null : vulnerability.optJSONObject(FILE_PATH);

issueBuilder
.setFileName(firstNonBlank(filePath, PATH, NAME))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks strange, it would make sense to replace it with:

Suggested change
var filePath = vulnerability == null ? null : vulnerability.optJSONObject(FILE_PATH);
issueBuilder
.setFileName(firstNonBlank(filePath, PATH, NAME))
if (vulnerability != null) {
var fileName = firstNonBlank(vulnerability.optJSONObject(FILE_PATH), PATH, NAME);
issueBuilder.setFileName(fileName);
if (!fileName.isEmpty()) {
issueBuilder.setLineStart(filePath.optInt(START_LINE, 0))
.setLineEnd(filePath.optInt(END_LINE, 0));
}
}

Comment on lines +77 to +80
if (filePath != null) {
issueBuilder.setLineStart(filePath.optInt(START_LINE, 0))
.setLineEnd(filePath.optInt(END_LINE, 0));
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

}

@CheckForNull
private String formatSuggestedFix(final JSONObject suggestedFix) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private String formatSuggestedFix(final JSONObject suggestedFix) {
private String formatSuggestedFix(@CheckForNull final JSONObject suggestedFix) {

}
}

private void appendSuggestedFixes(final List<String> sections, final JSONArray suggestedFixes) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private void appendSuggestedFixes(final List<String> sections, final JSONArray suggestedFixes) {
private void appendSuggestedFixes(final List<String> sections, @CheckForNull final JSONArray suggestedFixes) {

…file paths and enhance suggested fix formatting
@github-actions
github-actions Bot requested a review from uhafner May 14, 2026 17:13
Comment on lines +84 to +86
else {
issueBuilder.setFileName("");
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry! now I removed the redundant else block to keep it default.

@github-actions
github-actions Bot requested a review from uhafner May 14, 2026 19:11
@github-actions

Copy link
Copy Markdown

☀️   Quality Monitor

Tests

   JUnit   Unit Tests: ✅ successful — 1728 passed, 2 skipped
   ⛔   Architecture Tests: ✅ successful — 12 passed

Coverage for New Code

   〰️   Line Coverage: 100.00% — perfect 🎉
   ➰   Branch Coverage: 100.00% — perfect 🎉

Coverage for Whole Project

   〰️   Line Coverage: 94.23% — 504 missed lines
   ➰   Branch Coverage: 87.76% — 384 missed branches

Style

   CheckStyle   CheckStyle: No warnings
   PMD   PMD: No warnings
   ☕   Java Compiler: No warnings

Bugs

   SpotBugs   SpotBugs: No bugs
   🐛   Error Prone: No bugs

API Problems

   🚫   Revapi: No warnings

Vulnerabilities

   🛡️   OWASP Dependency Check: No vulnerabilities

Software Metrics

   🌀   Cyclomatic Complexity: 3247 (total)
   💭   Cognitive Complexity: 1831 (total)
   ➿   N-Path Complexity: 4444 (total)
   📏   Lines of Code: 31728 (total)
   📝   Non Commenting Source Statements: 11947 (total)
   🔗   Class Cohesion: 100.00% (maximum)
   ⚖️   Weight of Class: 100.00% (maximum)

🚦 Quality Gates

Overall Status: ✅ SUCCESS

✅ Passed Gates

  • ✅ Overall Tests Success Rate: 100.00 >= 100.00
  • ✅ Line Coverage in New Code: 100.00 >= 90.00
  • ✅ Branch Coverage in New Code: 100.00 >= 90.00
  • ✅ Potential Bugs in Whole Project: 0.00 <= 0.00
  • ✅ Style Violation in Whole Project: 0.00 <= 0.00

Created by Quality Monitor v4.11.0 (#484bbba). More details are shown in the GitHub Checks Result.

@uhafner
uhafner merged commit 8512761 into jenkinsci:main May 14, 2026
30 checks passed
@akash-manna-sky
akash-manna-sky deleted the aws-codeguru branch May 16, 2026 08:04
@akash-manna-sky

Copy link
Copy Markdown
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants