mambax7/tdmdownloads

View on GitHub

Showing 130 of 207 total issues

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

    public function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $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

    Method getPathTreeUrl has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function getPathTreeUrl(
            $mytree,
            $key,
            $category_array,
            $title,
    Severity: Minor
    Found in class/Utilities.php - About 1 hr to fix

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

      function rrmdir($src)
      {
          if (is_dir($src)) {
              $dir = opendir($src);
              while (false !== ($file = readdir($dir))) {
      Severity: Minor
      Found in include/onupdate.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 getNumbersOfEntries has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getNumbersOfEntries($mytree, $categories, $entries, $cid)
          {
              $count     = 0;
              $child_arr = [];
              if (\in_array($cid, $categories)) {
      Severity: Minor
      Found in class/Utilities.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 getNumbersOfEntries has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getNumbersOfEntries($mytree, $categories, $entries, $cid)
          {
              $count     = 0;
              $child_arr = [];
              if (\in_array($cid, $categories)) {
      Severity: Minor
      Found in class/Utility.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 convertSizeToString has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function convertSizeToString($sizeString)
          {
              $mysizeString = '';
              if ('' != $sizeString) {
                  $size_value_arr = \explode(' ', $sizeString);
      Severity: Minor
      Found in class/Utility.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 resizeAndCrop has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function resizeAndCrop($src_url, $src_mimetype, $dest_url, $dest_w, $dest_h, $quality = 90)
          {
              // check file extension
              switch ($src_mimetype) {
                  case 'image/png':
      Severity: Minor
      Found in class/Common/ImageResizer.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 tdmdownloads_notify_iteminfo has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function tdmdownloads_notify_iteminfo($category, $item_id)
      {
          global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
          $moduleDirName = basename(dirname(__DIR__));
          $item_id       = (int)$item_id;
      Severity: Minor
      Found in include/notification.inc.php - About 1 hr to fix

        Method __construct has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function __construct($target)
            {
                $moduleDirName      = \basename(\dirname(__DIR__, 2));
                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                /** @var \XoopsModules\Tdmdownloads\Helper $this- >helper */
        Severity: Minor
        Found in class/Form/UploadForm.php - About 1 hr to fix

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

          function tdmdownloads_search($queryarray, $andor, $limit, $offset, $userid)
          {
              global $xoopsDB;
              $moduleDirName = basename(dirname(__DIR__));
              $sql           = 'SELECT lid, cid, title, description, submitter, date FROM ' . $xoopsDB->prefix('tdmdownloads_downloads') . ' WHERE status != 0';
          Severity: Minor
          Found in include/search.inc.php - About 1 hr to fix

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

                public function getForm($lid, $action = false)
                {
                    //        global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
                    if (!$action) {
                        $action = $_SERVER['REQUEST_URI'];
            Severity: Minor
            Found in class/Rating.php - About 1 hr to fix

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

                  public static function createLogo($dirname)
                  {
                      if (!\extension_loaded('gd')) {
                          return false;
                      }
              Severity: Minor
              Found in class/Cloner.php - About 1 hr to fix

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

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

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

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

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

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

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

                          public function editBlock($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 isBlockCloned has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $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

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

                        function tdmdownloads_tag_iteminfo(&$items)
                        {
                            if (empty($items) || !is_array($items)) {
                                return false;
                            }
                        Severity: Minor
                        Found in extra/plugins/tag/tdmdownloads.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(string $src): bool
                            {
                                // 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 tdmdownloads_search has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function tdmdownloads_search($queryarray, $andor, $limit, $offset, $userid)
                        {
                            global $xoopsDB;
                            $moduleDirName = basename(dirname(__DIR__));
                            $sql           = 'SELECT lid, cid, title, description, submitter, date FROM ' . $xoopsDB->prefix('tdmdownloads_downloads') . ' WHERE status != 0';
                        Severity: Minor
                        Found in include/search.inc.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

                        Severity
                        Category
                        Status
                        Source
                        Language