mambax7/tdmdownloads

View on GitHub

Showing 130 of 207 total issues

Method getImagesCriteria has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private function getImagesCriteria($crImages, $albId, $start, $limit, $sort, $order)
Severity: Minor
Found in class/Common/ImagesHandler.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (1 == $helper->getConfig('permission_download')) {
                            /** @var \XoopsGroupPermHandler $grouppermHandler */
                            $grouppermHandler = xoops_getHandler('groupperm');
                            $criteria         = new \CriteriaCompo();
                            $criteria->add(new \Criteria('gperm_itemid', $lidDownloads, '='));
    Severity: Major
    Found in submit.php - About 45 mins to fix

      Method resizeAndCrop has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function resizeAndCrop($src_url, $src_mimetype, $dest_url, $dest_w, $dest_h, $quality = 90)
      Severity: Minor
      Found in class/Common/ImageResizer.php - About 45 mins to fix

        Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                string $text,
                ?int $length = 100,
                string $ending = '...',
                bool $exact = false,
                bool $considerHtml = true
        Severity: Minor
        Found in class/Common/SysUtility.php - About 35 mins to fix

          Method getCountImages has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function getCountImages($albId = 0, $start = 0, $limit = 0, $sort = 'img_id ASC, img_name', $order = 'ASC')
          Severity: Minor
          Found in class/Common/ImagesHandler.php - About 35 mins to fix

            Method makeArrayTreeOptions has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                protected function makeArrayTreeOptions($fieldName, $key, &$ret, $prefix_orig, $prefix_curr = '')
            Severity: Minor
            Found in class/Tree.php - About 35 mins to fix

              Method getPathTree has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static function getPathTree($mytree, $key, $category_array, $title, $prefix = '')
              Severity: Minor
              Found in class/Utilities.php - About 35 mins to fix

                Method getPathTree has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function getPathTree($mytree, $key, $category_array, $title, $prefix = '')
                Severity: Minor
                Found in class/Utility.php - About 35 mins to fix

                  Method tdmdownloads_search has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function tdmdownloads_search($queryarray, $andor, $limit, $offset, $userid)
                  Severity: Minor
                  Found in include/search.inc.php - About 35 mins to fix

                    Method resizeImage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function resizeImage($sourcefile, $endfile, $max_width, $max_height, $imageMimetype)
                    Severity: Minor
                    Found in class/Common/ImageResizer.php - About 35 mins to fix

                      Method openCollapsableBar has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public static function openCollapsableBar($tablename = '', $iconname = '', $tabletitle = '', $tabledsc = '', $open = true)
                      Severity: Minor
                      Found in class/Utility.php - About 35 mins to fix

                        Function __construct has a Cognitive Complexity of 7 (exceeds 5 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 35 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 renameColumns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function renameColumns(): void
                            {
                                foreach ($this->renameColumns as $tableName) {
                                    if ($this->tableHandler->useTable($tableName)) {
                                        $oldName    = $tableName['from'];
                        Severity: Minor
                        Found in class/Common/Migrate.php - About 35 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 getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function getEditor(?\Xmf\Module\Helper $helper = null, ?array $options = null): ?\XoopsFormTextArea
                            {
                                $descEditor = null;
                        
                                /** @var Helper $helper */
                        Severity: Minor
                        Found in class/Common/SysUtility.php - About 35 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 b_tdmdownloads_top_edit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function b_tdmdownloads_top_edit($options)
                        {
                            //appel de la class
                            $moduleDirName   = basename(dirname(__DIR__));
                            $categoryHandler = Helper::getInstance()->getHandler('Category');
                        Severity: Minor
                        Found in blocks/tdmdownloads_top.php - About 35 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 getFileSize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function getFileSize($url)
                            {
                                if (\function_exists('curl_init') && false !== ($curlHandle = \curl_init($url))) {
                                    \curl_setopt($curlHandle, \CURLOPT_RETURNTRANSFER, true);
                                    \curl_setopt($curlHandle, \CURLOPT_HEADER, true);
                        Severity: Minor
                        Found in class/Utility.php - About 35 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

                        Avoid too many return statements within this method.
                        Open

                                        return ['error' => \sprintf(\constant($moduleDirNameUpper . '_' . 'FAILSAVEWM_MEDIUM'), $this->imageNicename, $resWm)];
                        Severity: Major
                        Found in class/Common/FineimpuploadHandler.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return ['error' => \sprintf(\constant($moduleDirNameUpper . '_' . 'FAILSAVEWM_LARGE'), $this->imageNicename, $resWm)];
                          Severity: Major
                          Found in class/Common/FineimpuploadHandler.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return ['success' => true, 'uuid' => $uuid];
                            Severity: Major
                            Found in class/Common/FineimpuploadHandler.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return true;
                              Severity: Major
                              Found in class/Common/ImageResizer.php - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language