Executable Statements 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.
Executable Statements
| API ID | CountStmtExe |
| Targets | Architectures Classes Files Functions Modules Packages Project Subprograms |
| Languages | Ada Assembly Basic C# C++ Fortran Java Jovial Pascal Python VHDL Web |
| Categories | Statements |
| Cost | Lookup |
| Tags | Project Summary |
Number of executable statements.
A statement that both declares a variable and initializes it with a function call counts as both executable and declarative.
For example:
int main() {
for (int i = 0;
i < 10;
i++)
;
int j = func();
int k = 0;
int l = 1;
int m
= func();
int n;
n = 1;
#ifdef A_VERY_NICE_VARIABLE
int j = 0;
cout << j << endl;
#endif
return 0;
}
The for loop's condition (i < 10) and increment (i++) clauses, the two initializations that call func() (int j = func(); and int m = func();), n = 1;, and return 0; are all executable, for CountStmtExe = 6.
See Declarative Statements for the complementary breakdown, and Statements for the total. For the per-language breakdown in web files, see Executable Statements (JavaScript) and Executable Statements (PHP).
- Ada: Project, File, Type, Entry, Function, Package, Procedure, Protected, Task
- Basic: Project, File, Method, Module, Class
- C#: Project, File, Class, Method
- C++: Project, File, Class, Struct, Union, Function
- Fortran: Project, File, Module, Block Data, Function, Program, Subroutine
- Java: Project, File, Class, Interface, Method
- Jovial: Project, File, Subroutine
- Pascal: Project, File, Class, Interface, Compunit, Function, Procedure
- Python: Project, File, Class, Function
- VHDL: Project, File
- Web: Project, File, PHP Class, PHP Interface