Exakat\Analyzer\Wordpress\WpdbBestUsage::analyze PHP Method

analyze() public method

public analyze ( )
    public function analyze()
    {
        $ignoreCommands = array('SHOW TABLES', 'RENAME TABLE', 'ALTER TABLE', 'CREATE TABLE', 'DROP TABLE', 'DESC', 'TRUNCATE');
        $ignoreCommandsRegex = join('|', $ignoreCommands);
        // $wpdb->get_var("select ".$wpdb->prefix."table")
        $this->atomIs('Variable')->codeIs('$wpdb')->inIs('OBJECT')->atomIs('Methodcall')->outIs('METHOD')->codeIs(array('get_var', 'get_col', 'get_results', 'get_row', 'query', 'prepare', 'query'))->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('Concatenation')->raw('where( __.out("CONCAT").hasLabel("Property").out("OBJECT").has("code", "\\$wpdb") )')->raw('where( __.out("CONCAT").hasLabel("String").has("rank", 0).filter{(it.get().value("noDelimiter") =~ "^(SHOW TABLES|DESC) ").getCount() == 0} )');
        $this->prepareQuery();
        // $wpdb->get_var("select {$wpdb->prefix}table")
        $this->atomIs('Variable')->codeIs('$wpdb')->inIs('OBJECT')->atomIs('Methodcall')->outIs('METHOD')->codeIs(array('get_var', 'get_col', 'get_results', 'get_row', 'query', 'prepare', 'query'))->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('String')->tokenIs('T_QUOTE')->hasOut('CONCAT')->raw('where( __.out("CONCAT").hasLabel("Property").out("OBJECT").has("code", "\\$wpdb").count().is(eq(0)) )')->raw('where( __.out("CONCAT").hasLabel("String").has("rank", 0).filter{(it.get().value("noDelimiter") =~ "^(SHOW TABLES|DESC) ").getCount() == 0} )');
        $this->prepareQuery();
    }
WpdbBestUsage