e107inc/e107

View on GitHub
e107_core/shortcodes/batch/admin_shortcodes.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
52%

Avoid deeply nested control flow statements.
Open

                                if(!class_exists($val. '_latest'))
                                {
                                    trigger_error('<strong>' .$val . '</strong> is using a deprecated e_latest method. See plugin: _blank/e_dashboard.php ', E_USER_DEPRECATED);

                                    $oldconfigs[$val] = admin_shortcodes::legacyToConfig($text);
Severity: Major
Found in e107_core/shortcodes/batch/admin_shortcodes.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            while($rowplug = $sql->fetch())
                            {
                                extract($rowplug);
                                if(varset($rowplug[1]))
                                {
    Severity: Major
    Found in e107_core/shortcodes/batch/admin_shortcodes.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                      if(!class_exists($val. '_status'))
                                      {
                                          trigger_error('<strong>' .$val . '</strong> is using a deprecated e_status method method. See plugin: _blank/e_dashboard.php ', E_USER_DEPRECATED);
      
                                      //    $mes->addDebug("<strong>".$val ."</strong> using deprecated e_status method. See the chatbox plugin folder for a working example of the new one. ");
      Severity: Major
      Found in e107_core/shortcodes/batch/admin_shortcodes.php - About 45 mins to fix

        Variable $e107_var is undeclared
        Open

                unset($e107_var);

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                    if (getperms($langval))

        Argument 6 (sortlist) is true but \show_admin_menu() takes false defined at /code/e107_admin/boot.php:354
        Open

                    $text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);

        Argument 3 (mode) is true but \e_render::tablerender() takes string defined at /code/e107_handlers/e_render_class.php:314
        Open

                    return e107::getRender()->tablerender(FOOTLAN_14,$text, /*array('id' => 'admin_docs', 'style' => 'button_menu'),*/ TRUE); //FIXME array to string conversion

        When fetching an array index from a value of type false|string, found an array index of type 'adminLinks', but expected the index to be of type int
        Open

                            if(isset($readFile['adminLinks']['link']) && is_array($readFile['adminLinks']['link']))

        Argument 2 (className) is null but \e107::getAddonConfig() takes string defined at /code/e107_handlers/e107_class.php:2962
        Open

                            $configs = e107::getAddonConfig('e_dashboard',null, 'latest');

        Argument #2 of this call to \strstr is typically a literal or constant but isn't, but argument #1 (which is typically a variable) is a literal or constant. The arguments may be in the wrong order.
        Open

                $plugpath = e_PLUGIN.str_replace(basename(e_SELF),'',str_replace('/'.$plugindir,'','/'.strstr(e_SELF,$plugindir))).'admin_menu.php';

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                if(!getperms('0') || !file_exists($file))

        When fetching an array index from a value of type string, found an array index of type 'configFile', but expected the index to be of type int
        Open

                                $eplug_conffile = !empty($readFile['administration']['configFile']) ? $readFile['administration']['configFile'] : '';

        When fetching an array index from a value of type false|string, found an array index of type '\x40attributes', but expected the index to be of type int
        Open

                        $themedate = $data['@attributes']['date'];

        Argument 5 (sub_link) is true but \show_admin_menu() takes false defined at /code/e107_admin/boot.php:354
        Open

                    $text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                if($lanperms && !getperms($sql->mySQLlanguage))

        Reference to undeclared constant \e_DBLANGUAGE
        Open

                    return '<b>'.ADLAN_48.':</b> '.defset('ADMINNAME').' '.( defined('e_DBLANGUAGE') ? '<b>'.LAN_HEADER_05.'</b>: '.e_DBLANGUAGE : '' );

        Reference to undeclared property \e_db->mySQLlanguage
        Open

                    $text .= ' (' .$slng->convert($sql->mySQLlanguage).")

        Reference to undeclared property \e_db->mySQLlanguage
        Open

                    $text .= $sql->mySQLlanguage;

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                if (getperms('0'))

        Call to deprecated function \e_admin_menu() defined at /code/e107_admin/boot.php:328
        Open

                        $text = e_admin_menu('', '', $e107_var);

        Argument #1 of this call to \str_replace is typically a literal or constant but isn't, but argument #3 (which is typically a variable) is a literal or constant. The arguments may be in the wrong order.
        Open

                        $url = str_replace($srch,'/'.$val['match'].'/',e_REQUEST_SELF);

        Argument 4 (noWhere) is 'no_where' but \e_db::select() takes bool|false defined at /code/e107_handlers/e_db_interface.php:265
        Open

                                $cnt = $sql ->select('admin_log', '*', 'ORDER BY `dblog_datestamp` DESC LIMIT 0,10', 'no_where');

        Variable $eplug_name is undeclared
        Open

                            unset($eplug_conffile, $eplug_name, $eplug_caption);

        When fetching an array index from a value of type string, found an array index of type 'version', but expected the index to be of type int
        Open

                        $themeversion = $data['@attributes']['version'];

        When fetching an array index from a value of type string, found an array index of type 'link', but expected the index to be of type int
        Open

                            if(isset($readFile['adminLinks']['link']) && is_array($readFile['adminLinks']['link']))

        Call to deprecated function \show_admin_menu() defined at /code/e107_admin/boot.php:354
        Open

                    $text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                if(!getperms('0'))

        Argument 3 (mode) is true but \e_render::tablerender() takes string defined at /code/e107_handlers/e_render_class.php:314
        Open

                        return $ns->tablerender(LAN_HEADER_01, $text, /*array('id' => 'admin_nav', 'style' => 'button_menu'),*/ TRUE); // FIXME array to string issue.

        string passed to foreach instead of array
        Open

                                foreach ($readFile['adminLinks']['link'] as $data) 

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                if(!getperms(0) && !getperms('P', 'P'.$pid))

        When fetching an array index from a value of type false|string, found an array index of type 'administration', but expected the index to be of type int
        Open

                                $eplug_conffile = !empty($readFile['administration']['configFile']) ? $readFile['administration']['configFile'] : '';

        When fetching an array index from a value of type false|string, found an array index of type 'adminLinks', but expected the index to be of type int
        Open

                                foreach ($readFile['adminLinks']['link'] as $data) 

        Argument 4 (noWhere) is 'no_where' but \e_db::select() takes bool|false defined at /code/e107_handlers/e_db_interface.php:265
        Open

                                $cnt = $sql ->select('admin_log', '*', 'ORDER BY `dblog_datestamp` DESC', 'no_where');

        When fetching an array index from a value of type string, found an array index of type 'name', but expected the index to be of type int
        Open

                        $themename = $data['@attributes']['name'];

        Variable $aff was undeclared, but array fields are being added to it.
        Open

                            $aff[] = str_replace(MPREFIX. 'lan_' .$clang. '_', '',$tabs);

        Reference to undeclared property \e_db->mySQLlanguage
        Open

                    $text .= $sql->mySQLlanguage;

        Reference to undeclared property \e_db->mySQLlanguage
        Open

                    $text .= ' ('.$slng->convert($sql->mySQLlanguage).'): '.LAN_INACTIVE;

        Reference to undeclared property \e_db->mySQLlanguage
        Open

                        $clang = strtolower($sql->mySQLlanguage);

        Reference to undeclared property \e_db->mySQLlanguage
        Open

                        $selected = ($lng == $sql->mySQLlanguage || ($lng == $pref['sitelanguage'] && !$sql->mySQLlanguage)) ? " selected='selected'" : '';

        When fetching an array index from a value of type string, found an array index of type 'administration', but expected the index to be of type int
        Open

                                $eplug_conffile = !empty($readFile['administration']['configFile']) ? $readFile['administration']['configFile'] : '';

        When fetching an array index from a value of type false|string, found an array index of type '\x40attributes', but expected the index to be of type int
        Open

                        $themename = $data['@attributes']['name'];

        When fetching an array index from a value of type string, found an array index of type 'link', but expected the index to be of type int
        Open

                                foreach ($readFile['adminLinks']['link'] as $data) 

        Reference to undeclared constant \e_DBLANGUAGE
        Open

                        return '<b>'.ADLAN_48.':</b> '.defset('ADMINNAME').' ('.ADLAN_49.') '.( defined('e_DBLANGUAGE') ? '<b>'.LAN_HEADER_05.'</b>: '.e_DBLANGUAGE : '' );

        Reference to undeclared property \e_db->mySQLlanguage
        Open

                if($lanperms && !getperms($sql->mySQLlanguage))

        When fetching an array index from a value of type false|string, found an array index of type '\x40attributes', but expected the index to be of type int
        Open

                                $eplug_caption     = $tp->toHTML($readFile['@attributes']['name'], FALSE, 'defs, emotes_off');

        Reference to undeclared property \e_db->mySQLlanguage
        Open

                elseif($sql->mySQLlanguage && ($sql->mySQLlanguage != $pref['sitelanguage']))

        When fetching an array index from a value of type string, found an array index of type 'name', but expected the index to be of type int
        Open

                                $eplug_caption     = $tp->toHTML($readFile['@attributes']['name'], FALSE, 'defs, emotes_off');

        When fetching an array index from a value of type false|string, found an array index of type '\x40attributes', but expected the index to be of type int
        Open

                        $themeversion = $data['@attributes']['version'];

        Argument 1 (userData) is null but \e_parse::toAvatar() takes array defined at /code/e107_handlers/e_parse_class.php:4269
        Open

                    $menu_vars[$type]['image'] = $tp->toAvatar(null, array('w'=>30,'h'=>30,'crop'=>1, 'shape'=>'circle')); // $tp->toGlyph('fa-user'); // "<i class='icon-user'></i>"; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />";

        When fetching an array index from a value of type string, found an array index of type 'name', but expected the index to be of type int
        Open

                        $themeauthor = !empty($data['author']['@attributes']['name']) ? $data['author']['@attributes']['name'] : '';

        When fetching an array index from a value of type false|string, found an array index of type 'author', but expected the index to be of type int
        Open

                        $themeauthor = !empty($data['author']['@attributes']['name']) ? $data['author']['@attributes']['name'] : '';

        When fetching an array index from a value of type string, found an array index of type 'author', but expected the index to be of type int
        Open

                        $themeauthor = !empty($data['author']['@attributes']['name']) ? $data['author']['@attributes']['name'] : '';

        Call to undeclared method \e_db::getPDO
        Open

                    <br />PDO: ' .((e107::getDb()->getPDO() === true) ? LAN_ENABLED : LAN_DISABLED). '

        Argument 3 (mode) is null but \e_render::tablerender() takes string defined at /code/e107_handlers/e_render_class.php:314
        Open

                return e107::getRender()->tablerender('Drag-N-Drop Menus', $text, null, true);

        Returning type null but renderHelpIcon() is declared to return string
        Open

                    return null;

        Argument 2 (vals) is int but \e_parse::lanVars() takes array|string defined at /code/e107_handlers/e_parse_class.php:3842
        Open

                $lan = e107::getParser()->lanVars($lanNotify, $count);

        Suspicious array access to nullable ?array|?mixed
        Open

                        $tmp['image'] = $subitem[5];

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                if(!getperms('0') || !deftrue('e_ADMIN_HOME'))

        Argument 2 (className) is null but \e107::getAddonConfig() takes string defined at /code/e107_handlers/e107_class.php:2962
        Open

                            $configs = e107::getAddonConfig('e_dashboard',null, 'status');

        Variable $menu_vars was undeclared, but array fields are being added to it.
        Open

                    $menu_vars[$id]['text']             = ($displayLabels) ? $admin_cat['title'][$i] : '';

        Suspicious array access to nullable ?array|?mixed
        Open

                        $tmp['description'] = $subitem[2];

        Suspicious array access to nullable ?array|?mixed
        Open

                        $tmp['perm'] = $subitem[3];

        Call to undeclared method \e_shortcode::sc_nav_link_name
        Open

                        $tmp[$c]['text']            = $sc->sc_nav_link_name();

        Call to undeclared method \e_shortcode::sc_nav_link_icon
        Open

                        $tmp[$c]['image']           = $sc->sc_nav_link_icon(); // vartrue($lk['link_button']) ? "<img class='icon S16' src='".$tp->replaceConstants($lk['link_button'])."' alt='".$tp->toAttribute($lk['link_description'],'','defs')."' />": '';

        Suspicious array access to nullable ?array{link_function:mixed,link_identifier:mixed}|?array{link_function:mixed,link_sub:,link_identifier:mixed}|?array{link_identifier:mixed,link_sub:}|?array{link_identifier:mixed}|?array{link_identifier:string}|?array{link_sub:}|?array{link_url:mixed,link_function:mixed,link_identifier:mixed|string}|?array{}|?mixed|array|mixed|null
        Open

                        $tmp[$c]['image_src']       = vartrue($lk['link_button']);

        Suspicious array access to nullable ?array|?mixed
        Open

                        $tmp['link'] = $subitem[0];

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                if (getperms('0') || getperms('4'))

        Argument #2 of this call to \strpos is typically a literal or constant but isn't, but argument #1 (which is typically a variable) is a literal or constant. The arguments may be in the wrong order.
        Open

                        if(strpos(e_REQUEST_SELF,$tmp['link'])!==false)

        Argument 2 (parseBB) is '' but \e_parse::toHTML() takes bool|false defined at /code/e107_handlers/e_parse_class.php:1532
        Open

                        $tmp[$c]['description']     = $tp->toHTML($lk['link_description'], '', 'defs');

        Saw an @param annotation for text, but the param list of function renderHelpIcon() : string is empty
        Open

             * @param string $text

        Call to undeclared method \e_db::getServerInfo
        Open

                    ' .e107::getDb()->getServerInfo(). // mySqlServerInfo.

        Suspicious array access to nullable ?array|?mixed
        Open

                        $catid = isset($admin_cat['id'][$subitem[4]]) ? $admin_cat['id'][$subitem[4]] : null;

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                    if(!getperms($p['perm']))

        Argument #2 of this call to \strpos is typically a literal or constant but isn't, but argument #1 (which is typically a variable) is a literal or constant. The arguments may be in the wrong order.
        Open

                            if(strpos(e_REQUEST_SELF,$pg['link'])!==false)

        When fetching an array index from a value of type string, found an array index of type 'date', but expected the index to be of type int
        Open

                        $themedate = $data['@attributes']['date'];

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                    if(isset($subitem[3]) && $subitem[3] !== false && !getperms($subitem[3]))

        Suspicious array access to nullable ?array|?mixed
        Open

                        $tmp['text'] = $subitem[1];

        Call to undeclared method \e_shortcode::sc_nav_link_url
        Open

                        $tmp[$c]['link']            = $sc->sc_nav_link_url(); // $tp->replaceConstants($link,'full');

        Argument #1 of this call to \str_replace is typically a literal or constant but isn't, but argument #3 (which is typically a variable) is a literal or constant. The arguments may be in the wrong order.
        Open

                                $link = str_replace($_SERVER['HTTP_HOST'], $code.'.'.e_DOMAIN, e_REQUEST_URL); // includes query string

        When fetching an array index from a value of type string, found an array index of type '\x40attributes', but expected the index to be of type int
        Open

                        $themeauthor = !empty($data['author']['@attributes']['name']) ? $data['author']['@attributes']['name'] : '';

        Call to undeclared method \e_db::getMode
        Open

                    $sqlMode = str_replace(',', ', ', e107::getDb()->getMode());

        Suspicious array access to nullable ?array|?mixed
        Open

                        $tmp['image_large'] = $subitem[6];

        Variable $oldconfigs was undeclared, but array fields are being added to it.
        Open

                            $oldconfigs['e-user'][0]         = array('icon' =>defset('E_16_USER'), 'title' =>ADLAN_110, 'url' => e_ADMIN_ABS. 'users.php?searchquery=&amp;filter_options=user_ban__0', 'total' =>$members, 'invert' =>1);

        array to false comparison
        Open

                if($data === false || isset($data['status']))

        Suspicious array access to nullable ?array{link_function:mixed,link_identifier:mixed}|?array{link_function:mixed,link_sub:,link_identifier:mixed}|?array{link_identifier:mixed,link_sub:}|?array{link_identifier:mixed}|?array{link_identifier:string}|?array{link_sub:}|?array{link_url:mixed,link_function:mixed,link_identifier:mixed|string}|?array{}|?mixed|array|mixed|null
        Open

                        $tmp[$c]['description']     = $tp->toHTML($lk['link_description'], '', 'defs');

        Call to deprecated function \getperms() defined at /code/class2.php:1322
        Open

                    if($adminPref == 0 || getperms('1'))

        Variable $menu_vars was undeclared, but array fields are being added to it.
        Open

                    $menu_vars[$type]['text'] = ''; // ADMINNAME; // ""; // ADMINNAME;

        There are no issues that match your filters.

        Category
        Status