mambax7/tdmdownloads

View on GitHub

Showing 130 of 207 total issues

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

    public function getStatusImage($time, $status)
    {
        global $xoopsModuleConfig;
        $moduleDirName = \basename(\dirname(__DIR__));
        $helper        = Helper::getInstance();
Severity: Minor
Found in class/Utility.php - About 1 hr to fix

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

        public static function getStatusImage($time, $status)
        {
            $moduleDirName = \basename(\dirname(__DIR__));
            $helper    = Helper::getInstance();
            $count     = 7;
    Severity: Minor
    Found in class/Utilities.php - About 1 hr to fix

      Method updateBlock has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups): void
      Severity: Major
      Found in class/Common/Blocksadmin.php - About 1 hr to fix

        Method tdmdownloads_tag_iteminfo has 28 lines of code (exceeds 25 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

          Method convertSizeToString has 28 lines of code (exceeds 25 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

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

            function b_waiting_tdmdownloads()
            {
                /** @var \XoopsMySQLDatabase $xoopsDB */
                $xoopsDB       = \XoopsDatabaseFactory::getDatabaseConnection();
                $moduleDirName = basename(dirname(__DIR__, 2));
            Severity: Minor
            Found in extra/plugins/waiting/tdmdownloads.php - About 1 hr to fix

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

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

              function loadSampleData()
              {
                  global $xoopsConfig;
                  $moduleDirName      = \basename(\dirname(__DIR__));
                  $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
              Severity: Minor
              Found in testdata/index.php - About 1 hr to fix

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

                    public static function getServerStats(): string
                    {
                        //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 handleImageDB has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function handleImageDB()
                      {
                          $moduleDirName = \basename(\dirname(__DIR__, 2));
                          require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/header.php';
                          global $xoopsUser;
                  Severity: Minor
                  Found in class/Common/FineimpuploadHandler.php - About 1 hr to fix

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

                        public static function cloneFileFolder($path)
                        {
                            global $patKeys;
                            global $patValues;
                    
                    
                    Severity: Minor
                    Found in class/Cloner.php - About 1 hr to fix

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

                          public function getValuesImages($keys = null, $format = null, $maxDepth = null)
                          {
                              $moduleDirName      = \basename(\dirname(__DIR__, 2));
                              $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                              $helper             = Helper::getInstance();
                      Severity: Minor
                      Found in class/Common/Images.php - About 1 hr to fix

                        Method isBlockCloned has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups): void
                        Severity: Major
                        Found in class/Common/Blocksadmin.php - About 1 hr to fix

                          Method getPathTreeUrl has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public static function getPathTreeUrl($mytree, $key, $category_array, $title, $prefix = '', $link = false, $order = 'ASC', $lasturl = false)
                          Severity: Major
                          Found in class/Utility.php - About 1 hr to fix

                            Method getPathTreeUrl has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    $mytree,
                                    $key,
                                    $category_array,
                                    $title,
                                    $prefix = '',
                            Severity: Major
                            Found in class/Utilities.php - About 1 hr to fix

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

                                  public static function recurseCopy(string $src, string $dst): void
                                  {
                                      $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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function rcopy(string $src, string $dest): 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 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 update_tdmdownloads_v200 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function update_tdmdownloads_v200(&$module)
                              {
                                  // Update size
                                  $moduleDirName = basename(dirname(__DIR__));
                                  $db            = \XoopsDatabaseFactory::getDatabaseConnection();
                              Severity: Minor
                              Found in include/onupdate.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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function rmove(string $src, string $dest): 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 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

                              Method setOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule): void
                              Severity: Major
                              Found in class/Common/Blocksadmin.php - About 50 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language