-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C#: Limit extracted compilation and extraction messages #15957
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
C#: Limit extracted compilation and extraction messages #15957
Conversation
csharp/extractor/Semmle.Extraction.CSharp/Entities/Compilations/CompilerDiagnostic.cs
Show resolved
Hide resolved
| protected override void Populate(TextWriter trapFile) | ||
| { | ||
| // The below doesn't limit the extractor messages to the exact limit, but it's good enough. | ||
| Interlocked.Increment(ref messageCount); |
Check notice
Code scanning / CodeQL
Static field written by instance method
| { | ||
| internal class CompilerDiagnostic : FreshEntity | ||
| { | ||
| private static readonly int limit = EnvironmentVariables.TryGetExtractorOption<int>("COMPILER_DIAGNOSTIC_LIMIT") ?? 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we introduce an extractor option for this? What should be the name for the option?
hvitved
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; one suggestion.
csharp/extractor/Semmle.Extraction.CSharp/Entities/Compilations/CompilerDiagnostic.cs
Show resolved
Hide resolved
csharp/extractor/Semmle.Extraction.CSharp/Entities/Compilations/CompilerDiagnostic.cs
Outdated
Show resolved
Hide resolved
|
@hvitved Can you have a look at the new commits in this PR. |


This PR reduces the number of extraction messages and compiler diagnostics that get stored in the database. I've added some env variables that can fine tune the limits, but I haven't introduced an extractor option for them.