Difference between revisions of "Architecture/Source Code Inventory/Count Details"
m |
m (→Counting CodeLines) |
||
Line 4: | Line 4: | ||
How many Lines of code do we have here ?: | How many Lines of code do we have here ?: | ||
− | + | 01: if ( my_function1() ) | |
− | + | 02: { | |
− | + | 03: //error handler | |
− | + | 04: | |
− | + | 05: return 1; | |
− | + | 06: } | |
− | + | 07: // block of instruction 1 | |
− | + | 08: if ( my_function2() ) | |
− | + | 09: { | |
− | + | 10: //error handler | |
− | + | 11: | |
− | + | 12: return 2; | |
− | + | 13: } | |
− | + | 14: // block of instruction 2 | |
− | + | 15: if ( my_function3() ) | |
− | + | 16: { | |
− | + | 17: //error handler | |
− | + | 18: | |
− | + | 19: return 3; | |
− | + | 20: } | |
− | + | 21: // // block of instruction 3 + i | |
− | + | 22: // if ( ... ) | |
− | + | 23: // } | |
− | + | 24: // ... | |
− | + | 25: // } | |
+ | 26: | ||
+ | 27: | ||
+ | 28: | ||
+ | 29: | ||
+ | 30: | ||
+ | |||
+ | In my undertanding we have here something like: | ||
+ | |||
+ | 30 Lines | ||
+ | 25 Lines of Code (LOC) | ||
+ | 12 Source Lines of Code (SLOC) | ||
+ | 10 Comment Lines | ||
+ | 6 Descriptive Comments | ||
+ | 4 Lines Commented Code |
Revision as of 16:50, 16 November 2006
Counting CodeLines
The term "CodeLines" is somewhat ambigious, therefor one will find plenty of definitions which differ slightly, others are on their way to become something like a standard. For this reason we want to try to negotiate different terms and their meanings, to form a contract of how to understand it when we speak of CodeLines
How many Lines of code do we have here ?:
01: if ( my_function1() ) 02: { 03: //error handler 04: 05: return 1; 06: } 07: // block of instruction 1 08: if ( my_function2() ) 09: { 10: //error handler 11: 12: return 2; 13: } 14: // block of instruction 2 15: if ( my_function3() ) 16: { 17: //error handler 18: 19: return 3; 20: } 21: // // block of instruction 3 + i 22: // if ( ... ) 23: // } 24: // ... 25: // } 26: 27: 28: 29: 30:
In my undertanding we have here something like:
30 Lines 25 Lines of Code (LOC) 12 Source Lines of Code (SLOC) 10 Comment Lines 6 Descriptive Comments 4 Lines Commented Code