scitools.com

← Metric catalog

Blank Lines (PHP) 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 (PHP)

API ID: CountLineBlankPhp
Languages: Web
Targets: Architectures, Classes, Files, Project

Number of blank PHP lines.

For example:


<?php
// Compute a visitor count for this session
const SITE_NAME = "Understand Demo";

function nextVisit($count) {
  return $count + 1;
}

$visits = 1;
$visits = nextVisit($visits);
echo "You are visitor number " . $visits . " to " . SITE_NAME;

Lines 4 and 8, separating SITE_NAME's declaration, the nextVisit() function, and the visitor-count logic, are the only blank lines, giving CountLineBlankPhp = 2.

See Blank Lines (HTML)/Blank Lines (JavaScript) for the HTML/JavaScript equivalents, and Blank Lines for the language-independent metric this breaks down.

Targets By Language: Configuration: