Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Sep 25, 2024
2 parents 9fe57b3 + a45b560 commit 37e1208
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rules/QW0017.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# QW0017: Apply arithmetic operations on non-nullables only

.NET allows arithmetic operations between nullable value types. The outcome of
those operations will potentially by `null` if any of the operants has no value
runtime. This behavior is commonly undesirable, and occurrences are not trivial
those operations will potentially be `null` if any of the operants has no value
at runtime. This behavior is usually undesirable, and occurrences are not trivial
to spot, potentially leading to bugs.
## Non-compliant

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

using Qowaiv.Financial;

class Noncompliant
Expand Down
2 changes: 1 addition & 1 deletion src/Qowaiv.CodeAnalysis.CSharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Contains [Roslyn](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/) (s
* [**QW0014** - Define global using statements separately](rules/QW0014.md)
* [**QW0015** - Define global using statements in single file](rules/QW0015.md)
* [**QW0016** - Prefer regular over positional properties](rules/QW0016.md)
* [**QW0017** - Apply arithmetic operations on non-nullables only ](rules/QW0017.md)
* [**QW0017** - Apply arithmetic operations on non-nullables only](rules/QW0017.md)

## Code fixes
* Use Qowaiv.Clock ([QW0001](rules/QW0001.md), [S6354](https://rules.sonarsource.com/csharp/RSPEC-6354))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Qowaiv.CodeAnalysis.Rules;
namespace Qowaiv.CodeAnalysis.Rules;

[DiagnosticAnalyzer(LanguageNames.CSharp)]
public sealed class ApplyArithmeticOperationsOnNonNullablesOnly() : CodingRule(Rule.ApplyArithmeticOperationsOnNonNullablesOnly)
Expand Down

0 comments on commit 37e1208

Please sign in to comment.