Skip to content

Improve S4057: First perform a syntax check before calling semantic model for object creations #5924

Open
@mary-georgiou-sonarsource

Description

S4057 is processing all the object creations in a source file.

For each object creation, the rule is querying the semantic model.

Based on the fact that the rule is interested only in two particular types, System.Data.DataTable and System.Data.DataSet, it would be better to first filter the object creation on a syntax level. Then if they belong to one of those types, the semantic model can be called.

This change will increase the performance of the rule.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions