Skip to content

Releases: SonarSource/sonar-dotnet

10.4

18 Dec 10:12
Compare
Choose a tag to compare

Improvements

In this release, we have added support for test density and metrics at the individual file level. You can now view the number of unit tests, as well as details on skipped tests, failed tests, and test duration, from all supported coverage tools (xUnit, MsTest, and nUnit).

Additionally, we have significantly optimized memory allocation, resulting in memory usage reduction during registration.

False Positive

  • NET-868 - Fix S1854 FP: Don't raise when inner finally assignment is used to outer block
  • NET-865 - Fix S1172 FP: Parameter used as extension delegate target
  • NET-863 - Fix S1172 FP: Don't report on partial method parameters
  • NET-862 - Fix S1854 FP: Don't raise in catch when variable is used in following catch
  • NET-857 - Fix S3655 FP: Types with implicit conversion operator
  • NET-836 - Fix S1854 FP: Value used after catch

False Negative

Task

  • NET-763 - Update RSPEC before 10.4 release

10.3

02 Dec 09:19
Compare
Choose a tag to compare

False Positive

  • NET-675 - Fix S1144 FP: support struct constructor calls
  • NET-499 Telemetry: Report Language version and target framework

Other

10.2

02 Dec 09:18
Compare
Choose a tag to compare

New Rules

  • NET-635 - [C#] New rule S6418 for C#: Hard-coded secrets are security-sensitive

Improvement

  • NET-567 - Remove S6605 from SonarWay profile and update the RSPEC to mention that the rule makes sense only for .NET versions <9
  • NET-566 - Remove S6603 from SonarWay profile and update the RSPEC to mention that the rule makes sense only for .NET versions <9
  • NET-407 - S2551: Improve RSpec recommendation
  • NET-226 - S3878: Improve RSPEC to include collection expressions
  • NET-528 - MetricAnalyzer: Line numbers does not respect ExcludeFromCodeCoverage for partial properties
  • NET-527 - MetricAnalyzer: Function count should not count partial property declaration parts

False Positive

  • NET-553 - Fix S4260 FP: Do not raise twice for partial properties
  • NET-543 - Fix S4059 FP: Do not raise twice for partial properties
  • NET-534 - Fix S3353 FP: Support ref locals
  • NET-456 - Fix S2292 FP: Do not raise on partial properties
  • NET-389 - Fix S2386 FP: support 'ReadOnlySet'
  • NET-388 - Fix S3887 FP: support 'ReadOnlySet'
  • NET-356 - Fix S3878 FP: support 'param' with implicit custom methods
  • NET-568 - Remove S6602 from SonarWay profile and update the RSPEC to mention that the rule makes sense only for .NET versions <9
  • NET-601 - Fix S4275 FP: Support &= assignment

False Negative

  • NET-550 - SymbolReferenceAnalyzer: References to partial declarations are not detected
  • NET-416 - Fix S2201 FN: Add support for FrozenSet
  • NET-368 - Fix S4015 FN: Does not trigger on indexers
  • NET-359 - Fix S4545 FN: Escape chars and new lines breaks DebuggerDisplay

10.1

02 Dec 09:18
Compare
Choose a tag to compare

False Negative

  • NET-228 - S5856: Support Regex.EnumerateSplits and Regex.EnumerateMatches
  • NET-227 - S6444: Support Regex.EnumerateSplits and Regex.EnumerateMatches

10.0

02 Dec 09:16
Compare
Choose a tag to compare

New rule

  • NET-24 - New Rule S7039: Content Security Policies should be restrictive

False negatives

False positives

  • NET-402 - Fix S2953 FP: Implement IDisposable.Dispose on extension methods static class
  • NET-165 - Fix S4144 FP: Methods with different return types
  • NET-108 - Fix S3963 FP: Tuple assignments
  • NET-125 - Fix S2933 FP: Assignment to this
  • NET-265 - Fix S1144 FP: Public indexer in nested class used in parent class
  • NET-265 - Fix S6967 FP: Methods with string, object and dynamic arguments
  • NET-278 - Fix S2629 FP: Do not raise on log4net.Error(Exception)
  • NET-405 - Fix S3459 FP: Support @ref bindings in razor files / partial Blazor components

Bug

  • NET-29 - Fix AD0001: NullReferenceException is thrown in S1871

Improvements

  • NET-63 - Rule S5693: Extend the rule to support OpenReadStream

9.32

14 Aug 09:00
cc0ba76
Compare
Choose a tag to compare

This rule includes the promotion of 4 rules to Sonar-way, the deprecation of 1 rule and 2 FP fixes.

Rule Promotions and Deprecations

False Positive

  • 9590 - [C#] Fix S6966 FP: EntityFrameworks IDbContextFactory CreateDbContext method is preferred over its Async counterpart
  • 8300 - [C#] Fix S3431 FP: Don't raise if assertions are done in catch or finally

9.31

06 Aug 13:39
b0e8a3f
Compare
Choose a tag to compare

This release focuses on improving the SonarQube plugin for the .NET analyzers.

Improvements

  • 9558 - SQ Plugin: Load STIG standard after ACOMMONS-11 is done
  • 8503 - SQ Plugin: Align logging for not indexed files
  • 7798 - SQ Plugin: Remove the sonar runtime checks for versions prior 9.9
  • 7115 - SQ Plugin: Replace org.sonar.api.utils.log.Logger
  • 4687 - SQ Plugin: Add xunit report paths in products UI
  • 4685 - SQ Plugin: Remove deprecated import of integration test coverage from plugins
  • 3102 - SQ Plugin: Replace usages of deprecated Build.setProfile in the integration tests
  • 8032 - SQ Plugin: Update the plugin to store the hash for the .cshtml files to enable incremental PR analysis

9.30

23 Jul 08:20
78d3ae4
Compare
Choose a tag to compare

Hello, everyone. In this release, we worked on hardening our live variable analysis, which improved the analyzer's accuracy.

False Positives

  • 9473 - Fix S1854 FP: Raises when a variable is reassigned in a using body after it has been already assigned in using statement
  • 9472 - Fix S1854 FP: Raises when a variable is assigned in the switch statement and not used in the first case
  • 9471 - Fix S1854 FP: Raises when a variable is assigned in expression that is part of the ternary condition
  • 9468 - Fix S1854 FP: Throw should connect to outer catch
  • 9466 - Fix S1854 FP: Throw should visit finally

9.29

12 Jul 09:41
8841016
Compare
Choose a tag to compare

This release includes a lot of false positive and false negative fixes.

Improvements

  • 2120 - [C#] Improve S3247: Rule should recommend pattern matching for new C# instead of as
  • 9465 - Update RSPEC before 9.29 release

False Positive

  • 7522 - [C#] Fix S1104 FP: Do not report in Unity3D serializable classes
  • 6990 - [C#] Fix S1144 FP: Event with a concrete sender
  • 3842 - [C#] Fix S1144 FP: Ignore unused Deconstruct methods
  • 8239 - [C#] Fix S1450 FP: When field is assigned value in event handler
  • 9494 - [C#] Fix S1694 FP: Abstract class with field or constructor
  • 9421 - [C#] Fix S1694 FP: Protected abstract methods
  • 3605 - [C#] Fix S2219 FP: Is operator used for pattern matching
  • 8266 - [C#] Fix S2259 FP: SE engine doesn't take into account element existence collection methods
  • 9485 - [C#] Fix S3247 FP: Should not report on member access objects
  • 6343 - [C#] Fix S3963 FP: Static constructor with conditional and no static field initialization
  • 7961 - [C#, VB.NET] Fix S2699 FP: Support Moq

False Negative

  • 9491 - [C#] Fix S3247 FN: When cast expression contains parentheses
  •   223 - [C#] Fix S3247 FN: Rule should catch more duplicated cast

9.28

26 Jun 15:32
242b97c
Compare
Choose a tag to compare

False Positive

  • 9432 - [C#] Fix S1144 FP: Unused fields in class with StructLayout when struct is in deep hierarchy class
  • 9379 - [C#] Fix S1144 FP: Diagnostic doesn't respect reflection with DynamicallyAccessedMembers attribute
  • 8342 - [C#] Fix S1144 FP: Private Attributes
  • 7068 - [C#] Fix S4144 FP: when type constraints are used
  • 3050 - [C#] Fix S1479 FP: Single line case clause should be ignored
  • 9447 - [C#] Fix S1854 FP: Value used in catch or when should LiveIn for all try blocks
  • 9440 - [C#] Fix S1854 FP: Value used in finally should LiveIn for all try blocks
  • 4948 - [C#] Fix S1854 FP: Value used in finally should LiveIn after throw
  • 6894 - [C#, VB.NET] Fix S3878 FP: When non-object array is passed to object[] params as first argument
  • 6893 - [C#, VB.NET] Fix S3878 FP: when a params argument is named

False Negative

  • 8719 - [C#, VB.NET] Fix S2583/S2589 FN: try-catch in loop, LVA purges symbol prematurely
  • 4940 - [C#] Fix S1854 FN: Proper support of try/catch statements
  • 1255 - [C#] Fix S1871 FN: Support single line conditional block