The page provides definition & details on how the following metrics are computed for an application :
- Number of LOC.
- Number of Commented out LOC.
- Number of Lines of Comments.
Release | Yes/No |
---|---|
8.3.x | |
8.2.x | |
8.1x | |
8.0.x | |
7.3.x | |
7.2.x | |
7.0.x |
RDBMS | Yes/No |
---|---|
Oracle Server | ? |
Microsoft SQL Server | ? |
CSS2 | ? |
CSS1 |
Number of line of codes and line of comments
- Full lines of comments are skipped from the number of line of code (for a comment not starting at the begin of a line, the line is counted).
- A line containing code and comment is counted twice (one as Line of code, one as Line of Comment).
- Blank lines (i.e., only LF + CR or LF or CR) are skipped.
- Preprocessed code is not used to count the LOC (impact on C, C++, Cobol).
- A comment starting right before or right after the end of an object are attached to the object.
- A comment on a line of code with multiple languages (e.g., embedded SQL) is counted on both languages.
- A line of code is considered the actual number of lines independent of code statements. Therefore CAST considers the following all as one line of code:
- set x=1;
- set x=1; set y=2; set z=3;
- A line of code does not have to be a complete statement as well. CAST considers the following example as 4 lines of code:
Set x = 1;
First context is Technical Sizing. In this context, source files are taken into account. More specifically, objects that are analyzed by CAST AIP whose type inherit from the APM Sources category.
Second context is Quality Measurement. In this context, Source Files, Artifacts, and specifically targeted object types are taken into account.
Interpretation difficulties arise when:
- an Artifact is defined by multiple Source files. In this case, the Artifact does not “belong to” a specific Source file and it leads to a parallel organization of objects. One can mistakenly create Modules and therefore Applications with Artifacts but without the Source files so that Technical Sizing indicates no or far less number of LOC than the results of LOC quality rules.
- sources files contain source code from multiple technologies. This leads to counting multiple times LOC.
Enlighten for viewing LOC
Enlighten is a CAST tool which can be used to view LOC for items in the CAST knowledge base which has an associated LOC value. If you add an item to the graphical view in Enlighten and then examine the properties (F12), you can then see the LOC value in the properties window.
Reference Webcall:28494
Zendesk 3274
Number of commented out LOC
counted after the corresponding natural metric ==> statistical result