XoopsModules25x/wfdownloads

View on GitHub

Showing 182 of 279 total issues

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

    function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule)
Severity: Major
Found in admin/blocksadmin.php - About 50 mins to fix

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

        function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null)
    Severity: Major
    Found in admin/blocksadmin.php - About 50 mins to fix

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

          public function makeSelBox($name, $fieldName, $prefix = '-', $selected = '', $addEmptyOption = false, $key = 0, $extra = '')
      Severity: Major
      Found in class/Common/ObjectTree.php - About 50 mins to fix

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

            public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
        Severity: Minor
        Found in class/XoopsTree.php - About 45 mins to fix

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

              public static function getDownloadTime($size = 0, $gmodem = 1, $gisdn = 1, $gdsl = 1, $gslan = 0, $gflan = 0)
          Severity: Minor
          Found in class/Utility.php - About 45 mins to fix

            Function download has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function download($filePath, $isBinary = true, $retBytes = true)
                {
                    // how many bytes per chunk
                    //$chunkSize = 1 * (1024 * 1024);
                    $chunkSize    = 8 * (1024 * 1024); //8MB (highest possible fread length)
            Severity: Minor
            Found in class/Utility.php - About 45 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 deeply nested control flow statements.
            Open

                                        if (is_file($templateFolder . $v)) {
                                            unlink($templateFolder . $v);
                                        }
            Severity: Major
            Found in include/onupdate.php - About 45 mins to fix

              Function wfdownloads_top_show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function wfdownloads_top_show($options)
              {
                  if (!class_exists(Helper::class)) {
                      return false;
                  }
              Severity: Minor
              Found in blocks/top.php - About 45 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 makeMySelBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
              Severity: Minor
              Found in class/Common/XoopsTree.php - About 45 mins to fix

                Function displayImage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function displayImage($image = '', $href = '', $imgSource = '', $altText = '')
                    {
                        $helper = Helper::getInstance();
                
                        $showImage = '';
                Severity: Minor
                Found in class/Utility.php - About 45 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

                Consider simplifying this complex logical expression.
                Open

                if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time()
                    || true === $downloadObj->getVar('offline')
                    || (0 != $downloadObj->getVar('expired')
                        && $downloadObj->getVar('expired') < time())
                    || _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
                Severity: Major
                Found in singlefile.php - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                  if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time()
                      || 1 === $downloadObj->getVar('offline')
                      || (1 === $downloadObj->getVar('expired')
                          && $downloadObj->getVar('expired') < time())
                      || _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
                  Severity: Major
                  Found in brokenfile.php - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                    if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time()
                        || true === $downloadObj->getVar('offline')
                        || (0 != $downloadObj->getVar('expired')
                            && $downloadObj->getVar('expired') < time())
                        || _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
                    Severity: Major
                    Found in mirror.php - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                      if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time()
                          || true === $downloadObj->getVar('offline')
                          || (0 != $downloadObj->getVar('expired')
                              && $downloadObj->getVar('expired') < time())
                          || _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
                      Severity: Major
                      Found in review.php - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                        if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time() || true === $downloadObj->getVar('offline')
                            || (0 != $downloadObj->getVar('expired')
                                && $downloadObj->getVar('expired') < time())
                            || _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
                            redirect_header('index.php', 3, _MD_WFDOWNLOADS_NODOWNLOAD);
                        Severity: Major
                        Found in visit.php - About 40 mins to fix

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

                              public function makeSelBoxOptionsArray($fieldName, $key, &$optionsArray, $prefix_orig, $prefix_curr = '')
                          Severity: Minor
                          Found in class/Common/ObjectTree.php - About 35 mins to fix

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

                                public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                            Severity: Minor
                            Found in class/Utility.php - About 35 mins to fix

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

                                  public function makeSelBoxOptionsArray($fieldName, $key, &$optionsArray, $prefix_orig, $prefix_curr = '')
                              Severity: Minor
                              Found in class/ObjectTree.php - About 35 mins to fix

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

                                    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                                Severity: Minor
                                Found in class/Common/SysUtility.php - About 35 mins to fix

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

                                      public function __construct($uploadDir, $allowedMimeTypes, $maxFileSize, $maxWidth = 0, $maxHeight = 0)
                                  Severity: Minor
                                  Found in class/MediaImgUploader.php - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language