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

Temporary Suppressions generator seems to count occurrences wrong #47

Open
JKrag opened this issue Oct 19, 2021 · 1 comment
Open

Temporary Suppressions generator seems to count occurrences wrong #47

JKrag opened this issue Oct 19, 2021 · 1 comment
Assignees

Comments

@JKrag
Copy link
Contributor

JKrag commented Oct 19, 2021

When running the updater with --useTemporarySuppresions, it adds lines to .editorconfig for each violating rule. The comment generated for each violation includes the number of occurrences found. This is quite useful when triaging which problems are easy to attack and clean up.
I have however seen a few examples where the updater vastly underestimates the number of violations. E.g. my .editorconfig after running mentioned "# occurrences 13 ..." for SA1503, but when I commented out the suppression, and rana build, there were way over 50 errors.

I am running on a solution with 5 projects, so maybe the updater is just counting the occurrences in the first project it finds, generating the exclusion, and then somehow not adding to the number for later projects analysed? (pure guess)

This is not a critical issue by any means, but worth looking at if this part of the code is revisited for other reasons.
If the generator bothers to mention the number of occurrences, it does look better if it is actually correct 😄

@JKrag
Copy link
Contributor Author

JKrag commented Oct 19, 2021

Another observation seems to reinforce my multi-project theory.
I found a case where it had found 1 occurrence for SA1122, but when I removed the exclusion, VS found 7 errors. Exactly 1 of these was in the first mentioned project, and 6 more were found in a different project.

If fixed the occurrence in the first project, and 2 of the ones in the second project and re-ran the updater. Now it correctly identifies the 4 remaining occurrences.

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