XoopsModules25x/wfdownloads

View on GitHub

Showing 182 of 279 total issues

Function initGallery has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    e.magnificPopup.registerModule("gallery", {options: {enabled: !1, arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', preload: [0, 2], navigateByImgClick: !0, arrows: !0, tPrev: "Previous (Left arrow key)", tNext: "Next (Right arrow key)", tCounter: "%curr% of %total%"}, proto: {initGallery: function () {
        var n = t.st.gallery, i = ".mfp-gallery", r = Boolean(e.fn.mfpFastClick);
        return t.direction = !0, n && n.enabled ? (a += " mfp-gallery", x(f + i, function () {
            n.navigateByImgClick && t.wrap.on("click" + i, ".mfp-img", function () {
                return t.items.length > 1 ? (t.next(), !1) : void 0
Severity: Minor
Found in assets/js/magnific/jquery.magnific-popup.min.js - About 1 hr to fix

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

        public function updateTable(DbupdaterTable $table)
        {
            $ret = true;
            echo '<ul>';
    
    
    Severity: Minor
    Found in class/Dbupdater.php - About 1 hr to fix

      Function getMaxPublishdate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getMaxPublishdate(\CriteriaElement $criteria = null)
          {
              $field = '';
              $groupby = false;
              if (null !== $criteria && $criteria instanceof \CriteriaElement) {
      Severity: Minor
      Found in class/DownloadHandler.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 toolbar has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function toolbar()
          {
              $helper = Helper::getInstance();
      
              $isSubmissionAllowed = false;
      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 convertorderbyout has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function convertorderbyout($orderby)
          {
              if ('title ASC' === $orderby) {
                  $orderby = 'titleA';
              }
      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 getFileStatus has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
          {
              global $pathIcon16;
      
              if (empty($file_path)) {
      Severity: Minor
      Found in class/Common/FileChecker.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 updateTable has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateTable(DbupdaterTable $table)
          {
              $ret = true;
              echo '<ul>';
      
      
      Severity: Minor
      Found in class/Dbupdater.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 convertOrderByTrans has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function convertOrderByTrans($orderby)
          {
              $orderbyTrans = '';
              if ('title ASC' === $orderby) {
                  $orderbyTrans = \_MD_WFDOWNLOADS_TITLEATOZ;
      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

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

            public static function displayCategory(Wfdownloads\Category $categoryObj, $level = 0)
            {
                $helper = Helper::getInstance();
        
                $description = $categoryObj->description();
        Severity: Minor
        Found in class/Utility.php - About 1 hr to fix

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

              public static function toolbar()
              {
                  $helper = Helper::getInstance();
          
                  $isSubmissionAllowed = false;
          Severity: Minor
          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 createThumb has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function createThumb($imgName, $imgPath, $imgSavePath, $width = 100, $height = 100, $quality = 100, $update = false, $aspect = 1)
                Severity: Major
                Found in class/Utility.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

                    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

                      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

                      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

                      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
                        Severity
                        Category
                        Status
                        Source
                        Language