public function analyze()
{
$constants = $this->query('g.V().hasLabel("Analysis").has("analyzer", "Constants/ConstantUsage").out("ANALYZED").values("code").unique()');
// Const from a define (case insensitive)
$this->atomFunctionIs('\\define')->outIs('ARGUMENTS')->noChildWithRank('ARGUMENT', 2)->outWithRank('ARGUMENT', 0)->atomIs('String')->noDelimiterIsNot($constants, true);
$this->prepareQuery();
$this->atomFunctionIs('\\define')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 2)->analyzerIsNot('Structures/Truthy')->inIs('ARGUMENT')->outWithRank('ARGUMENT', 0)->atomIs('String')->noDelimiterIsNot($constants, true);
$this->prepareQuery();
// Const from a define (case sensitive)
$constantsLC = array_map(function ($x) {
return strtolower($x);
}, $constants);
$this->atomFunctionIs('\\define')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 2)->analyzerIs('Structures/Truthy')->inIs('ARGUMENT')->outWithRank('ARGUMENT', 0)->atomIs('String')->noDelimiterIsNot($constantsLC);
$this->prepareQuery();
$constConstants = $this->query('g.V().hasLabel("Analysis").has("analyzer", "Constants/ConstantUsage").out("ANALYZED").values("fullnspath").unique()');
// Const from a const
$this->atomIs('Const')->hasNoClassInterface()->outIs('CONST')->outIs('NAME')->fullnspathIsNot($constConstants);
$this->prepareQuery();
}