Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CA1801 vs IDE0060

In VS 2019, unused parameters are now showing two issues in the "Error List" instead on one: CA1801, which appears as a warning, and IDE0060, which appears as a suggestion.

Do these analysis rules do the same thing? If not, how are they different. If so, why are they duplicated?

like image 607
Dan Friedman Avatar asked Jun 18 '19 14:06

Dan Friedman


1 Answers

Different tools, different implementations of the same idea. The duplication is caused by the rule being implemented by both Visual Studio (IDE0060) and FxCop (CA1801). Yet another duplicate comes from SonarQube analyzers (S1172).

The FxCop rule is also implemented by the legacy code analysis, which is not based on Roslyn. This implementation differs in details as described in the CA1801 rule's documentation. Same rule name, different implementations.

Being separate implementations, they all most probably differ in details. I don't think these details should matter much -- the intent behind the rules is the same.

like image 70
Palec Avatar answered Oct 11 '22 12:10

Palec