Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sonar hotspots and secure-random sonar hotspot rule #433

Merged
merged 8 commits into from
Apr 3, 2024

Conversation

clavedeluna
Copy link
Contributor

@clavedeluna clavedeluna commented Apr 2, 2024

Overview

Add support for sonar hotspots and the first sonar hotspot, secure-random

Description

  • Secure random is the first sonar hotspots (a category separate from issues) that we support. While we have a CLI arg separately for a file for hotspots, internally these can be processed pretty much the same way with just some minor tweaking to existing code

Closes #376

Copy link

sonarqubecloud bot commented Apr 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@clavedeluna clavedeluna marked this pull request as ready for review April 3, 2024 14:37
@clavedeluna clavedeluna changed the title Secure sonar Support sonar hotspots and secure-random sonar hotspot rule Apr 3, 2024
Copy link
Member

@drdavella drdavella left a comment

Choose a reason for hiding this comment

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

Nice, looks great!

context.tool_result_files_map.get("sonar", [])
)
return self._lazy_cache


def process_sonar_findings(sonar_json_files: list[str]) -> SonarResultSet:
Copy link
Member

Choose a reason for hiding this comment

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

We could probably just use @functools.cache here and get rid of the _lazy_cache on the class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I swear I recall there was a reason this was written as is, I think @andrecsilva wrote it originally? because we also posed using @functools.cache at that time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

going to merge so I can use this PR to add more sonar codemods, but can come back to this if needed

@clavedeluna clavedeluna added this pull request to the merge queue Apr 3, 2024
Merged via the queue into main with commit 0d9fd81 Apr 3, 2024
12 checks passed
@clavedeluna clavedeluna deleted the secure-sonar branch April 3, 2024 16:48
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.

Sonar: fix using PNRGs with secure-random
2 participants