sonar-dotnet icon indicating copy to clipboard operation
sonar-dotnet copied to clipboard

Update S2365: Rule should report on new collection

Open Evangelink opened this issue 6 years ago • 2 comments

Description

The S2365 rule should be improved to start raising on cases where the property returns a new collection from one of the field collection.

public List<string> People => new List<string>(_people);

as we currently report on

public List<string> People => _people.ToList();

Evangelink avatar Jan 04 '19 17:01 Evangelink

https://rules.sonarsource.com/csharp/RSPEC-2365

@Evangelink Please add same rule for ToDictionary/ToArray/ToLookup/ToHashSet etc

sm-g avatar Oct 28 '19 05:10 sm-g

This issue will be tracked in NET-1261 (not publicly accessible)