mambax7/marquee

View on GitHub

Showing 85 of 103 total issues

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

function b_marquee_tplleaguestats($limit, $dateFormat, $itemsSize)
{
    //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
    //######################## SETTINGS ######################
    $displaySeason  = false; // display season name?
Severity: Minor
Found in plugins/tplleaguestats.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 formMarkRequiredFields has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function formMarkRequiredFields($sform)
    {
        $required = $elements = [];
        if (self::needsAsterisk()) {
            foreach ($sform->getRequired() as $item) {
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 b_marquee_comments has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function b_marquee_comments($limit, $dateFormat, $itemsSize)
{
    //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
    require XOOPS_ROOT_PATH . '/include/comment_constants.php';
    $block  = [];
Severity: Minor
Found in plugins/comments.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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

function AddEditMarqueeForm(
    $marqueeid,
    $action,
    $formTitle,
    $contentvalue,
Severity: Minor
Found in admin/main.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($src, $dest)
    {
        // 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

Method setOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule = null)
Severity: Major
Found in admin/blocksadmin.php - About 50 mins to fix

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

        function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null): void
    Severity: Major
    Found in admin/blocksadmin.php - About 50 mins to fix

      Function b_marquee_smartfaq has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function b_marquee_smartfaq($limit, $dateFormat, $itemsSize)
      {
          require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
          $block             = [];
          $smartModule       = &sf_getModuleInfo();
      Severity: Minor
      Found in plugins/smartfaq.php - About 45 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 b_marquee_smartclient has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function b_marquee_smartclient($limit, $dateFormat, $itemsSize)
      {
          $block = [];
          if (!defined('SMARTCLIENT_DIRNAME')) {
              define('SMARTCLIENT_DIRNAME', 'smartclient');
      Severity: Minor
      Found in plugins/smartclient.php - About 45 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

      Method getWysiwygForm has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $caption,
              $name,
              $value = '',
              $width = '100%',
              $height = '400px',
      Severity: Minor
      Found in class/Utility.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (\is_file($templateFolder . $v)) {
                                        unlink($templateFolder . $v);
                                    }
        Severity: Major
        Found in include/onupdate.php - About 45 mins to fix

          Function b_marquee_smartsection has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function b_marquee_smartsection($limit, $dateFormat, $itemsSize)
          {
          
              if (!class_exists('XoopsModules\Smartsection\Helper')) {
                  return false;
          Severity: Minor
          Found in plugins/smartsection.php - About 45 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 xoopspartners_random has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function xoopspartners_random($numberPartners, $random = true, $orden = '', $desc = '')
          {
              global $xoopsDB;
              $PartnersId  = [];
              $ArrayReturn = [];
          Severity: Minor
          Found in plugins/xoopspartners.php - About 45 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

          Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          Severity: Minor
          Found in class/Common/SysUtility.php - About 35 mins to fix

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

            function b_marquee_news($limit, $dateFormat, $itemsSize)
            {
                //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
                require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
                $block      = $stories = [];
            Severity: Minor
            Found in plugins/news.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 getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getEditor($helper = null, $options = null)
                {
                    /** @var Helper $helper */
                    if (null === $options) {
                        $options           = [];
            Severity: Minor
            Found in class/Common/SysUtility.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 myglob has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function myglob($folder = '', $pattern = 'php')
            {
                $result = [];
            
                if (!($dir = opendir($folder))) {
            Severity: Minor
            Found in admin/functions.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 b_marquee_article has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function b_marquee_article($limit, $dateFormat, $itemsSize)
            {
                global $xoopsDB;
                //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
                require_once XOOPS_ROOT_PATH . '/modules/article/include/functions.php';
            Severity: Minor
            Found in plugins/article.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 b_marquee_wfdownloads has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function b_marquee_wfdownloads($limit, $dateFormat, $itemsSize)
            {
                $block = [];
                global $xoopsUser;
                /** @var \XoopsModuleHandler $moduleHandler */
            Severity: Minor
            Found in plugins/wfdownloads.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

            Severity
            Category
            Status
            Source
            Language