-
Notifications
You must be signed in to change notification settings - Fork 223
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
SE: Add Plus- and MinusOperation for literals #7174
Conversation
0ea5055
to
b529eb3
Compare
I added elementary tests only because the engine is still very limited. We need to add more in-depth tests later when it is easier to create |
0750b3d
to
d048521
Compare
Can you add it as a checkbox on the issue itself? We can park the card back to "ToDo" if the ranges are not ready in time. |
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.
Round 1 :)
analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/OperationProcessors/Binary.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/OperationProcessors/Binary.cs
Outdated
Show resolved
Hide resolved
.../tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/RoslynSymbolicExecutionTest.Binary.cs
Outdated
Show resolved
Hide resolved
.../tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/RoslynSymbolicExecutionTest.Binary.cs
Outdated
Show resolved
Hide resolved
.../tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/RoslynSymbolicExecutionTest.Binary.cs
Outdated
Show resolved
Hide resolved
.../tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/RoslynSymbolicExecutionTest.Binary.cs
Outdated
Show resolved
Hide resolved
.../tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/RoslynSymbolicExecutionTest.Binary.cs
Outdated
Show resolved
Hide resolved
2b3af3b
to
c007313
Compare
I had to rewrite part of the code because I realized that we need to swap the order of the operators for substractions. |
18d4bd5
to
75d8422
Compare
75d8422
to
6ef62e3
Compare
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.
One more round of polishing of the collateral stuff
analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Constraints/NumberConstraint.cs
Show resolved
Hide resolved
analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Constraints/NumberConstraintTest.cs
Outdated
Show resolved
Hide resolved
analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Constraints/NumberConstraintTest.cs
Outdated
Show resolved
Hide resolved
Monitor.Enter(Other) ' FN, exploration stopped after loop | ||
If Condition Then Monitor.Exit(Other) |
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.
Every lost Noncompliant should have these two lines too
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.
I will add it. Can you elaborate on your reason, though? I am trying to understand why the comment is insufficient for the other cases.
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.
To demonstrate, that we stop exploring whatever follows. There are two problems:
- 1st related to the content of the For loop. And that is FN for one reason.
- 2nd related to the fact that we don't explore code after
For
loop
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.
The two cases that did not have the additional two lines are not FNs or FPs, though. They are just regular Noncompliant cases.
analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/ProgramState.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/OperationProcessors/Binary.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/OperationProcessors/Binary.cs
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! |
Kudos, SonarCloud Quality Gate passed! |
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
Part 1 of #7141