Skip to content

Fix sonar report invalid text range (AST-170299) - #1554

Merged
cx-rakesh-kadu merged 11 commits into
mainfrom
bug/AST-170299-signed
Sep 1, 2026
Merged

Fix sonar report invalid text range (AST-170299)#1554
cx-rakesh-kadu merged 11 commits into
mainfrom
bug/AST-170299-signed

Conversation

@cx-rakesh-kadu

@cx-rakesh-kadu cx-rakesh-kadu commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Replaces #1553 (branch name rejected: must start with bug/, feature/, or other/) and #1548 (blocked from merging because history contained unsigned commits, and the org ruleset on Bug/AST-170299 disallows force-push to rewrite them). Same diff, same authors — commits re-signed on a correctly-named branch.

Description

Fixes cx results show --report-format sonar writing invalid SonarQube text ranges. endColumn was computed as column + length with no bound against the real source line length, so a single overflowing location made SonarQube's importer throw IllegalArgumentException and abort the whole report — losing every Checkmarx and SonarQube finding. The fix reads the real source line and clamps the column range to it (or drops just that one location) before writing the report.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Related Issues

https://checkmarx.atlassian.net/browse/AST-170299

Checklist

  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • The correct base branch is being used
    AST-170299-Test-Report.docx

@cx-sumit-morchhale cx-sumit-morchhale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok

@cx-harshjeet-patil cx-harshjeet-patil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay

@cx-rakesh-kadu
cx-rakesh-kadu merged commit 8e2f78a into main Sep 1, 2026
44 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants