XoopsModules25x/tag

View on GitHub

Showing 105 of 1,477 total issues

Function myalbum0_tag_iteminfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    public static function tag_define_url_delimiter(): void
    {
        if (\defined('URL_DELIMITER')) {
            if (!\in_array(URL_DELIMITER, ['?', '/'], true)) {
                exit('Security Violation');
Severity: Minor
Found in class/Utility.php - About 35 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 newbb_tag_iteminfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function newbb_tag_iteminfo(array &$items): bool
{
    if (empty($items)) {
        return false;
    }
Severity: Minor
Found in plugin/newbb.php - About 35 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 randomquote_tag_iteminfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function randomquote_tag_iteminfo(array &$items): bool
{
    $items_id = [];
    $cats_id  = [];
    /*
Severity: Minor
Found in plugin/randomquote.php - About 25 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 getByItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getByItem(int $itemid, int $modid = 0, int $catid = 0): array
    {
        $ret = [];

        $modid  = (empty($modid) && \is_object($GLOBALS['xoopsModule'])
Severity: Minor
Found in class/TagHandler.php - About 25 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