mambax7/mymenus

View on GitHub

Showing 93 of 115 total issues

Method xoops_module_update_mymenus has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function xoops_module_update_mymenus(\XoopsObject $xoopsModule, $previousVersion)
{
    if ($previousVersion < 151) {
        //if (!checkInfoTemplates($xoopsModule)) return false;
        if (!Updater::checkInfoTable($xoopsModule)) {
Severity: Major
Found in include/onupdate.php - About 2 hrs to fix

    Function deleteDirectory has a Cognitive Complexity of 18 (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 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 render has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        public function render(?array $block = null)
        {
            \xoops_load('XoopsFormLoader');
            \xoops_loadLanguage('common', $this->moduleDirNameUpper);
    
    
    Severity: Minor
    Found in class/Common/Blocksadmin.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 53 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

      Method isBlockCloned has 53 lines of code (exceeds 25 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: Major
      Found in class/Common/Blocksadmin.php - 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 = 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 render has 48 lines of code (exceeds 25 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

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

              public static function editLink($id = null, $pid = null, $mid = null)
              {
                  $helper = Helper::getInstance();
                  //
                  // Disable xoops debugger in dialog window
          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

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

              $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
          
                  // default configuration values
                  var cfg = {
                      interval: 100,
          Severity: Minor
          Found in assets/js/superfish1.7.10/js/hoverIntent.js - About 1 hr to fix

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

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

              Method orderBlock has 15 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      array $bid,
                      array $oldtitle,
                      array $oldside,
                      array $oldweight,
                      array $oldvisible,
              Severity: Major
              Found in class/Common/Blocksadmin.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 = Helper::getInstance();
                Severity: Minor
                Found in class/Utility.php - About 1 hr to fix

                  Method getFormFeedback has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getFormFeedback($action = false)
                      {
                          if (false === $action) {
                              $action = $_SERVER['REQUEST_URI'];
                          }
                  Severity: Minor
                  Found in class/Common/ModuleFeedback.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

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

                          public static function addLink($mid): void
                          {
                              $helper = Helper::getInstance();
                      
                              if (!$GLOBALS['xoopsSecurity']->check()) {
                      Severity: Minor
                      Found in class/LinksUtility.php - About 1 hr to fix

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

                            public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                            {
                                $moduleDirName      = \basename(\dirname(__DIR__, 2));
                                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                                $update             = '';
                        Severity: Minor
                        Found in class/Common/VersionChecks.php - About 1 hr to fix

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

                              public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups)
                              : void {
                                  $myblock = new \XoopsBlock($bid);
                                  $myblock->setVar('title', $btitle);
                                  $myblock->setVar('weight', $bweight);
                          Severity: Minor
                          Found in class/Common/Blocksadmin.php - About 1 hr to fix

                            Function loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 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

                            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 supersubs has 39 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

                              Function supersubs has 39 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/superfish1.7.10/js/supersubs.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language