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

Static analysis tool providers from Prospector Project #866

Merged
merged 12 commits into from
Sep 7, 2022

Conversation

sourabhsparkala
Copy link
Member

Fixes #730

"The score is N/A because the project does not confirm which languages are used.");
}

if (!languages.isUnknown() && !SUPPORTED_LANGUAGES.containsAnyOf(languages.get())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

!languages.isUnknown()

This is not needed right? Anyway the code will reach here only when !languages.isUnknown() :)

…cScanToolsDataProvider.java

Co-authored-by: ManjunathMS35 <[email protected]>
*/
private static final Pattern RUN_STEP_BANDIT_REGEX_PATTERN
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it nice to keep this and use it in line 38 and 40 rather than creating Pattern twice.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is a slight difference in these regular patterns, the key to search for in the step and then matching the value of the key. But again you are right about the redundancy, i did not find a better way to integrate one predicate and check for everything.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ManjunathMS35 lets fix this here #873 ?

Pattern.compile("^.*securego/gosec.*$", Pattern.DOTALL);

/** A step config of a GitHub action that triggers GoSec scans with include rule. */
private static final Pattern RUN_STEP_GOSEC_WITH_INCLUDE_REGEX_PATTERN =
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above isn't it nice to create these patterns once and use it in the class?

Copy link
Contributor

@ManjunathMS35 ManjunathMS35 left a comment

Choose a reason for hiding this comment

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

Except the minor comments, rest LGTM 👍

@sourabhsparkala sourabhsparkala merged commit 0421f12 into SAP:master Sep 7, 2022
@sourabhsparkala sourabhsparkala deleted the issue_730 branch September 7, 2022 13:59
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.

PoC: Prospector in Python projects
3 participants