-
Notifications
You must be signed in to change notification settings - Fork 227
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
Rule S2234: Parameters should be passed in the correct order #2262
Conversation
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
|
||
namespace SonarAnalyzer.Helpers | ||
{ | ||
// todo: this should come from the Roslyn API (https://github.com/dotnet/roslyn/issues/9) | ||
internal class CSharpMethodParameterLookup | ||
internal class CSharpMethodParameterLookup : AbstractMethodParameterLookup<ArgumentSyntax> |
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.
Most of the code has been extracted and factorized in a base class.
sonaranalyzer-dotnet/src/SonarAnalyzer.VisualBasic/Rules/ParametersCorrectOrder.cs
Show resolved
Hide resolved
|
||
var memberAccess = methodCall.Expression as MemberAccessExpressionSyntax; | ||
Location getLocation() => | ||
memberAccess == null |
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.
partial test coverage
{ | ||
if (argumentList == null) | ||
{ | ||
return; |
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.
not covered by tests (is it possible?)
sonaranalyzer-dotnet/src/SonarAnalyzer.VisualBasic/Rules/MethodsShouldNotHaveTooManyLines.cs
Show resolved
Hide resolved
sonaranalyzer-dotnet/tests/SonarAnalyzer.UnitTest/TestCases/ParametersCorrectOrder.vb
Outdated
Show resolved
Hide resolved
sonaranalyzer-dotnet/src/SonarAnalyzer.Common/Rules/ParametersCorrectOrderBase.cs
Outdated
Show resolved
Hide resolved
sonaranalyzer-dotnet/src/SonarAnalyzer.Common/Rules/ParametersCorrectOrderBase.cs
Outdated
Show resolved
Hide resolved
sonaranalyzer-dotnet/src/SonarAnalyzer.VisualBasic/Helpers/VisualBasicMethodParameterLookup.cs
Outdated
Show resolved
Hide resolved
sonaranalyzer-dotnet/src/SonarAnalyzer.Common/Helpers/AbstractMethodParameterLookup.cs
Outdated
Show resolved
Hide resolved
sonaranalyzer-dotnet/src/SonarAnalyzer.CSharp/Rules/RedundantArgumentCodeFixProvider.cs
Show resolved
Hide resolved
fcce650
to
a9917ab
Compare
sonaranalyzer-dotnet/src/SonarAnalyzer.Common/Rules/ParametersCorrectOrderBase.cs
Outdated
Show resolved
Hide resolved
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!
Fix #2055