scitools.com

← Metric catalog

Blank Lines (Includes Inactive) 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.

Blank Lines (Includes Inactive)

API ID: CountLineBlankWithInactive
Languages: C++
Targets: Architectures, Classes, Files, Functions, Project

Number of blank lines, including inactive regions.

Unlike Blank Lines, this also counts blank lines that fall inside an inactive region.

For example:


void SayHello::printHello() {
  switch (i) {
    case 0:
      cout << "Hello World" << endl;
    case 1:
      cout << "HELLO WORLD!" << endl;
    default: // a comment here
      for (int m = 0; m < j; m++);
      cout << "hello world" << endl;
  }
#ifdef A_VERY_NICE_VARIABLE

  cout << "Inactive Line" << endl; // Inactive
#endif

}

Both the blank line just before the closing brace (line 25) and the blank line inside the #ifdef A_VERY_NICE_VARIABLE block (line 22) count, for CountLineBlankWithInactive = 2.

See Blank Lines to exclude inactive blank lines.


Targets By Language: Configuration: