protected function Stats()
{
$css = new \Stdclass();
$css->displayTitles = true;
$css->titles = array('File');
$css->readOrder = $css->titles;
$extensions = array('Summary' => array('Namespaces' => 'Namespace', 'Classes' => 'Class', 'Interfaces' => 'Interface', 'Trait' => 'Trait', 'Function' => 'Functions/RealFunctions', 'Variables' => 'Variables/RealVariables', 'Constants' => 'Constants/Constantnames'), 'Classes' => array('Classes' => 'Class', 'Class constants' => 'Classes/ConstantDefinition', 'Properties' => 'Classes/NormalProperties', 'Static properties' => 'Classes/StaticProperties', 'Methods' => 'Classes/NormalMethods', 'Static methods' => 'Classes/StaticMethods'), 'Structures' => array('Ifthen' => 'Ifthen', 'Else' => 'Structures/ElseUsage', 'Switch' => 'Switch', 'Case' => 'Case', 'Default' => 'Default', 'For' => 'For', 'Foreach' => 'Foreach', 'While' => 'While', 'Do..while' => 'Dowhile', 'New' => 'New', 'Clone' => 'Clone', 'Throw' => 'Throw', 'Try' => 'Try', 'Catch' => 'Catch', 'Finally' => 'Finally', 'Yield' => 'Yield', '? :' => 'Ternary', '?: ' => 'Php/Coalesce', '??' => 'Php/NullCoalesce', 'Variables constants' => 'Constants/VariableConstants', 'Variables variables' => 'Variables/VariableVariable', 'Variables functions' => 'Functions/Dynamiccall', 'Variables classes' => 'Classes/VariableClasses'));
$data = array();
foreach ($extensions as $section => $hash) {
$data[$section] = array();
foreach ($hash as $name => $ext) {
if (strpos($ext, '/') === false) {
$res = $this->dump->query('SELECT count FROM atomsCounts WHERE atom="' . $ext . '"');
$d = $res->fetchArray(\SQLITE3_ASSOC);
$d = (int) $d['count'];
} else {
$res = $this->dump->query('SELECT count FROM resultsCounts WHERE analyzer="' . $ext . '"');
$d = $res->fetchArray(\SQLITE3_ASSOC);
$d = (int) $d['count'];
}
$data[$section][$name] = $d === -2 ? 'N/A' : $d;
}
}
return $this->formatText(<<<TEXT
These are various stats of different structures in your application.
TEXT
, 'textLead') . $this->formatSectionedHashTable($data, $css);
}