Skip to content

C#: Refactor extractor state classes and simplify extraction code #16732

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

Merged
merged 6 commits into from
Jun 12, 2024

Conversation

tamasvajk
Copy link
Contributor

This pull request primarily involves changes to the Semmle.Extraction.CSharp project to improve the handling of extraction context. The changes include using a new ExtractionContext object instead of the previous Extractor object, adding new properties to the Analyser class, and updating method parameters and calls to use the new context. The changes aim to enhance the maintainability and readability of the codebase.

@github-actions github-actions bot added the C# label Jun 12, 2024
Comment on lines +194 to +197
catch (Exception e)
{
ExtractionContext.Logger.LogDebug($"Failed to compute absolute path for relative path in line mapping: '{mappedToPath}': {e}");
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
Comment on lines +152 to +155
catch (Exception ex) // lgtm[cs/catch-of-all-exceptions]
{
fileLogger.Log(Severity.Error, " Unhandled exception: {0}", ex);
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
@tamasvajk tamasvajk marked this pull request as ready for review June 12, 2024 11:24
@tamasvajk tamasvajk requested a review from a team as a code owner June 12, 2024 11:24
michaelnebel
michaelnebel previously approved these changes Jun 12, 2024
Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

LGTM!

{
Extractor = extractor;
ExtractionContext = extractor;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: rename parameter.

Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

LGTM!

@tamasvajk tamasvajk merged commit a756f86 into github:main Jun 12, 2024
16 checks passed
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