XoopsModules25x/mymenus

View on GitHub

Showing 49 of 63 total issues

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 xoops_module_install_mymenus has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

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

          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

          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 buildMenus has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function buildMenus($pid = 0)
                {
                    static $idx = -1;
                    static $level = -1;
                    ++$level;
            Severity: Minor
            Found in class/builder.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(dirname(__DIR__)));
                      $moduleDirNameUpper = strtoupper($moduleDirName);
              Severity: Minor
              Found in class/Common/ServerStats.php - About 1 hr to fix

                Method buildSelected has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Method saveLink has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function saveLink($id, $mid)
                      {
                          /** @var \XoopsModules\Mymenus\Helper $helper */
                          $helper = \XoopsModules\Mymenus\Helper::getInstance();
                          /** @var  \XoopsModules\Mymenus\LinksHandler $linksHandler */
                  Severity: Minor
                  Found in class/LinksUtility.php - About 1 hr to fix

                    Method deleteDirectory has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function deleteDirectory($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

                      Method getExtraValue has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getExtraValue($type = 'user', $value)
                          {
                              $registry = Mymenus\Registry::getInstance();
                              $ret      = 0;
                              $values   = ['pm_new', 'pm_readed', 'pm_total'];
                      Severity: Minor
                      Found in class/Plugins/Mymenus/PluginItem.php - About 1 hr to fix

                        Function rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function rmove($src, $dest)
                            {
                                // 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 55 mins 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 buildUpDown has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function buildUpDown($pid = 0)
                            {
                                static $idx = -1;
                                $prevWeight = null;
                                $up         = 0;
                        Severity: Minor
                        Found in class/builder.php - About 55 mins 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function recurseCopy($src, $dst)
                            {
                                $dir = opendir($src);
                                //        @mkdir($dst);
                                if (!@mkdir($dst) && !is_dir($dst)) {
                        Severity: Minor
                        Found in class/Common/FilesManagement.php - About 55 mins 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 setEvents has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function setEvents()
                            {
                                foreach ($this->plugins as $plugin) {
                        //            require $GLOBALS['xoops']->path("modules/{$this->helper->getDirname()}/plugins/{$plugin}/{$plugin}.php");
                                    $dirname = $this->helper->getDirname();
                        Severity: Minor
                        Found in class/Plugin.php - About 55 mins 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 buildSubTree has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function rcopy($src, $dest)
                            {
                                // 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 55 mins 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 buildSelected has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function buildSelected()
                            {
                                //get the currentpage
                                $sel = [];
                                //        $queryString = $_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : '';
                        Severity: Minor
                        Found in class/builder.php - About 55 mins 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

                        Severity
                        Category
                        Status
                        Source
                        Language