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
Add "IsWrittenTo" from Roslyn #8947
Add "IsWrittenTo" from Roslyn #8947
Conversation
….CSharp\Extensions\ExpressionSyntaxExtensions.Roslyn.cs
analyzers/src/SonarAnalyzer.Common/Helpers/CodeCopiedFromAttribute.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.Common/Helpers/CodeCopiedFromAttribute.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.Common/Helpers/CodeCopiedFromAttribute.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.Common/Helpers/CodeCopiedFromAttribute.cs
Outdated
Show resolved
Hide resolved
I can not get coverage support for <Class>
<Summary numSequencePoints="0" visitedSequencePoints="0" numBranchPoints="0" visitedBranchPoints="0" sequenceCoverage="0" branchCoverage="0" maxCyclomaticComplexity="16" minCyclomaticComplexity="1" visitedClasses="0" numClasses="0" visitedMethods="0" numMethods="6" minCrapScore="0" maxCrapScore="0" />
<FullName>Microsoft.CodeAnalysis.VisualBasic.Extensions.ExpressionSyntaxExtensions</FullName>
<Methods>
<Method skippedDueTo="Filter" visited="false" cyclomaticComplexity="16" nPathComplexity="0" sequenceCoverage="0" branchCoverage="0" isConstructor="false" isStatic="true" isGetter="false" isSetter="false" crapScore="272">
<Summary numSequencePoints="0" visitedSequencePoints="0" numBranchPoints="0" visitedBranchPoints="0" sequenceCoverage="0" branchCoverage="0" maxCyclomaticComplexity="0" minCyclomaticComplexity="0" visitedClasses="0" numClasses="0" visitedMethods="0" numMethods="0" minCrapScore="272" maxCrapScore="272" />
<MetadataToken>100663316</MetadataToken>
<Name>System.Boolean Microsoft.CodeAnalysis.VisualBasic.Extensions.ExpressionSyntaxExtensions::IsWrittenTo(Microsoft.CodeAnalysis.VisualBasic.Syntax.ExpressionSyntax,Microsoft.CodeAnalysis.SemanticModel,System.Threading.CancellationToken)</Name>
<SequencePoints />
<BranchPoints />
<MethodPoint vc="0" uspid="100663316" ordinal="0" offset="0" />
</Method>
<!-- .... --> For a class it looks like so: <Class skippedDueTo="Filter">
<Summary numSequencePoints="0" visitedSequencePoints="0" numBranchPoints="0" visitedBranchPoints="0" sequenceCoverage="0" branchCoverage="0" maxCyclomaticComplexity="0" minCyclomaticComplexity="0" visitedClasses="0" numClasses="0" visitedMethods="0" numMethods="0" minCrapScore="0" maxCrapScore="0" />
<FullName>Microsoft.CodeAnalysis.CSharp.Extensions.ExpressionSyntaxExtensions</FullName>
<Methods />
</Class> But in SonarCloud it is still reported as "uncovered by tests" in both cases. |
Please also check the accepted issues: |
analyzers/src/SonarAnalyzer.VisualBasic/Facade/VisualBasicSyntaxFacade.cs
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.VisualBasic/Facade/VisualBasicSyntaxFacade.cs
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.VisualBasic/Extensions/SyntaxNodeExtensions.Roslyn.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.VisualBasic/Extensions/SyntaxNodeExtensions.Roslyn.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.VisualBasic/Extensions/ExpressionSyntaxExtensions.Roslyn.cs
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/Extensions/ExpressionSyntaxExtensions.Roslyn.cs
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.VisualBasic/Extensions/ExpressionSyntaxExtensions.Roslyn.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/Extensions/SyntaxNodeExtensions.Roslyn.cs
Show resolved
Hide resolved
@martin-strecker-sonarsource public override bool IsWrittenTo(SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken) =>
Cast<ExpressionSyntax>(expression).IsWrittenTo(semanticModel, cancellationToken); While the Basic tests, just to make sure that the underlying extension method is called. What do you think? |
Such tests are included in #8950 |
Quality Gate passedIssues Measures |
Quality Gate failedFailed conditions |
Discussed offline, @martin-strecker-sonarsource is removing the attribute from this PR, as S6932 depends on this PR being delivered. We are going to reintroduce the attribute in a later PR. @martin-strecker-sonarsource Do we have already an issue in the backlog to cover that gap? Can you please mention it in the description of this PR? |
Alright, that means however that this PR will need to be merged by a champion. |
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! Let's merge this one and unblock the following PRs.
@zsolt-kolbay-sonarsource I would suggest to merge and not wait for a second review, given how late we are with this and how much depend on this PR. The quality of the PR is really good, the approach has been extensively discussed in the "How We Work" circle.
@martin-strecker-sonarsource Please, check this comment
@costin-zaharia-sonarsource Please check this comment
5631cb6
into
feature/New_S6932
|
Pre-Condition for "ArgumentDescriptor"
CodeCopiedFrom attribute was removed before merge. The issue to re-introduce it is here:
#9201