mambax7/tdmdownloads

View on GitHub

Showing 130 of 207 total issues

Function getForm has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring.
Open

    public function getForm($donnee = [], $erreur = false, $action = false)
    {
        global $xoopsModule, $xoopsUser;
        $helper = Helper::getInstance();
        $utility       = new \XoopsModules\Tdmdownloads\Utility();
Severity: Minor
Found in class/Downloads.php - About 2 days 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 xoops_version.php has 803 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);
/**
 * TDMDownload
Severity: Major
Found in xoops_version.php - About 1 day to fix

    File downloads.php has 684 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare(strict_types=1);
    
    use Xmf\Module\Admin;
    Severity: Major
    Found in admin/downloads.php - About 1 day to fix

      Function getForm has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getForm($lid, $erreur, $donnee = [], $action = false)
          {
              global $xoopsDB, $xoopsModule, $xoopsUser;
              $helper        = Helper::getInstance();
              $moduleDirName = \basename(\dirname(__DIR__));
      Severity: Minor
      Found in class/Modified.php - About 1 day 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 Blocksadmin.php has 577 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      declare(strict_types=1);
      
      namespace XoopsModules\Tdmdownloads\Common;
      Severity: Major
      Found in class/Common/Blocksadmin.php - About 1 day to fix

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

            public function getForm($donnee = [], $erreur = false, $action = false)
            {
                global $xoopsModule, $xoopsUser;
                $helper = Helper::getInstance();
                $utility       = new \XoopsModules\Tdmdownloads\Utility();
        Severity: Major
        Found in class/Downloads.php - About 1 day to fix

          Method listBlocks has 210 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function listBlocks(): void
              {
                  global $xoopsModule, $pathIcon16;
                  require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                  //        xoops_loadLanguage('admin', 'system');
          Severity: Major
          Found in class/Common/Blocksadmin.php - About 1 day to fix

            Function truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function truncateHtml(
                    string $text,
                    ?int $length = 100,
                    string $ending = '...',
                    bool $exact = false,
            Severity: Minor
            Found in class/Common/SysUtility.php - About 1 day 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 getForm has 175 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getForm($lid, $erreur, $donnee = [], $action = false)
                {
                    global $xoopsDB, $xoopsModule, $xoopsUser;
                    $helper        = Helper::getInstance();
                    $moduleDirName = \basename(\dirname(__DIR__));
            Severity: Major
            Found in class/Modified.php - About 7 hrs to fix

              Function importWfdownloads has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
              Open

              function importWfdownloads($shots = '', $catimg = '')
              {
                  $moduleDirName = basename(dirname(__DIR__));
                  $ok            = \Xmf\Request::getInt('ok', 0, 'POST');
                  global $xoopsDB;
              Severity: Minor
              Found in admin/import.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

              Function importMydownloads has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

              function importMydownloads($path = '', $imgurl = '')
              {
                  $moduleDirName = basename(dirname(__DIR__));
                  $ok            = \Xmf\Request::getInt('ok', 0, 'POST');
                  global $xoopsDB;
              Severity: Minor
              Found in admin/import.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 update_tdmdownloads_v201 has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

              function update_tdmdownloads_v201($module)
              {
                  $moduleDirName      = \basename(\dirname(__DIR__));
                  $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                  $helper             = Helper::getInstance();
              Severity: Minor
              Found in include/onupdate.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 b_tdmdownloads_search_show has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              function b_tdmdownloads_search_show()
              {
                  require dirname(__DIR__) . '/include/common.php';
                  $moduleDirName = basename(dirname(__DIR__));
                  require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
              Severity: Minor
              Found in blocks/tdmdownloads_search.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 b_tdmdownloads_top_show has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
              Open

              function b_tdmdownloads_top_show($options)
              {
                  require dirname(__DIR__) . '/include/common.php';
                  /** @var \XoopsModuleHandler $moduleHandler */
                  $moduleHandler = xoops_getHandler('module');
              Severity: Minor
              Found in blocks/tdmdownloads_top.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 listBlocks has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function listBlocks(): void
                  {
                      global $xoopsModule, $pathIcon16;
                      require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                      //        xoops_loadLanguage('admin', 'system');
              Severity: Minor
              Found in class/Common/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

              File Utility.php has 363 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              declare(strict_types=1);
              
              namespace XoopsModules\Tdmdownloads;
              Severity: Minor
              Found in class/Utility.php - About 4 hrs to fix

                Method importMydownloads has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function importMydownloads($path = '', $imgurl = '')
                {
                    $moduleDirName = basename(dirname(__DIR__));
                    $ok            = \Xmf\Request::getInt('ok', 0, 'POST');
                    global $xoopsDB;
                Severity: Major
                Found in admin/import.php - About 4 hrs to fix

                  Method b_tdmdownloads_top_show has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function b_tdmdownloads_top_show($options)
                  {
                      require dirname(__DIR__) . '/include/common.php';
                      /** @var \XoopsModuleHandler $moduleHandler */
                      $moduleHandler = xoops_getHandler('module');
                  Severity: Major
                  Found in blocks/tdmdownloads_top.php - About 4 hrs to fix

                    File category.php has 345 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    declare(strict_types=1);
                    
                    use Xmf\Module\Admin;
                    Severity: Minor
                    Found in admin/category.php - About 4 hrs to fix

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

                      function b_tdmdownloads_search_show()
                      {
                          require dirname(__DIR__) . '/include/common.php';
                          $moduleDirName = basename(dirname(__DIR__));
                          require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
                      Severity: Major
                      Found in blocks/tdmdownloads_search.php - About 4 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language