XoopsModules25x/wfdownloads

View on GitHub

Showing 182 of 279 total issues

Function listBlocks has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    function listBlocks()
    {
        global $xoopsModule, $pathIcon16;
        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
        $moduleDirName = basename(dirname(__DIR__));
Severity: Minor
Found in admin/blocksadmin.php - About 6 hrs 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

File jquery.magnific-popup.min.js has 427 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! Magnific Popup - v0.9.9 - 2013-12-27
 * http://dimsemenov.com/plugins/magnific-popup/
 * Copyright (c) 2013 Dmitry Semenov; */
(function (e) {
    var t, n, i, o, r, a, s, l = "Close", c = "BeforeClose", d = "AfterClose", u = "BeforeAppend", p = "MarkupParse", f = "Open", m = "Change", g = "mfp", h = "." + g, v = "mfp-ready", C = "mfp-removing", y = "mfp-prevent-close", w = function () {
Severity: Minor
Found in assets/js/magnific/jquery.magnific-popup.min.js - About 6 hrs to fix

    File submit.php has 418 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*
     You may not change or alter any portion of this comment or credits
     of supporting developers from this source code or any supporting source code
     which is considered copyrighted (c) material of the original comment or credit authors.
    Severity: Minor
    Found in submit.php - About 6 hrs to fix

      Function displayIcons has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function displayIcons($time, $status = \_WFDOWNLOADS_STATUS_WAITING, $counter = 0)
          {
              $helper = Helper::getInstance();
      
              $new     = '';
      Severity: Minor
      Found in class/Utility.php - About 5 hrs 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 wfdownloads_search has 133 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function wfdownloads_search($queryArray, $andor, $limit, $offset, $userId = 0, $categories = [], $sortBy = 0, $searchIn = '', $extra = '')
      {
          $helper = Helper::getInstance();
      
          $userGroups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : [0 => XOOPS_GROUP_ANONYMOUS];
      Severity: Major
      Found in include/search.inc.php - About 5 hrs to fix

        Method update_tables_to_323 has 131 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function update_tables_to_323(XoopsModule $module)
        {
            $dbupdater = new Wfdownloads\Dbupdater();
        
            // update wfdownloads_downloads table
        Severity: Major
        Found in include/onupdate.php - About 5 hrs to fix

          Function getDownloadTime has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getDownloadTime($size = 0, $gmodem = 1, $gisdn = 1, $gdsl = 1, $gslan = 0, $gflan = 0)
              {
                  $aflag  = [];
                  $amtime = [];
                  $artime = [];
          Severity: Minor
          Found in class/Utility.php - About 5 hrs 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 getForm has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getForm($customArray = []) // $custom array added April 22, 2006 by jwe)
              {
                  require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
                  require_once XOOPS_ROOT_PATH . '/class/tree.php';
          
          
          Severity: Minor
          Found in class/Download.php - About 4 hrs 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

          File modinfo.php has 370 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /*
           You may not change or alter any portion of this comment or credits
           of supporting developers from this source code or any supporting source code
           which is considered copyrighted (c) material of the original comment or credit authors.
          Severity: Minor
          Found in language/english/modinfo.php - About 4 hrs to fix

            Function getAdminForm has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getAdminForm($title, $customArray = []) // $custom array added April 22, 2006 by jwe
                {
                    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
            
                    $use_mirrors = $this->helper->getConfig('enable_mirrors');
            Severity: Minor
            Found in class/Download.php - About 4 hrs 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 render has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
            Open

                public function render()
                {
                    $ele_name = $this->getName();
                    $ret      = '';
                    $ret      .= "<form name='{$ele_name}' id='{$ele_name}' action='{$this->getAction()}' method='{$this->getMethod()}' onsubmit='return xoopsFormValidate_{$ele_name}();' {$this->getExtra()} >" . NWLINE;
            Severity: Minor
            Found in class/MulticolumnsThemeForm.php - About 4 hrs 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

            File reportsmodifications.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /*
             You may not change or alter any portion of this comment or credits
             of supporting developers from this source code or any supporting source code
             which is considered copyrighted (c) material of the original comment or credit authors.
            Severity: Minor
            Found in admin/reportsmodifications.php - About 4 hrs to fix

              Function updateBlock has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
              Open

                  function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
                  {
                      $myblock = new XoopsBlock($bid);
                      $myblock->setVar('title', $btitle);
                      $myblock->setVar('weight', $bweight);
              Severity: Minor
              Found in admin/blocksadmin.php - About 4 hrs 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 editCategory has 109 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function editCategory($showmenu = false, $categoryId = 0, $nbSubCats = 4, $categoryObj = null)
                  {
                      $helper = Helper::getInstance();
              
                      // if there is a parameter, and the id exists, retrieve data: we're editing a category
              Severity: Major
              Found in class/Utility.php - About 4 hrs to fix

                Method getForm has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getForm($action = false)
                    {
                        $grouppermHandler = \xoops_getHandler('groupperm');
                
                        if (!$action) {
                Severity: Major
                Found in class/Category.php - About 4 hrs to fix

                  File viewcat.php has 326 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /*
                   You may not change or alter any portion of this comment or credits
                   of supporting developers from this source code or any supporting source code
                   which is considered copyrighted (c) material of the original comment or credit authors.
                  Severity: Minor
                  Found in viewcat.php - About 3 hrs to fix

                    Function createThumb has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function createThumb($imgName, $imgPath, $imgSavePath, $width = 100, $height = 100, $quality = 100, $update = false, $aspect = 1)
                        {
                            $helper = Helper::getInstance();
                    
                            // Paths
                    Severity: Minor
                    Found in class/Utility.php - About 3 hrs 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 largeDownload has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function largeDownload($filePath, $fileMimetype)
                        {
                            /* You may need these ini settings too */
                            \set_time_limit(0);
                            \ini_set('memory_limit', '512M');
                    Severity: Minor
                    Found in class/Utility.php - About 3 hrs 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 editCategory has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function editCategory($showmenu = false, $categoryId = 0, $nbSubCats = 4, $categoryObj = null)
                        {
                            $helper = Helper::getInstance();
                    
                            // if there is a parameter, and the id exists, retrieve data: we're editing a category
                    Severity: Minor
                    Found in class/Utility.php - About 3 hrs 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

                    File main.php has 298 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /*
                     You may not change or alter any portion of this comment or credits
                     of supporting developers from this source code or any supporting source code
                     which is considered copyrighted (c) material of the original comment or credit authors.
                    Severity: Minor
                    Found in language/english/main.php - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language