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

fix: include code quality issues #19

Merged
merged 2 commits into from
Apr 2, 2024
Merged

Conversation

teodora-sandu
Copy link
Contributor

@teodora-sandu teodora-sandu commented Apr 2, 2024

Adds code quality issues to the mock data returned by code-client-go.

Tested in VSCode with snyk/vscode-extension#449 Screenshot 2024-04-02 at 15 16 27

I will use it to test snyk/snyk-intellij-plugin#496 more comprehensively.
Screenshot 2024-04-02 at 16 07 20

@teodora-sandu teodora-sandu requested a review from cat2608 April 2, 2024 14:39
@teodora-sandu teodora-sandu requested a review from a team as a code owner April 2, 2024 14:39
@github-actions github-actions bot added the fix label Apr 2, 2024
@teodora-sandu teodora-sandu force-pushed the fix/code-quality-issues branch from c349980 to 6b765f4 Compare April 2, 2024 14:49
@teodora-sandu teodora-sandu force-pushed the fix/code-quality-issues branch from 6b765f4 to 54dbf6d Compare April 2, 2024 14:50
@github-actions github-actions bot added fix and removed fix labels Apr 2, 2024
Comment on lines -34 to +35
"id": "java/DontUsePrintStackTrace",
"name": "DontUsePrintStackTrace",
"id": "javascript/HardcodedNonCryptoSecret",
"name": "HardcodedNonCryptoSecret",
Copy link

Choose a reason for hiding this comment

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

Question: when we render the converted SARIF, we use IsSecurityType to identify if an issue is Vulnerability or Quality Issue. This IsSecurityType attribute is defined in the CodeIssueData struct where Message and ExampleCommitFixes are defined too. I can see Message and ExampleCommitFixes represented here in this fake.json file.

In this change what makes an issue to be identified as "Quality Issue"? The id?

https://github.com/snyk/snyk-ls/blob/main/infrastructure/code/code_html_test.go#L39-L45

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question! So this is the SARIF that gets returned, then the issue type is computed when we convert the SARIF to a snyk-ls issue based on the categories field in the SARIF: https://github.com/snyk/snyk-ls/blob/9d7d19ca1a7851b7b5ed363d2fb807245976f59b/infrastructure/code/convert.go#L100

@teodora-sandu teodora-sandu merged commit c1d508b into main Apr 2, 2024
11 checks passed
@teodora-sandu teodora-sandu deleted the fix/code-quality-issues branch April 2, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants