XoopsModules25x/tag

View on GitHub

Showing 1,477 of 1,477 total issues

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

    public function getItems(\CriteriaElement $criteria = null): array
    {
        $ret = [];
        $sql = '    SELECT o.tl_id, o.tag_itemid, o.tag_modid, o.tag_catid, o.tag_time';
        $sql .= "    FROM {$this->table_link} AS o LEFT JOIN {$this->table} AS l ON l.{$this->keyName} = o.{$this->keyName}";
Severity: Minor
Found in class/TagHandler.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 xnews_tag_iteminfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

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

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

function xfaq_tag_iteminfo(array &$items): bool
{
    if (empty($items)) {
        return false;
    }
Severity: Minor
Found in plugin/xfaq.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

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 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 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 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 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 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 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 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 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 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 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

                        Each class must be in a namespace of at least one level (a top-level vendor name)
                        Open

                        class TagCorePreload extends \XoopsPreloadItem
                        Severity: Minor
                        Found in preloads/core.php by phpcodesniffer

                        Each class must be in a namespace of at least one level (a top-level vendor name)
                        Open

                        class XoopsFormTag extends Tag\FormTag
                        Severity: Minor
                        Found in include/formtag.php by phpcodesniffer

                        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