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

C#: Include ASP.NET assemblies in the standalone extraction. #13876

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Aug 3, 2023

This PR also contains a couple of bugfixes:

  • We can't use the ASP.NET runtime as the "entire" runtime (this is not a replacement for the .NET runtime). It needs to be used in conjunction with the .NET runtime.
  • Whitespaces in regular expressions needs to be generalized.

@github-actions github-actions bot added the C# label Aug 3, 2023
Comment on lines 345 to 352
foreach (var valueMatch in regex.EnumerateMatches(line))
{
// We can't get the group from the ValueMatch, so doing it manually:
if (GetGroup(line, valueMatch, groupPrefix) == value)
{
return true;
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where Note

This foreach loop
implicitly filters its target sequence
- consider filtering the sequence explicitly using '.Where(...)'.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually an error with the quality query.

  1. In this case the type of regex.EnumerateMatches(line) is not an IEnumerable which means that we can't use the Linq extensions methods.
  2. The statement in the loop uses early return.

Comment on lines +381 to +384
catch (Exception ex)
{
progressMonitor.FailedToReadFile(file, ex);
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are many different possible exceptions and we want to just catch all in case the file read fails.

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.

None yet

1 participant