Coree.Analyzers.CodeClarity
0.1.4
See the version list below for details.
dotnet add package Coree.Analyzers.CodeClarity --version 0.1.4
NuGet\Install-Package Coree.Analyzers.CodeClarity -Version 0.1.4
<PackageReference Include="Coree.Analyzers.CodeClarity" Version="0.1.4"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Coree.Analyzers.CodeClarity" Version="0.1.4" />
<PackageReference Include="Coree.Analyzers.CodeClarity"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Coree.Analyzers.CodeClarity --version 0.1.4
#r "nuget: Coree.Analyzers.CodeClarity, 0.1.4"
#:package Coree.Analyzers.CodeClarity@0.1.4
#addin nuget:?package=Coree.Analyzers.CodeClarity&version=0.1.4
#tool nuget:?package=Coree.Analyzers.CodeClarity&version=0.1.4
Coree.Analyzers.CodeClarity
A return expression should stay directly readable. This package flags one that exceeds the allowed number of calculation steps.
dotnet add package Coree.Analyzers.CodeClarity
Example in a project file. The version 0.1.2 is the one shown here:
<ItemGroup>
<PackageReference Include="Coree.Analyzers.CodeClarity" Version="0.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
Diagnostics
| Id | What it flags |
|---|---|
| CCCRC001 | A return expression whose calculation-step score exceeds ReturnTypeComplexityAnalyzerMaximum (default 1) |
Arithmetic other than string concatenation, method calls other than nameof, and conditional operators each count as one step. Casts, signs, await, member access, and identifiers do not. Default severity is warning.
At the default maximum of 1, return a + b stays quiet, and so does return total. return a + b + c reports CCCRC001. total is a local; that return is only the name.
int OneStep(int a, int b)
{
return a + b;
}
int TwoSteps(int a, int b, int c)
{
return a + b + c;
}
int FromLocal(int a, int b, int c)
{
int total = a + b + c;
return total;
}
MSBuild properties
Set these on the consuming compile target. The shipped props make them compiler-visible. Severity: warning, error, message, or off. An empty, negative, or non-numeric maximum keeps the default of 1.
<PropertyGroup>
<ReturnTypeComplexityAnalyzerSeverity>warning</ReturnTypeComplexityAnalyzerSeverity>
<ReturnTypeComplexityAnalyzerMaximum>1</ReturnTypeComplexityAnalyzerMaximum>
</PropertyGroup>
Repository: https://github.com/carsten-riedel/Coree.Analyzers
License: MIT
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
0.1 (2026-10-07)
- Initial release.
- CCCRC001 flags a return expression whose calculation-step score exceeds ReturnTypeComplexityAnalyzerMaximum (default 1).
- String concatenation and nameof do not count. One arithmetic operator, one method call, or one conditional is allowed at the default.
- Default severity is warning; set warning, error, message, or off.