NDepend.API Documentation
NbLinesOfComment Property (ICodeContainer)
NDepend.CodeModel Namespace > ICodeContainer Interface : NbLinesOfComment Property
Gets a numeric nullable value counting the number of lines of comments contained in the body of this code element.
Syntax
Nullable<uint> NbLinesOfComment {get;}

Property Value

null if this code element is defined in a third-party assembly.
null if the PDB file of this assembly or code element parent's assembly, hasen't been found.
null if the source code file path referenced from the PDB file cannot be found.
null if the source code of this code element is written with a programming language different than C#.
Otherwise returns the number of comments for this code element.
Remarks
This metric can be computed only if assemblies PDB files are found at analysis-time and if corresponding source files can be found.
So far this metric is only computed for C# code and a VB.NET version will be released in the future.
The number of lines of comment is computed as follow:
Notice that this metric is not an additive metric (i.e for example, the number of lines of comment of a namespace can be greater than the number of lines of comment over all its types).
Recommendations:
This metric is not helpful to assess the quality of source code from a commenting perspective. Prefer using the metric PercentageComment.
Requirements

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

See Also

Reference

ICodeContainer Interface
ICodeContainer Members