XoopsModules25x/wfdownloads

View on GitHub

Showing 182 of 279 total issues

Method cloneBlock has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function cloneBlock($bid)
    {
        require_once __DIR__ . '/admin_header.php';

        xoops_cp_header();
Severity: Minor
Found in admin/blocksadmin.php - About 1 hr to fix

    Method editBlock has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function editBlock($bid)
        {
            require_once __DIR__ . '/admin_header.php';
            xoops_cp_header();
            $adminObject = Admin::getInstance();
    Severity: Minor
    Found in admin/blocksadmin.php - About 1 hr to fix

      Method approveModification has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function approveModification($requestid)
          {
              $sql = "UPDATE {$this->table} m, {$this->helper->getHandler('Download')->table} d";
              $sql .= " SET
                  d.cid = m.cid,
      Severity: Minor
      Found in class/ModificationHandler.php - About 1 hr to fix

        Method getListTypeAsArray has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getListTypeAsArray($dirname, $type = '', $prefix = '', $noselection = 1)
            {
                $filelist = [];
                switch (\trim($type)) {
                    case 'images':
        Severity: Minor
        Found in class/WfsLists.php - About 1 hr to fix

          Function render has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render($alphaCount = null, $howmanyother = null)
              {
                  $moduleDirName      = \basename(dirname(__DIR__, 2));
                  $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                  \xoops_loadLanguage('common', $moduleDirName);
          Severity: Minor
          Found in class/Common/LetterChoice.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 update_tables_to_322 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          function update_tables_to_322($module)
          {
              $dbupdater = new Wfdownloads\Dbupdater();
          
              // create wfdownloads_meta table
          Severity: Minor
          Found in include/onupdate.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 getForm has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getForm($action = false)
              {
                  $grouppermHandler = \xoops_getHandler('groupperm');
          
                  if (!$action) {
          Severity: Minor
          Found in class/Category.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 wfdownloads_top_by_cat_show has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          function wfdownloads_top_by_cat_show($options)
          {
              if (!class_exists(Helper::class)) {
                  return false;
              }
          Severity: Minor
          Found in blocks/top_by_cat.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 loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          function loadTableFromArrayWithReplace($table, $data, $search, $replace)
          {
              /** @var \XoopsMySQLDatabase $db */
              $db = XoopsDatabaseFactory::getDatabaseConnection();
          
          
          Severity: Minor
          Found in testdata/index.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 convertHtml2text has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function convertHtml2text($document)
              {
                  $search = [
                      "'<script[^>]*?>.*?</script>'si", // Strip out javascript
                      "'<img.*?>'si", // Strip out img tags
          Severity: Minor
          Found in class/Utility.php - About 1 hr to fix

            Function open has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                }, open                   : function (n) {
                    i || (i = e(document.body));
                    var r;
                    if (n.isObj === !1) {
                        t.items = n.items.toArray(), t.index = 0;
            Severity: Minor
            Found in assets/js/magnific/jquery.magnific-popup.min.js - About 1 hr to fix

              Method getServerStats has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getServerStats()
                  {
                      //mb    /** @var \XoopsModules\Wfdownloads\Helper $helper */
                      //mb    $helper = \XoopsModules\Wfdownloads\Helper::getInstance();
                      $moduleDirName      = \basename(dirname(__DIR__, 2));
              Severity: Minor
              Found in class/Common/ServerStats.php - About 1 hr to fix

                Method wfdownloads_createLogo has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function wfdownloads_createLogo($dirname)
                {
                    $helper = Helper::getInstance();
                    // Check extension/functions
                    if (!extension_loaded('gd')) {
                Severity: Minor
                Found in admin/clone.php - About 1 hr to fix

                  Method convertorderbyin has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function convertorderbyin($orderby)
                      {
                          switch (\trim($orderby)) {
                              case 'titleA':
                                  $orderby = 'title ASC';
                  Severity: Minor
                  Found in class/Utility.php - About 1 hr to fix

                    Method makeMySelBox has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
                        {
                            if ('' == $sel_name) {
                                $sel_name = $this->id;
                            }
                    Severity: Minor
                    Found in class/Common/XoopsTree.php - About 1 hr to fix

                      Method displayIcons has 36 lines of code (exceeds 25 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 1 hr to fix

                        Method makeMySelBox has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
                            {
                                if ('' == $sel_name) {
                                    $sel_name = $this->id;
                                }
                        Severity: Minor
                        Found in class/XoopsTree.php - About 1 hr to fix

                          Function getDirListAsArray has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function getDirListAsArray($dirname)
                              {
                                  $dirlist = [];
                                  if (\is_dir($dirname) && $handle = \opendir($dirname)) {
                                      while (false !== ($file = \readdir($handle))) {
                          Severity: Minor
                          Found in class/WfsLists.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 makeMySelBox has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
                              {
                                  if ('' == $sel_name) {
                                      $sel_name = $this->id;
                                  }
                          Severity: Minor
                          Found in class/Common/XoopsTree.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 makeMySelBox has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
                              {
                                  if ('' == $sel_name) {
                                      $sel_name = $this->id;
                                  }
                          Severity: Minor
                          Found in class/XoopsTree.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

                          Severity
                          Category
                          Status
                          Source
                          Language