e107inc/e107

View on GitHub
e107_handlers/menumanager_class.php

Summary

Maintainability
B
4 hrs
Test Coverage
F
27%

Consider simplifying this complex logical expression.
Open

          if(($this->curLayout == 'legacyCustom' || $this->curLayout=='legacyDefault') && (isset($CUSTOMHEADER) || isset($CUSTOMFOOTER)) )  // 0.6 themes.
        {
             if($this->curLayout == 'legacyCustom')
            {
                $HEADER = ($CUSTOMHEADER) ? $CUSTOMHEADER : $HEADER;
Severity: Critical
Found in e107_handlers/menumanager_class.php - About 3 hrs to fix

    Avoid too many return statements within this method.
    Open

                return;
    Severity: Major
    Found in e107_handlers/menumanager_class.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              if(!$this->dragDrop){ return; }
      Severity: Major
      Found in e107_handlers/menumanager_class.php - About 30 mins to fix

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

                    $order[] = $id;
        Severity: Info
        Found in e107_handlers/menumanager_class.php by phan

        Argument 3 (checked) is '' but \e_form::checkbox() takes bool|false defined at /code/e107_handlers/form_handler.php:2685
        Open

                    $tab1 .= "<li>" . $frm->checkbox('menuselect[]', $row['menu_id'], '', array('label' => "<span>" . $row['menu_name'] . "<small>" . $menuInf . "</small></span>")) . "</li>";
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->style (Did you mean $style)
        Open

                $style = $this->style;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Saw possibly unextractable annotation for a fragment of comment '* @param incrementor number.': after incrementor, did not see an element name (will guess based on comment order)
        Open

             * @param incrementor number.
        Severity: Info
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \incrementor of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][name]',$row['name'],array('id'=>'name-'.$area.'-'.$c) );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \number of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][pages]',$row['pages'], array('id'=>'pages-'.$area.'-'.$c)  );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \incrementor of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $visibilityLink = e_SELF."?enc=".base64_encode('lay='.$layout.'&vis='.$area.'-'.$c.'&iframe=1&class='.$row['class'].'&pages='.$row['pages']);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->HEADER
        Open

                if(is_string($this->HEADER))
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMFOOTER
        Open

                            foreach($this->CUSTOMFOOTER as $k=>$v)
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious array access to nullable ?array
        Open

                        if(vartrue($_POST['menuSetCustomPages']))
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious array access to nullable ?array
        Open

                            $custompages = $tp->filter($_POST['custompages']);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        When fetching an array index from a value of type array<int>&gt;&gt;|array<int>&gt;|array{},</int></int> found an array index of type string, but expected the index to be of type int
        Open

                                $rows = $this->menuData[$menu];
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->curLayout
        Open

                    $this->curLayout = vartrue($_GET['configure'], $pref['sitetheme_deflayout']);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        string passed to foreach instead of array
        Open

                foreach($_POST['data']['layout']['area'] as $v) // reset key values.
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \number of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $visibilityLink = e_SELF."?enc=".base64_encode('lay='.$layout.'&vis='.$area.'-'.$c.'&iframe=1&class='.$row['class'].'&pages='.$row['pages']);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Argument 4 (options) is array{label:string,class:'e-save'} but \e_form::radio() takes null defined at /code/e107_handlers/form_handler.php:2942
        Open

                $text .= $frm->radio('listtype', 2, $checked, array('label'=> $tp->toHTML(MENLAN_27,true), 'class'=> 'e-save'));
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_menuManager->customMenu
        Open

                    if(isset($this->customMenu))
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Argument 3 (checked) is '' but \e_form::checkbox() takes bool|false defined at /code/e107_handlers/form_handler.php:2685
        Open

                    $tab2 .= "<li>" . $frm->checkbox('menuselect[]', $row['menu_id'], '', array('label' => "<span>" . $row['menu_name'] . "<small>" . $menuInf . "</small></span>")) . "</li>";
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->FOOTER (Did you mean $FOOTER)
        Open

                    $this->FOOTER         = $FOOTER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \number of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][parms]',$row['parms'], array('id'=>'parms-'.$area.'-'.$c)  );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Argument 3 (checked) is '' but \e_form::checkbox() takes bool|false defined at /code/e107_handlers/form_handler.php:2685
        Open

                        $text .= $frm->checkbox('menuselect[]',$row['menu_id'],'',array('label'=>$row['menu_name'].$menuInf));
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_menuManager->customMenu
        Open

                    if(isset($this->customMenu) && count($this->customMenu))
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMHEADER (Did you mean $CUSTOMHEADER)
        Open

                    $this->CUSTOMHEADER = $CUSTOMHEADER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMHEADER (Did you mean $CUSTOMHEADER)
        Open

                    $this->CUSTOMHEADER = varset($CUSTOMHEADER);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious array access to nullable ?array<string>|?mixed</string>
        Open

                                    $menuText .= "\n\n\n <!-- Menu Start ".$row['menu_name']. "-->\n";
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Assigning string to property but \e_menuManager->menuId is int
        Open

                        $this->menuId = $deleteID;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

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

                             $tmp[$id]['name'] = ucwords(str_replace($search,"",$row['menu_name'])); // remove _
        Severity: Info
        Found in e107_handlers/menumanager_class.php by phan

        Parameter $area has undeclared type \number
        Open

            public function renderMenuOptions($row, $layout, $area, $c , $uniqueId='xxx')
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Argument 4 (options) is array{label:string,class:'e-save'} but \e_form::radio() takes null defined at /code/e107_handlers/form_handler.php:2942
        Open

                $text .= $frm->radio('listtype', 1, $checked, array('label'=> $tp->toHTML(MENLAN_26,true), 'class'=> 'e-save'));
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

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

                        $menuArea[] = array(
        Severity: Info
        Found in e107_handlers/menumanager_class.php by phan

        Call to undeclared method \e_db::escape
        Open

                    $parms = $sql->escape(strip_tags($parms));
        Severity: Critical
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->style (Did you mean $style)
        Open

                    $this->style        = $style;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->FOOTER (Did you mean $FOOTER)
        Open

                    $this->FOOTER         = varset($FOOTER);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \number of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][path]',$row['path'], array('id'=>'path-'.$area.'-'.$c)  );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \incrementor of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][pages]',$row['pages'], array('id'=>'pages-'.$area.'-'.$c)  );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \number of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= "<a href='#'  class='menuOption menu-btn menu-btn-mini menu-btn-danger deleteMenu pull-right' data-area='area-".$area."' data-delete='".$uniqueId."'>&times;</a>"; // $('.hello').remove();
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->HEADER
        Open

                    $H['default'] = $this->HEADER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Argument 3 (where) is null but \e_db::retrieve() takes string defined at /code/e107_handlers/e_db_interface.php:153
        Open

                if($result = $sql->retrieve('menus', 'menu_name', null, true))
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_menuManager->customMenu
        Open

                        $this->customMenu[] = $cust;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->HEADER (Did you mean $HEADER)
        Open

                    $this->HEADER         = $HEADER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMFOOTER (Did you mean $CUSTOMFOOTER)
        Open

                    $this->CUSTOMFOOTER = $CUSTOMFOOTER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \number of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][class]',$row['class'], array('id'=>'class-'.$area.'-'.$c)  );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMHEADER
        Open

                     if(!is_array($this->CUSTOMHEADER))
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->HEADER (Did you mean $HEADER)
        Open

                    $this->HEADER         = varset($HEADER);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMHEADER
        Open

                            $H['legacyCustom'] = $this->CUSTOMHEADER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMFOOTER
        Open

                            $F['legacyCustom'] = $this->CUSTOMFOOTER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_menuManager->customMenu
        Open

                        $text .= "<p>".MENLAN_52."<ul ><li>".implode("</li><li>",$this->customMenu)."</li></ul></p>";    
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMFOOTER (Did you mean $CUSTOMFOOTER)
        Open

                    $this->CUSTOMFOOTER = varset($CUSTOMFOOTER);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Variable $row is undeclared
        Open

                    <legend>". MENLAN_7." ".$row['menu_name']."</legend>
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Argument 4 (options) is array{label:string,class:'e-save'} but \e_form::radio() takes null defined at /code/e107_handlers/form_handler.php:2942
        Open

                $text .= $frm->radio('listtype', 2, $checked, array('label'=>  $tp->toHTML(MENLAN_27,true), 'class'=> 'e-save'));
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMHEADER
        Open

                if(!empty($this->CUSTOMHEADER))
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Argument 4 (c) is int but \e_mm_layout::renderMenuOptions() takes \incrementor defined at /code/e107_handlers/menumanager_class.php:2785
        Open

                return '<li class="regularMenu" id="'.$uniqueId.'"> '.$this->renderMenuOptions($row, $layout, $area, $this->cnt, $uniqueId)." </li>\n";
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \incrementor of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][class]',$row['class'], array('id'=>'class-'.$area.'-'.$c)  );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \incrementor of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][parms]',$row['parms'], array('id'=>'parms-'.$area.'-'.$c)  );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->curLayout
        Open

                    <form class='form-horizontal' id='e-save-form' method='post' action='".e_SELF."?lay=".$this->curLayout."&amp;iframe=1'>
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->FOOTER
        Open

                    $F = $this->FOOTER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

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

                    if($sql->select('menus', 'menu_name', 'menu_id='.$this->menuId, 'default'))
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->curLayout
        Open

                    $this->renderLayout($this->curLayout);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

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

                foreach($_POST['data']['layout']['area'] as $v) // reset key values.
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Parameter $c has undeclared type \incrementor
        Open

            public function renderMenuOptions($row, $layout, $area, $c , $uniqueId='xxx')
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->FOOTER
        Open

                    $F['default'] = $this->FOOTER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->HEADER
        Open

                    $H = $this->HEADER;
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Argument 2 (fields) is true but \e_db::retrieve() takes string defined at /code/e107_handlers/e_db_interface.php:153
        Open

                if($rows = $sql->retrieve($menu_qry, true))
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

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

                   $menu_perm['everyone'] = e_UC_PUBLIC;
        Severity: Info
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \number of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][name]',$row['name'],array('id'=>'name-'.$area.'-'.$c) );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Argument 4 (options) is array{label:string,class:'e-save'} but \e_form::radio() takes null defined at /code/e107_handlers/form_handler.php:2942
        Open

                $text .= $frm->radio('listtype', 1, $checked, array('label'=>$tp->toHTML(MENLAN_26,true), 'class'=> 'e-save'));
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

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

                save_prefs();
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Variable $text is undeclared
        Open

                                unset($text);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious array access to nullable ?array<string>|?mixed</string>
        Open

                                    $menuText .= "<div class='{$cl}' id='block-".$row['menu_id']."-".$menu."'>\n";
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

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

                $insert[] = $insertID;
        Severity: Info
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->style (Did you mean $style)
        Open

                    $this->style        = varset($style);
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Suspicious type \incrementor of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                $text .= $frm->hidden('data[layout][area]['.$c.'][path]',$row['path'], array('id'=>'path-'.$area.'-'.$c)  );
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        Reference to undeclared property \e_mm_layout->CUSTOMHEADER
        Open

                            foreach($this->CUSTOMHEADER as $k=>$v)
        Severity: Minor
        Found in e107_handlers/menumanager_class.php by phan

        There are no issues that match your filters.

        Category
        Status