Coree.Analyzers.CodeClarity
0.1.5
See the version list below for details.
dotnet add package Coree.Analyzers.CodeClarity --version 0.1.5
NuGet\Install-Package Coree.Analyzers.CodeClarity -Version 0.1.5
<PackageReference Include="Coree.Analyzers.CodeClarity" Version="0.1.5"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Coree.Analyzers.CodeClarity" Version="0.1.5" />
<PackageReference Include="Coree.Analyzers.CodeClarity"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Coree.Analyzers.CodeClarity --version 0.1.5
#r "nuget: Coree.Analyzers.CodeClarity, 0.1.5"
#:package Coree.Analyzers.CodeClarity@0.1.5
#addin nuget:?package=Coree.Analyzers.CodeClarity&version=0.1.5
#tool nuget:?package=Coree.Analyzers.CodeClarity&version=0.1.5
Coree.Analyzers.CodeClarity
A return expression should stay directly readable. This package flags one that exceeds the allowed number of calculation steps. A parameter list should also stay in one shape: every parameter on one line, or each parameter starting on its own line.
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) |
| CCCPL001 | A parameter list that spans more than one line while one of those lines still starts more than one parameter |
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;
}
CCCPL001 looks at methods, local functions, constructors, and primary constructors of classes, structs, and records. Calls, indexers, delegates, and lambdas stay out of it. The first sample reports CCCPL001. The other three do not: one line, one parameter per line, or every parameter together on the following line.
public record TerrainProfile(float Amplitude, float FrequencyX, float FrequencyZ,
float DetailAmplitude, float DetailX, float DetailZ);
public record TerrainProfile(float Amplitude, float FrequencyX, float FrequencyZ, float DetailAmplitude, float DetailX, float DetailZ);
public void M(float a,
float b,
float c)
public void M(
float a, float b, float c)
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>
<ParameterListLayoutAnalyzerSeverity>warning</ParameterListLayoutAnalyzerSeverity>
</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.5 (2026-10-08)
- CCCPL001 flags a parameter list that spans more than one line while one of those lines still starts more than one parameter.
- Methods, local functions, constructors, and primary constructors of classes, structs, and records are in scope.
- Default severity is warning. Set ParameterListLayoutAnalyzerSeverity to warning, error, message, or off.
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.