mambax7/mymenus

View on GitHub

Showing 93 of 115 total issues

Method orderBlock has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function orderBlock(
        array $bid,
        array $oldtitle,
        array $oldside,
        array $oldweight,
Severity: Minor
Found in class/Common/Blocksadmin.php - About 1 hr to fix

    Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function render()
        {
            // load all child ids for javascript codes
            foreach (\array_keys($this->_itemTree) as $item_id) {
                $this->_itemTree[$item_id]['allchild'] = [];
    Severity: Minor
    Found in class/GroupPermForm.php - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function render()
        {
            $ret = '';
    
            if (\count($this->_appendix) > 0) {
    Severity: Minor
    Found in class/GroupFormCheckBox.php - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function isBlockCloned has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
        {
            \xoops_loadLanguage('admin', 'system');
            \xoops_loadLanguage('admin/blocksadmin', 'system');
            \xoops_loadLanguage('admin/groups', 'system');
    Severity: Minor
    Found in class/Common/Blocksadmin.php - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method createUpdateTable has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function createUpdateTable($table, $tablename, \XoopsObject $module)
        {
            if (!InfoTableExists($GLOBALS['xoopsDB']->prefix($module->getInfo('dirname')) . $tablename)) {
                $sql = 'CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix($module->getInfo('dirname')) . $tablename . ' (';
                foreach ($table as $s => $w) {
    Severity: Minor
    Found in class/Updater.php - About 1 hr to fix

      Method render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render()
          {
              $ret = '';
      
              if (\count($this->_appendix) > 0) {
      Severity: Minor
      Found in class/GroupFormCheckBox.php - About 1 hr to fix

        Method checkInfoTable has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function checkInfoTable(\XoopsObject $module)
            {
                //    global $xoopsDB;
                $err = true;
        
        
        Severity: Minor
        Found in class/Updater.php - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                      if (!o.isAllowed(this.currentItem, parentItem) ||
                          parentItem && parentItem.hasClass(o.disableNesting) ||
                          o.protectRoot && (parentItem === null && !isRoot || isRoot && level > 1)) {
                          this.placeholder.addClass(o.errorClass);
                          if (maxLevels < levels && maxLevels != 0) {
          Severity: Critical
          Found in assets/js/nestedSortable.js - About 1 hr to fix

            Method cloneBlock has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function cloneBlock(int $bid)
                : void {
                    //require __DIR__ . '/admin_header.php';
                    //        \xoops_cp_header();
            
            
            Severity: Minor
            Found in class/Common/Blocksadmin.php - About 1 hr to fix

              Method getForm has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getForm($action = false)
                  {
                      /** @var \XoopsGroupPermHandler $grouppermHandler */
                      $grouppermHandler = \xoops_getHandler('groupperm');
              
              
              Severity: Minor
              Found in class/Menus.php - About 1 hr to fix

                Function hoverIntent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
                        // instance ID, used as a key to store and retrieve state information on an element
                        var instanceId = INSTANCE_COUNT++;
                
                        // extend the default configuration and parse parameters
                Severity: Minor
                Found in assets/js/jquery.hoverIntent.js - About 1 hr to fix

                  Method editBlock has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function editBlock(int $bid)
                      : void {
                          //        require_once \dirname(__DIR__,2) . '/admin/admin_header.php';
                          //        \xoops_cp_header();
                          \xoops_loadLanguage('admin', 'system');
                  Severity: Minor
                  Found in class/Common/Blocksadmin.php - About 1 hr to fix

                    Function buildSelected has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function buildSelected(): void
                        {
                            //get the currentpage
                            $sel = [];
                            //        $queryString = $_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : '';
                    Severity: Minor
                    Found in class/Builder.php - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function getModuleMenus has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected static function getModuleMenus($module, $pid)
                        {
                            global $xoopsModule;
                            static $id = -1;
                            /** @var \XoopsModules\Mymenus\Helper $helper */
                    Severity: Minor
                    Found in class/Plugins/Dynamic/PluginItem.php - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function rrmdir($src)
                        {
                            // Only continue if user is a 'global' Admin
                            if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                                return false;
                    Severity: Minor
                    Found in class/Common/FilesManagement.php - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Method xoops_module_install_mymenus has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function xoops_module_install_mymenus(\XoopsModule $module)
                    {
                        require \dirname(__DIR__, 3) . '/mainfile.php';
                        require \dirname(__DIR__) . '/config/config.php';
                    
                    
                    Severity: Minor
                    Found in include/oninstall.php - About 1 hr to fix

                      Function buildSubTree has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      ddtreemenu.buildSubTree = function (treeid, ulelement, index) {
                          ulelement.parentNode.className = "submenu";
                          if (typeof persisteduls[treeid] == "object") { //if cookie exists (persisteduls[treeid] is an array versus "" string)
                              if (ddtreemenu.searcharray(persisteduls[treeid], index)) {
                                  ulelement.setAttribute("rel", "open");
                      Severity: Minor
                      Found in skins/treemenu/simpletreemenu.js - About 1 hr to fix

                        Method loadTableFromArrayWithReplace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function loadTableFromArrayWithReplace($table, $data, $search, $replace)
                        {
                            /** @var \XoopsMySQLDatabase $db */
                            $db = \XoopsDatabaseFactory::getDatabaseConnection();
                        
                        
                        Severity: Minor
                        Found in testdata/index.php - About 1 hr to fix

                          Method getServerStats has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function getServerStats()
                              {
                                  //mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
                                  $moduleDirName      = \basename(\dirname(__DIR__, 2));
                                  $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                          Severity: Minor
                          Found in class/Common/ServerStats.php - About 1 hr to fix

                            Method buildMenus has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function buildMenus($pid = 0): void
                                {
                                    static $idx = -1;
                                    static $level = -1;
                                    ++$level;
                            Severity: Minor
                            Found in class/Builder.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language