mambax7/waiting

View on GitHub

Showing 37 of 74 total issues

Function xoops_module_update_waiting has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

function xoops_module_update_waiting(\XoopsModule $module, $previousVersion = null)
{
    $moduleDirName      = \basename(\dirname(__DIR__));
    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);

Severity: Minor
Found in include/onupdate.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

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

    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    {
        if ($considerHtml) {
            // if the plain text is shorter than the maximum length, return the whole text
            if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
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

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

function b_waiting_waiting_show($options)
{
    $userLang = $GLOBALS['xoopsConfig']['language'];

    $sql_cache_min  = empty($options[1]) ? 0 : (int)$options[1];
Severity: Minor
Found in blocks/waiting_waiting.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 checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
    {
        $moduleDirName      = \basename(\dirname(__DIR__, 2));
        $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
        $update             = '';
Severity: Minor
Found in class/Common/VersionChecks.php - About 2 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 xoops_module_update_waiting has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function xoops_module_update_waiting(\XoopsModule $module, $previousVersion = null)
{
    $moduleDirName      = \basename(\dirname(__DIR__));
    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);

Severity: Major
Found in include/onupdate.php - About 2 hrs to fix

    Function waiting_get_plugin_info has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    function waiting_get_plugin_info($dirname, $language = 'english')
    {
        // get $mytrustdirname for D3 modules
        $mytrustdirname = '';
        if (defined('XOOPS_TRUST_PATH') && is_file(XOOPS_ROOT_PATH . '/modules/' . $dirname . '/mytrustdirname.php')) {
    Severity: Minor
    Found in include/functions.php - About 2 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 truncateHtml has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
        {
            if ($considerHtml) {
                // if the plain text is shorter than the maximum length, return the whole text
                if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
    Severity: Major
    Found in class/Common/SysUtility.php - About 2 hrs to fix

      Function deleteDirectory has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function deleteDirectory($src)
          {
              // 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 2 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 b_waiting_waiting_show has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function b_waiting_waiting_show($options)
      {
          $userLang = $GLOBALS['xoopsConfig']['language'];
      
          $sql_cache_min  = empty($options[1]) ? 0 : (int)$options[1];
      Severity: Major
      Found in blocks/waiting_waiting.php - About 2 hrs to fix

        Method waiting_get_plugin_info has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function waiting_get_plugin_info($dirname, $language = 'english')
        {
            // get $mytrustdirname for D3 modules
            $mytrustdirname = '';
            if (defined('XOOPS_TRUST_PATH') && is_file(XOOPS_ROOT_PATH . '/modules/' . $dirname . '/mytrustdirname.php')) {
        Severity: Major
        Found in include/functions.php - About 2 hrs to fix

          Function xoops_module_update_waiting has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

          function xoops_module_update_waiting($module, $version)
          {
              return true;  // force return - following code is really only needed for XOOPS < 2.3
              // Keep Block option values when update (by nobunobu)
              $mid = $module->mid();
          Severity: Minor
          Found in include/updateblock.inc.php - About 2 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 xoops_module_update_waiting has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function xoops_module_update_waiting($module, $version)
          {
              return true;  // force return - following code is really only needed for XOOPS < 2.3
              // Keep Block option values when update (by nobunobu)
              $mid = $module->mid();
          Severity: Major
          Found in include/updateblock.inc.php - About 2 hrs to fix

            Method checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                {
                    $moduleDirName      = \basename(\dirname(__DIR__, 2));
                    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                    $update             = '';
            Severity: Minor
            Found in class/Common/VersionChecks.php - About 1 hr to fix

              Method b_waiting_smartfaq has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function b_waiting_smartfaq()
              {
                  /** @var \XoopsMySQLDatabase $xoopsDB */
                  $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
                  $ret     = [];
              Severity: Minor
              Found in plugins/smartfaq.php - About 1 hr to fix

                Method b_waiting_wfdownloads has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function b_waiting_wfdownloads()
                {
                    /** @var \XoopsMySQLDatabase $xoopsDB */
                    $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
                    $ret     = [];
                Severity: Minor
                Found in plugins/wfdownloads.php - About 1 hr to fix

                  Function rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function rrmdir($src)
                      {
                          // 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 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 getServerStats has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function getServerStats()
                      {
                          $moduleDirName      = \basename(\dirname(__DIR__, 2));
                          $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                          \xoops_loadLanguage('common', $moduleDirName);
                  Severity: Minor
                  Found in class/Common/ServerStats.php - About 1 hr to fix

                    Method xoops_module_install_waiting has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function xoops_module_install_waiting(\XoopsModule $module)
                    {
                        require_once \dirname(__DIR__, 3) . '/mainfile.php';
                        //    require_once   \dirname(__DIR__) . '/config/config.php';
                    
                    
                    Severity: Minor
                    Found in include/oninstall.php - About 1 hr to fix

                      Method b_waiting_addresses has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function b_waiting_addresses()
                      {
                          /** @var \XoopsMySQLDatabase $xoopsDB */
                          $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
                          $ret     = [];
                      Severity: Minor
                      Found in plugins/addresses.php - About 1 hr to fix

                        Method b_waiting_wflinks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function b_waiting_wflinks()
                        {
                            /** @var \XoopsMySQLDatabase $xoopsDB */
                            $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
                            $ret     = [];
                        Severity: Minor
                        Found in plugins/wflinks.php - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language