mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Function xoops_module_update_adslight has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

function xoops_module_update_adslight(\XoopsModule $module, $previousVersion = null): bool
{
    global $xoopsDB;
    $moduleDirName = \basename(\dirname(__DIR__));
    $helper        = Helper::getInstance();
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

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

    public static function truncateHtml(
        string $text,
        ?int $length = 100,
        string $ending = '...',
        bool $exact = false,
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

Function findRows has 205 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        findRows: function( table, filters, currentFilters ) {
            if (
                tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
                !table.config.widgetOptions.filter_initialized
            ) {
Severity: Major
Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 1 day to fix

    Function findRows has 205 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            findRows: function( table, filters, currentFilters ) {
                if (
                    tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
                    !table.config.widgetOptions.filter_initialized
                ) {
    Severity: Major
    Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 1 day to fix

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

      <?php declare(strict_types=1);
      /*
      -------------------------------------------------------------------------
                           ADSLIGHT 2: Module for Xoops
      
      
      Severity: Major
      Found in language/english/main.php - About 1 day to fix

        Function init has 181 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                init: function( table ) {
                    // filter language options
                    ts.language = $.extend( true, {}, {
                        to  : 'to',
                        or  : 'or',
        Severity: Major
        Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 7 hrs to fix

          Function init has 181 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  init: function( table ) {
                      // filter language options
                      ts.language = $.extend( true, {}, {
                          to  : 'to',
                          or  : 'or',
          Severity: Major
          Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 7 hrs to fix

            File viewads.php has 467 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 viewads.php - About 7 hrs to fix

              Function format has 180 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      format: function(table, c, wo) {
                          // filter widget doesn't initialize on an empty table. Fixes #449
                          if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
                              return;
                          }
              Severity: Major
              Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 7 hrs to fix

                Function format has 180 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        format: function(table, c, wo) {
                            // filter widget doesn't initialize on an empty table. Fixes #449
                            if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
                                return;
                            }
                Severity: Major
                Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 7 hrs to fix

                  Function Deferred has 178 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Deferred: function( func ) {
                          var tuples = [
                  
                                  // action, add listener, callbacks,
                                  // ... .then handlers, argument index, [final state]
                  Severity: Major
                  Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 7 hrs to fix

                    File admin.php has 461 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php declare(strict_types=1);
                    /*
                    -------------------------------------------------------------------------
                                         ADSLIGHT 2 : Module for Xoops
                    
                    
                    Severity: Minor
                    Found in language/english/admin.php - About 7 hrs to fix

                      Method modifyAd has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function modifyAd($lid): void
                      {
                          global $xoopsDB, $xoopsModule, $xoopsConfig, $myts, $desctext;
                      
                          $helper        = Helper::getInstance();
                      Severity: Major
                      Found in admin/modify_ads.php - About 6 hrs to fix

                        File options.php has 443 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/options.php - About 6 hrs to fix

                          File modify.php has 441 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 modify.php - About 6 hrs to fix

                            Method index has 164 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function index(): void
                            {
                                global $xoopsDB, $xoopsModule, $myts, $desctext, $admin_lang;
                                $helper = Helper::getInstance();
                                $mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
                            Severity: Major
                            Found in admin/validate_ads.php - About 6 hrs to fix

                              Method modifyAds has 160 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function modifyAds($lid): void
                              {
                                  global $xoopsDB, $xoopsModule, $myts, $desctext, $admin_lang;
                                  $mytree        = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
                                  $helper        = Helper::getInstance();
                              Severity: Major
                              Found in admin/validate_ads.php - About 6 hrs to fix

                                Method modifyAds has 159 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function modifyAds($lid): void
                                {
                                    global $xoopsDB, $myts, $desctext, $admin_lang;
                                    $helper = Helper::getInstance();
                                    $mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
                                Severity: Major
                                Found in admin/view_ads.php - About 6 hrs to fix

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

                                      public function listBlocks(): void
                                      {
                                          $pathIcon16 = Admin::iconUrl('', '16');
                                  
                                          require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                                  Severity: Major
                                  Found in class/Common/Blocksadmin.php - About 6 hrs to fix

                                    Function expireAd has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public static function expireAd(): void
                                        {
                                            global $xoopsDB, $xoopsConfig, $xoopsModule, $myts, $meta;
                                            $helper = Helper::getInstance();
                                    
                                    
                                    Severity: Minor
                                    Found in class/Utility.php - About 5 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language