NDepend.API Documentation
ILCyclomaticComplexity Property (IMethod)
NDepend.CodeModel Namespace > IMethod Interface : ILCyclomaticComplexity Property
Gets a numeric nullable value measuring this method body complexity computed from IL code.
Syntax
Nullable<ushort> ILCyclomaticComplexity {get;}

Property Value

null if this method is declared in a third-party assembly.
null if this method is abstract or is a default constructor.
Otherwise returns this method body complexity computed from IL code.
Remarks
Methods IL Cyclomatic Complexity code metric description:
The IMethod.CyclomaticComplexity (CC) metric is language dependent. Thus, NDepend provides the metric ILCyclomaticComplexity (ILCC) which is language independent because it is computed from IL as:
1 + {the number of different offsets targeted by a jump/branch IL instruction}.
Experience shows that ILCC is a bit more larger than the source code CC. Indeed, a C# if expression yields one IL jump. A C# for loop yields two different offsets targeted by a branch IL instruction while a foreach C# loop yields three.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

IMethod Interface
IMethod Members