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: CountLineBlankPhpLanguages: 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:- Web: Project, File, PHP Class, PHP Interface
- This metric can be disabled from "Project Configuration/Metrics/Lines and Statements" with the "Show line count metrics" option.
- This metric can be enabled from "Project Configuration/Metrics/Lines and Statements" with the "Breakdown counts by web language" option.