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

Missing rules for C file #5

Open
mMontu opened this issue Aug 8, 2024 · 2 comments
Open

Missing rules for C file #5

mMontu opened this issue Aug 8, 2024 · 2 comments

Comments

@mMontu
Copy link

mMontu commented Aug 8, 2024

Hi, thanks for providing this plugin!
Just installed it, and noticed it works well with python and C.

I've noticed that despite it display some issues for C files, such as

"Remove the commented out code. (sonarlint c:S125)"
"data argument not used by format string (sonarlint c:S3457)"

, it does not show some others, such as Using "strcpy" or "wcscpy" is security-sensitive, even if the issue is clearly in the code:

char *str_cpy = malloc(length);
strncpy(str_cpy, str_cpy, length);
strcpy(str_cpy, str_cpy);
strcpy(str_cpy, null);

Any ideas on how to fix (or debug) this problem?
It seems there is no output, even with sonarlint.output.showVerboseLogs and sonarlint.output.showAnalyzerLogs enabled.

@asmodeus812
Copy link
Owner

Hi, Have you checked if the rule is enabled in the list of rules by default? The extension provides actions to check all rules or for specific language. If you do not see it there, it might be either sonarls bug or the rule is introduced in a newer version of sonarls than the one built in the extension.

@mMontu
Copy link
Author

mMontu commented Aug 9, 2024

I saw it is on the list following the link "C rules" on the README of this repo.
The results are the same with the latest sonarls (using the sonarlint.ls.directly option).

Searching the rule code S5801 on the sonarls provided by this extension shows some results, such as analyzers/org/sonar/l10n/cpp/rules/RulesList.json -- it seems it is known to the language server.
So I guess it is a sonarls bug.

Thanks

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

No branches or pull requests

2 participants