XoopsModules25x/wfdownloads

View on GitHub

Showing 279 of 279 total issues

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

        $filename,
        $uploadDirectory = 'uploads',
        $allowedMimetypes = [],
        $redirectURL = 'index.php',
        $num = 0,
Severity: Major
Found in class/Utility.php - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (r || 2 !== n.which && !n.ctrlKey && !n.metaKey) {
                var a = void 0 !== o.disableOn ? o.disableOn : e.magnificPopup.defaults.disableOn;
                if (a)if (e.isFunction(a)) {
                    if (!a.call(t))return!0
                } else if (a > I.width())return!0;
    Severity: Major
    Found in assets/js/magnific/jquery.magnific-popup.min.js - About 1 hr to fix

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

              $path = 'uploads',
              $value = null,
              $selected = '',
              $size = 1,
              $emptyselect = 0,
      Severity: Major
      Found in class/WfsLists.php - About 1 hr to fix

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

                $objHandler,
                $criteria = null,
                $field_name = null,
                array $alphabet = [],
                $arg_name = 'letter',
        Severity: Major
        Found in class/Common/LetterChoice.php - About 1 hr to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              }, next                                                                                                                                                                                                                                                                                                                                          : function () {
                  t.direction = !0, t.index = K(t.index + 1), t.updateItemHTML()
              }, prev                                                                                                                                                                                                                                                                                                                                          : function () {
          Severity: Minor
          Found in assets/js/magnific/jquery.magnific-popup.min.js and 1 other location - About 55 mins to fix
          assets/js/magnific/jquery.magnific-popup.min.js on lines 371..373

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 54.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              }, prev                                                                                                                                                                                                                                                                                                                                          : function () {
                  t.direction = !1, t.index = K(t.index - 1), t.updateItemHTML()
              }, goTo                                                                                                                                                                                                                                                                                                                                          : function (e) {
          Severity: Minor
          Found in assets/js/magnific/jquery.magnific-popup.min.js and 1 other location - About 55 mins to fix
          assets/js/magnific/jquery.magnific-popup.min.js on lines 369..371

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 54.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              if (1 == $helper->getConfig('screenshot')) {
                  $xoopsTpl->assign('shots_dir', $helper->getConfig('screenshots'));
                  $xoopsTpl->assign('shotwidth', $helper->getConfig('shotwidth'));
                  $xoopsTpl->assign('shotheight', $helper->getConfig('shotheight'));
                  $xoopsTpl->assign('viewcat', true);
          Severity: Minor
          Found in viewcat.php and 1 other location - About 55 mins to fix
          newlist.php on lines 104..110

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 99.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          if (1 == $helper->getConfig('screenshot')) {
              $xoopsTpl->assign('shots_dir', $helper->getConfig('screenshots'));
              $xoopsTpl->assign('shotwidth', $helper->getConfig('shotwidth'));
              $xoopsTpl->assign('shotheight', $helper->getConfig('shotheight'));
              $xoopsTpl->assign('show_screenshot', true);
          Severity: Minor
          Found in newlist.php and 1 other location - About 55 mins to fix
          viewcat.php on lines 333..339

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 99.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

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

              public static function rmove($src, $dest)
              {
                  // 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function recurseCopy($src, $dst)
              {
                  $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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              $source = [
                  'cat'       => $GLOBALS['xoopsDB']->prefix('mydownloads_cat'),
                  'downloads' => $GLOBALS['xoopsDB']->prefix('mydownloads_downloads'),
                  'broken'    => $GLOBALS['xoopsDB']->prefix('mydownloads_broken'),
                  'mod'       => $GLOBALS['xoopsDB']->prefix('mydownloads_mod'),
          Severity: Minor
          Found in admin/import.php and 1 other location - About 55 mins to fix
          admin/import.php on lines 483..490

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 98.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              $source = [
                  'cat'       => $GLOBALS['xoopsDB']->prefix('wmpdownloads_cat'),
                  'downloads' => $GLOBALS['xoopsDB']->prefix('wmpdownloads_downloads'),
                  'broken'    => $GLOBALS['xoopsDB']->prefix('wmpdownloads_broken'),
                  'mod'       => $GLOBALS['xoopsDB']->prefix('wmpdownloads_mod'),
          Severity: Minor
          Found in admin/import.php and 1 other location - About 55 mins to fix
          admin/import.php on lines 685..692

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 98.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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/ObjectTree.php - About 50 mins to fix

            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

                      Severity
                      Category
                      Status
                      Source
                      Language