Exakat\Analyzer\Structures\UnusedGlobal::analyze PHP Method

analyze() public method

public analyze ( )
    public function analyze()
    {
        // global in a function
        $this->atomIs('Global')->outIs('GLOBAL')->atomIs('Variable')->_as('result')->savePropertyAs('code', 'theGlobal')->goToFunction()->raw('where( __.repeat( __.out() ).emit(hasLabel("Variable")).times(' . self::MAX_LOOPING . ').where( __.in("GLOBAL").count().is(eq(0)) ).filter{ it.get().value("code") == theGlobal}.count().is(eq(0)) )')->back('result');
        $this->prepareQuery();
        // global in the global space
        $this->atomIs('Global')->outIs('GLOBAL')->atomIs('Variable')->_as('result')->savePropertyAs('code', 'theGlobal')->hasNoFunction()->hasNoClass()->hasNoInterface()->hasNoTrait()->raw('where( g.V().out("FILE").out("ELEMENT").out("CODE").out("ELEMENT").not(hasLabel("Global", "Function", "Trait", "Class", "Interface"))
                                .repeat( __.out() ).emit(hasLabel("Variable")).times(' . self::MAX_LOOPING . ').where( __.in("GLOBAL").count().is(eq(0)) ).filter{ it.get().value("code") == theGlobal}.count().is(eq(0)) )')->back('result');
        $this->prepareQuery();
    }
UnusedGlobal