Useful Comment To Code Ratio (CBRI) is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
Useful Comment To Code Ratio (CBRI)
| API ID | CBRIUsefulCommentToCodeRatio |
| Targets | Architectures Files Project |
| Languages | Any |
| Solution | Project Quality |
| Categories | Lines |
| Cost | Slow |
The ratio of "Useful comments" to "Useful Lines of Code"
CBR-Insight is a program that grades project quality. (Ludwig, Jeremy, Devin Cline, and Aaron Novstrup. "A case study using CBR-insight to visualize source code quality." 2020 IEEE Aerospace Conference. IEEE, 2020.). One of the three areas graded is clarity which uses this metric.
A useful comment line is one that is not licensing or commented out code. See CBRIUsefulComments.
A useful line of code is excludes lines with only punctuation. See CBRIUsefulLOC.
See also the Project Quality solution.