Proj3002: Remove commented-out code
Commented-out code adds noise to a code file and makes it harder to follow the actual code that should be executed. Comments should be reserved to explain difficult to understand code or the reason for doing something out of the ordinary.
For code that is no longer needed, version control should be used instead.
Non-compliant
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<!-- ImplicitUsings>enable</ImplicitUsings -->
</PropertyGroup>
<ItemGroup>
<!-- Reconsider adding this
<PackageReference Include="DotNetProjectFile.Analyzers" Version="1.5.8" PrivateAssets="all" />
-->
<PackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="all" />
</ItemGroup>
</Project>
Compliant
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="all" />
</ItemGroup>
</Project>
Similar rules
This rule has been implemented for C#:
- S125 (Sonar)