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

S3900: ShouldExecute method #6942

Merged
merged 39 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
252f90e
Implement ShouldExecute method
zsolt-kolbay-sonarsource Mar 16, 2023
ac8b5b9
Simplify accessibility checks
zsolt-kolbay-sonarsource Mar 16, 2023
f771f6b
Add test cases for accessibility
zsolt-kolbay-sonarsource Mar 16, 2023
19f3a6e
Review: formatting and indexers
zsolt-kolbay-sonarsource Mar 17, 2023
92f36d9
Review: IsKind -> IsAnyKind
zsolt-kolbay-sonarsource Mar 17, 2023
4b74bab
Review: simplify method calls
zsolt-kolbay-sonarsource Mar 17, 2023
d7aa6da
Review: update test cases
zsolt-kolbay-sonarsource Mar 17, 2023
58b2aec
Review: add test case for event handlers
zsolt-kolbay-sonarsource Mar 20, 2023
1e44ba6
Review: skip static local functions and static lambdas
zsolt-kolbay-sonarsource Mar 21, 2023
4eac184
Review: exclude out parameters
zsolt-kolbay-sonarsource Mar 21, 2023
9cf28ba
Review: change identifier parent check
zsolt-kolbay-sonarsource Mar 21, 2023
920a1db
Review: fix typo
zsolt-kolbay-sonarsource Mar 21, 2023
d9aade8
Review: support unsafe member access
zsolt-kolbay-sonarsource Mar 22, 2023
f1f461b
Review: fix test case
zsolt-kolbay-sonarsource Mar 22, 2023
ee50411
Review: remove support unsafe pointer access
zsolt-kolbay-sonarsource Mar 22, 2023
07cbfe2
Review: simplify check for out parameters
zsolt-kolbay-sonarsource Mar 22, 2023
8302f0c
Review: check file accessibility
zsolt-kolbay-sonarsource Mar 22, 2023
1293d4f
Review: re-add unsafe method check
zsolt-kolbay-sonarsource Mar 22, 2023
7727165
Review: add more test cases for file modifier
zsolt-kolbay-sonarsource Mar 23, 2023
04d83e1
Remove support for unsafe code (SE doesn't fully support unsafe membe…
zsolt-kolbay-sonarsource Mar 23, 2023
9bb566f
Review: add accessibility test cases
zsolt-kolbay-sonarsource Mar 23, 2023
5ca2e7a
Review: change accessibility check
zsolt-kolbay-sonarsource Mar 23, 2023
d4c590c
Remove unnecessary checks
zsolt-kolbay-sonarsource Mar 23, 2023
d1129e5
Review: remove trailing whitespace
zsolt-kolbay-sonarsource Mar 23, 2023
075267e
Review: remove static modifiers
zsolt-kolbay-sonarsource Mar 23, 2023
f3653b5
Review: check lambdas + formatting
zsolt-kolbay-sonarsource Mar 24, 2023
f00d2fa
Review: add test cases for anonym methods
zsolt-kolbay-sonarsource Mar 24, 2023
038675f
Review: add test case for static lambda and deeper nested classes
zsolt-kolbay-sonarsource Mar 24, 2023
3aafe46
Review: remove unused method
zsolt-kolbay-sonarsource Mar 24, 2023
2ee8f93
Review: simplify lambda test cases
zsolt-kolbay-sonarsource Mar 24, 2023
d71ba7a
Review: move expression to a single line
zsolt-kolbay-sonarsource Mar 24, 2023
860775d
Review: refactor MethodDereferencesArguments method
zsolt-kolbay-sonarsource Mar 24, 2023
a860ce0
Review: simplify syntax tree traversal
zsolt-kolbay-sonarsource Mar 24, 2023
d0bbd81
Simplify enum access
zsolt-kolbay-sonarsource Mar 24, 2023
024fe9c
Review: use HashSet instead of array
zsolt-kolbay-sonarsource Mar 27, 2023
0d1eec8
Update test cases and formatting
zsolt-kolbay-sonarsource Mar 27, 2023
0ed8e7e
Update ITs
zsolt-kolbay-sonarsource Mar 27, 2023
ee347d8
Remove unneede file
zsolt-kolbay-sonarsource Mar 27, 2023
1daac54
Re-add PreProcess method
zsolt-kolbay-sonarsource Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
388 changes: 311 additions & 77 deletions analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json

Large diffs are not rendered by default.

388 changes: 311 additions & 77 deletions analyzers/its/expected/Automapper/AutoMapper--netstandard2.0-S3900.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
"issues": [
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'other' before using it.",
"location": {
"uri": "sources\Ember-MM\Ember.Plugins\PluginManager.cs",
"region": {
"startLine": 343,
Comment on lines +7 to +9
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting FP, we don't support Object.ReferenceEquals

            public bool Equals(EmberPlugin other)
            {
                if (Object.ReferenceEquals(this, other))
                    return true;

                if (Object.ReferenceEquals(other, null))
                    return false;

                return this.Plugin.GetType() == other.Plugin.GetType();
            }

"startColumn": 49,
"endLine": 343,
"endColumn": 54
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'section' before using it.",
"location": {
"uri": "sources\Ember-MM\Ember.Plugins\PluginSectionHandler.cs",
Expand Down