mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Consider simplifying this complex logical expression.
Open

                    if ( searchFiltered ) {
                        // cycle through all filters; include last ( columnIndex + 1 = match any column ). Fixes #669
                        for ( indx = 0; indx < columnIndex + 1; indx++ ) {
                            val = filters[indx] || '';
                            // break out of loop if we've already determined not to search filtered rows
Severity: Critical
Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 3 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                        if ( searchFiltered ) {
                            // cycle through all filters; include last ( columnIndex + 1 = match any column ). Fixes #669
                            for ( indx = 0; indx < columnIndex + 1; indx++ ) {
                                val = filters[indx] || '';
                                // break out of loop if we've already determined not to search filtered rows
    Severity: Critical
    Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 3 hrs to fix

      File add.php has 289 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 add.php - About 2 hrs to fix

        File search.php has 289 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 search.php - About 2 hrs to fix

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

              public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups)
              {
                  $myblock = new \XoopsBlock($bid);
                  $myblock->setVar('title', $btitle);
                  $myblock->setVar('weight', $bweight);
          Severity: Minor
          Found in class/Common/Blocksadmin.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 getMoneyFormat has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getMoneyFormat(
                  $format,
                  $number
              ) {
                  $regex = '/%((?:[\^!\-]|\+|\(|\=.)*)(\d+)?' . '(?:#(\d+))?(?:\.(\d+))?([in%])/';
          Severity: Minor
          Found in class/Utility.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 checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function checkVerModule(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 orderBlock has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              public function orderBlock(
                  array $bid,
                  array $oldtitle,
                  array $oldside,
                  array $oldweight,
          Severity: Minor
          Found in class/Common/Blocksadmin.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 add has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              add: function( elem, types, handler, data, selector ) {
          
                  var handleObjIn, eventHandle, tmp,
                      events, t, handleObj,
                      special, handlers, type, namespaces, origType,
          Severity: Major
          Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 2 hrs to fix

            Function matcherFromGroupMatchers has 72 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                var bySet = setMatchers.length > 0,
                    byElement = elementMatchers.length > 0,
                    superMatcher = function( seed, context, xml, results, outermost ) {
                        var elem, j, matcher,
            Severity: Major
            Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 2 hrs to fix

              Function buildSelect has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      buildSelect: function( table, column, arry, updating, onlyAvail ) {
                          table = $( table )[0];
                          column = parseInt( column, 10 );
                          if ( !table.config.cache || $.isEmptyObject( table.config.cache ) ) {
                              return;
              Severity: Major
              Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

                Function buildSelect has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        buildSelect: function( table, column, arry, updating, onlyAvail ) {
                            table = $( table )[0];
                            column = parseInt( column, 10 );
                            if ( !table.config.cache || $.isEmptyObject( table.config.cache ) ) {
                                return;
                Severity: Major
                Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 2 hrs to fix

                  Function setHeadersCss has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          setHeadersCss : function( c ) {
                              var indx, column,
                                  list = c.sortList,
                                  len = list.length,
                                  none = ts.css.sortNone + ' ' + c.cssNone,
                  Severity: Major
                  Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 2 hrs to fix

                    Function setHeadersCss has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            setHeadersCss : function( c ) {
                                var indx, column,
                                    list = c.sortList,
                                    len = list.length,
                                    none = ts.css.sortNone + ' ' + c.cssNone,
                    Severity: Major
                    Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 2 hrs to fix

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

                                          function resolve( depth, deferred, handler, special ) {
                                              return function() {
                                                  var that = this,
                                                      args = arguments,
                                                      mightThrow = function() {
                      Severity: Major
                      Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 2 hrs to fix

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

                                bindSearch: function( table, $el, internal ) {
                                    table = $( table )[0];
                                    $el = $( $el ); // allow passing a selector string
                                    if ( !$el.length ) { return; }
                                    var tmp,
                        Severity: Major
                        Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 2 hrs to fix

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

                                  bindSearch: function( table, $el, internal ) {
                                      table = $( table )[0];
                                      $el = $( $el ); // allow passing a selector string
                                      if ( !$el.length ) { return; }
                                      var tmp,
                          Severity: Major
                          Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

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

                            function index(): void
                            {
                                global $xoopsDB;
                                $helper = Helper::getInstance();
                            
                            
                            Severity: Major
                            Found in admin/modify_ads.php - About 2 hrs to fix

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

                              function adsModCat($cid): void
                              {
                                  global $xoopsDB, $myts;
                                  $helper = Helper::getInstance();
                                  $mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
                              Severity: Minor
                              Found in admin/category.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 build has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                Lightbox.prototype.build = function() {
                                  if ($('#lightbox').length > 0) {
                                      return;
                                  }
                              
                              
                              Severity: Major
                              Found in assets/js/lightbox/js/lightbox.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language