XoopsModules25x/mymenus

View on GitHub

Showing 49 of 63 total issues

Function methods has 198 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var methods = (function () {
        // private properties and methods go here
        var c = {
                bcClass: 'sf-breadcrumb',
                menuClass: 'sf-js-enabled',
Severity: Major
Found in assets/js/superfish.js - About 7 hrs to fix

    Function _mouseDrag has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _mouseDrag: function (event) {
    
                //Compute the helpers position
                this.position = this._generatePosition(event);
                this.positionAbs = this._convertPositionTo("absolute");
    Severity: Major
    Found in assets/js/nestedSortable.js - About 4 hrs to fix

      Method mymenus_block_show has 90 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function mymenus_block_show($options)
      {
          global $xoopsTpl, $xoopsLogger;
          /** @var \XoopsModules\Mymenus\Helper $helper */
          $helper = \XoopsModules\Mymenus\Helper::getInstance();
      Severity: Major
      Found in blocks/mymenus_block.php - About 3 hrs to fix

        File nestedSortable.js has 307 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * jQuery UI Nested Sortable
         * v 1.3.5 / 21 jun 2012
         * http://mjsarfatti.com/code/nestedSortable
         *
        Severity: Minor
        Found in assets/js/nestedSortable.js - About 3 hrs to fix

          Method editLink has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function editLink($id = null, $pid = null, $mid = null)
              {
                  /** @var \XoopsModules\Mymenus\Helper $helper */
                  $helper = \XoopsModules\Mymenus\Helper::getInstance();
                  //
          Severity: Major
          Found in class/LinksUtility.php - About 3 hrs to fix

            Function deleteDirectory has a Cognitive Complexity of 22 (exceeds 5 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 3 hrs 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 mymenus_block_show has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

            function mymenus_block_show($options)
            {
                global $xoopsTpl, $xoopsLogger;
                /** @var \XoopsModules\Mymenus\Helper $helper */
                $helper = \XoopsModules\Mymenus\Helper::getInstance();
            Severity: Minor
            Found in blocks/mymenus_block.php - About 3 hrs 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 createUpdateTable has a Cognitive Complexity of 22 (exceeds 5 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 3 hrs 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 mymenus_block_edit has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function mymenus_block_edit($options)
            {
                /** @var \XoopsModules\Mymenus\Helper $helper */
                $helper = \XoopsModules\Mymenus\Helper::getInstance();
                //
            Severity: Major
            Found in blocks/mymenus_block.php - About 2 hrs to fix

              Function getSkinInfo has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getSkinInfo($moduleSkin = 'default', $useThemeSkin = false, $themeSkin = '')
                  {
                      //    require __DIR__ . '/common.php';
                      /** @var \XoopsModules\Mymenus\Helper $helper */
                      $helper = \XoopsModules\Mymenus\Helper::getInstance();
              Severity: Minor
              Found in class/Utility.php - About 2 hrs 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 hoverIntent has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.hoverIntent = function (handlerIn, handlerOut, selector) {
              
                      // default configuration values
                      var cfg = {
                          interval: 100,
              Severity: Major
              Found in assets/js/hoverIntent.js - About 2 hrs to fix

                Function mymenus_block_edit has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                function mymenus_block_edit($options)
                {
                    /** @var \XoopsModules\Mymenus\Helper $helper */
                    $helper = \XoopsModules\Mymenus\Helper::getInstance();
                    //
                Severity: Minor
                Found in blocks/mymenus_block.php - About 2 hrs 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 getModuleMenus has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function editLink has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function editLink($id = null, $pid = null, $mid = null)
                      {
                          /** @var \XoopsModules\Mymenus\Helper $helper */
                          $helper = \XoopsModules\Mymenus\Helper::getInstance();
                          //
                  Severity: Minor
                  Found in class/LinksUtility.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 getConfig has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function getConfig()
                  {
                      $moduleDirName      = basename(dirname(__DIR__));
                      $moduleDirNameUpper = strtoupper($moduleDirName);
                      return (object)[
                  Severity: Minor
                  Found in include/config.php - About 1 hr to fix

                    Method getSkinInfo has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function getSkinInfo($moduleSkin = 'default', $useThemeSkin = false, $themeSkin = '')
                        {
                            //    require __DIR__ . '/common.php';
                            /** @var \XoopsModules\Mymenus\Helper $helper */
                            $helper = \XoopsModules\Mymenus\Helper::getInstance();
                    Severity: Minor
                    Found in class/Utility.php - About 1 hr to fix

                      Function toArray has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              toArray: function (options) {
                      
                                  var o = $.extend({}, this.options, options),
                                      sDepth = o.startDepthCount || 0,
                                      ret = [],
                      Severity: Minor
                      Found in assets/js/nestedSortable.js - About 1 hr to fix

                        Function supersubs has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            $.fn.supersubs = function (options) {
                                var opts = $.extend({}, $.fn.supersubs.defaults, options);
                                // return original object to support chaining
                                return this.each(function () {
                                    // cache selections
                        Severity: Minor
                        Found in assets/js/supersubs.js - About 1 hr to fix

                          Method addLink has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            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
                              Severity
                              Category
                              Status
                              Source
                              Language