mambax7/marquee

View on GitHub

Showing 85 of 103 total issues

Function start has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
Open

XbMarquee.prototype.start = function () {
    var markup = '';

    this.stop();

Severity: Minor
Found in assets/js/xbMarquee.js - 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 xoops_module_update_marquee has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

function xoops_module_update_marquee(\XoopsModule $module, $previousVersion = null)
{
    $moduleDirName      = \basename(\dirname(__DIR__));
    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
    /** @var Marquee\Helper $helper */ /** @var Marquee\Utility $utility */
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

Method listBlocks has 214 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function listBlocks(): void
    {
        global $xoopsModule, $pathIcon16;
        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
        $moduleDirName      = \basename(\dirname(__DIR__));
Severity: Major
Found in admin/blocksadmin.php - About 1 day to fix

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

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

    File blocksadmin.php has 498 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php declare(strict_types=1);
    
    /**
     * You may not change or alter any portion of this comment or credits
     * of supporting developers from this source code or any supporting source code
    Severity: Minor
    Found in admin/blocksadmin.php - About 7 hrs to fix

      Function listBlocks has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

          function listBlocks(): void
          {
              global $xoopsModule, $pathIcon16;
              require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
              $moduleDirName      = \basename(\dirname(__DIR__));
      Severity: Minor
      Found in admin/blocksadmin.php - About 6 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 start has 129 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      XbMarquee.prototype.start = function () {
          var markup = '';
      
          this.stop();
      
      
      Severity: Major
      Found in assets/js/xbMarquee.js - About 5 hrs to fix

        Function updateBlock has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

            function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups): void
            {
                $myblock = new XoopsBlock($bid);
                $myblock->setVar('title', $btitle);
                $myblock->setVar('weight', $bweight);
        Severity: Minor
        Found in admin/blocksadmin.php - About 4 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 constructMarquee has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

            public function constructMarquee($uniqid = '')
            {
                //        require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
                $tblalign     = ['top', 'bottom', 'middle'];
                $tblbehaviour = ['scroll', 'slide', 'alternate'];
        Severity: Minor
        Found in class/Marqueex.php - About 3 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 b_marquee_newbb has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

        function b_marquee_newbb($limit, $dateFormat, $itemsSize)
        {
            //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
            $block = [];
            /** @var \XoopsModuleHandler $moduleHandler */
        Severity: Minor
        Found in plugins/newbb.php - About 3 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_marquee_newbb has 95 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function b_marquee_newbb($limit, $dateFormat, $itemsSize)
        {
            //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
            $block = [];
            /** @var \XoopsModuleHandler $moduleHandler */
        Severity: Major
        Found in plugins/newbb.php - About 3 hrs to fix

          File main.php has 316 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php declare(strict_types=1);
          
          /**
           * ****************************************************************************
           * marquee - MODULE FOR XOOPS
          Severity: Minor
          Found in admin/main.php - About 3 hrs to fix

            Function b_marquee_smartpartner has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

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

            File xbMarquee.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* ***** BEGIN LICENSE BLOCK *****
             * The contents of this file are subject to the Mozilla Public License Version
             * 1.1 (the "License"); you may not use this file except in compliance with
             * the License. You may obtain a copy of the License at
             * http://www.mozilla.org/MPL/
            Severity: Minor
            Found in assets/js/xbMarquee.js - About 3 hrs to fix

              Method constructMarquee has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function constructMarquee($uniqid = '')
                  {
                      //        require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
                      $tblalign     = ['top', 'bottom', 'middle'];
                      $tblbehaviour = ['scroll', 'slide', 'alternate'];
              Severity: Major
              Found in class/Marqueex.php - About 2 hrs to fix

                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

                Function XbMarquee has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function XbMarquee(id, height, width, scrollAmount, scrollDelay, direction, behavior, html) {
                    this.id = id;
                    this.scrollAmount = scrollAmount ? scrollAmount : 6;
                    this.scrollDelay = scrollDelay ? scrollDelay : 85;
                    this.direction = direction ? direction.toLowerCase() : 'left';
                Severity: Major
                Found in assets/js/xbMarquee.js - About 2 hrs to fix

                  Method xoops_module_update_marquee has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function xoops_module_update_marquee(\XoopsModule $module, $previousVersion = null)
                  {
                      $moduleDirName      = \basename(\dirname(__DIR__));
                      $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                      /** @var Marquee\Helper $helper */ /** @var Marquee\Utility $utility */
                  Severity: Major
                  Found in include/onupdate.php - About 2 hrs to fix

                    Function XbMarquee has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function XbMarquee(id, height, width, scrollAmount, scrollDelay, direction, behavior, html) {
                        this.id = id;
                        this.scrollAmount = scrollAmount ? scrollAmount : 6;
                        this.scrollDelay = scrollDelay ? scrollDelay : 85;
                        this.direction = direction ? direction.toLowerCase() : 'left';
                    Severity: Minor
                    Found in assets/js/xbMarquee.js - 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 AddEditMarqueeForm has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function AddEditMarqueeForm(
                        $marqueeid,
                        $action,
                        $formTitle,
                        $contentvalue,
                    Severity: Major
                    Found in admin/main.php - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language