This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 134152

Summary: C/C++ code metrics
Product: cnd Reporter: crimcat <crimcat>
Component: Code ModelAssignee: issues@cnd <issues>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description crimcat 2008-04-29 12:03:10 UTC
I need simple code metrics functionality which I think is useful in support and refactoring old projects (especially,
written by someone else).

I'd suggest to implement the following:
1) total lines of code in the source file (only code);
2) total lines of code in sense of number of operators (it may be useful when several operators are placed in the same
line, separated with ';');
3) total lines of comments in the given source file (in line comments should be counted as well);
4) code density for any given source code file (lines of code and lines of comments ratio);
5) source code complexity (any method, for example, number of nested constructions - if, switch, for, while, do - in the
function body).
Comment 1 Alexander Simon 2008-04-29 12:23:34 UTC
Well known metrics for code complexity.
Simple:
- LOC lines of code
- SLOC semicolon lines of code
- CR comments ratio
Halstead complexity metric:
- Program length
- Program vocabulary
- Volume
- Difficulty
- Effort
McCabe complexity:
- Cyclomatic Complexity