XoopsModules25x/tag

View on GitHub

Showing 105 of 1,477 total issues

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

function tag_load_config()
{
    $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
    trigger_error(__FUNCTION__ . " is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}");
    $GLOBALS['xoopsLogger']->addDeprecated(
Severity: Minor
Found in include/functions.ini.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 tag_load_config has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function tag_load_config()
    {
        static $moduleConfig;

        if (null === $moduleConfig) {
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 tdmdownloads_tag_iteminfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function tdmdownloads_tag_iteminfo(array &$items): bool
{
    if (empty($items)) {
        return false;
    }
Severity: Minor
Found in plugin/tdmdownloads.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 extgallery_tag_iteminfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function extgallery_tag_iteminfo(array &$items): bool
{
    if (empty($items)) {
        return false;
    }
Severity: Minor
Found in plugin/extgallery.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 execCurl has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execCurl(): int
    {
        $curl = \curl_init($this->getServiceUrl());
        \curl_setopt_array(
            $curl,
Severity: Minor
Found in class/Issues.php - About 1 hr to fix

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

        public function setType($value = ''): void
        {
            if ('' !== $value) {
                if (\is_array($value)) {
                    $value       = isset($value['type']) ? \mb_strtolower($value['type']) : 'text';
    Severity: Minor
    Found in class/FormValidatedInput.php - About 1 hr to fix

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

      function newbb_tag_iteminfo(array &$items): bool
      {
          if (empty($items)) {
              return false;
          }
      Severity: Minor
      Found in plugin/newbb.php - About 1 hr to fix

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

        function publisher_tag_iteminfo(array &$items): bool
        {
            if (empty($items)) {
                return false;
            }
        Severity: Minor
        Found in plugin/publisher.php - About 1 hr to fix

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

          function mymodule_tag_iteminfo(array $items): bool
          {
              if (empty($items)) {
                  return false;
              }
          Severity: Minor
          Found in sample.php - About 1 hr to fix

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

            function article_tag_iteminfo(array &$items): bool
            {
                if (empty($items)) {
                    return false;
                }
            Severity: Minor
            Found in plugin/article.php - About 1 hr to fix

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

              function smartsection_tag_iteminfo(array &$items): bool
              {
                  if (empty($items)) {
                      return false;
                  }
              Severity: Minor
              Found in plugin/smartsection.php - About 1 hr to fix

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

                function tag_load_config()
                {
                    $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
                    trigger_error(__FUNCTION__ . " is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}");
                    $GLOBALS['xoopsLogger']->addDeprecated(
                Severity: Minor
                Found in include/functions.ini.php - About 1 hr to fix

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

                      public function getTagData(array $tags_array, int $font_max = 0, int $font_min = 0): array
                      {
                          //        $tags_data_array = [];
                          //        if (\is_array($tags_array) && !empty($tags_array)) {
                          //            // set min and max tag count
                  Severity: Minor
                  Found in class/TagHandler.php - About 1 hr to fix

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

                    function randomquote_tag_iteminfo(array &$items): bool
                    {
                        $items_id = [];
                        $cats_id  = [];
                        /*
                    Severity: Minor
                    Found in plugin/randomquote.php - About 1 hr to fix

                      Method isBlockCloned has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
                      Severity: Major
                      Found in class/Common/Blocksadmin.php - About 1 hr to fix

                        Function rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function rmove(string $src, string $dest): bool
                            {
                                // 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function recurseCopy(string $src, string $dst): void
                            {
                                $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 getItemCount has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function getItemCount(int $tag_id, int $modid = 0, int $catid = 0): int
                            {
                                $ret = 0;
                                if ($tag_id = $tag_id) {
                                    $sql_select = '    SELECT COUNT(DISTINCT o.tl_id)';
                        Severity: Minor
                        Found in class/TagHandler.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 tag_parse_args has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function tag_parse_args(&$args, &$args_string): bool
                            {
                                $args_abb    = [
                                    'c' => 'catid',
                                    'm' => 'modid',
                        Severity: Minor
                        Found in class/Utility.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(string $src, string $dest): bool
                            {
                                // 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

                        Severity
                        Category
                        Status
                        Source
                        Language