mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Avoid deeply nested control flow statements.
Open

                        if (\is_file("{$destination}/{$url}")) {
                            \unlink("{$destination}/{$url}");
                        }
Severity: Major
Found in class/Utility.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (\is_file("{$destination2}/thumb_{$url}")) {
                                \unlink("{$destination2}/thumb_{$url}");
                            }
    Severity: Major
    Found in class/Utility.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (\is_file("{$destination3}/resized_{$url}")) {
                                  \unlink("{$destination3}/resized_{$url}");
                              }
      Severity: Major
      Found in class/Utility.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if ($GLOBALS['xoopsUser']->isAdmin()) {
                                $a_item['admin'] = '<a href="' . XOOPS_URL . "/modules/adslight/admin/validate_ads.php?op=modifyAds&amp;lid={$lid}\"><img src=\"{$pathIcon16}/edit.png\" border=\"0\" alt=\"" . _ADSLIGHT_MODADMIN . '"></a>';
                            }
        Severity: Major
        Found in index.php - About 45 mins to fix

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

              public static function convertOrderByTrans($orderby): string
              {
                  $orderbyTrans = '';
                  if ('hits ASC' === $orderby) {
                      $orderbyTrans = \_ADSLIGHT_POPULARITYLTOM;
          Severity: Minor
          Found in class/Utility.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 delReply has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function delReply($r_lid, $ok): void
          {
              global $xoopsDB;
              $helper = Helper::getInstance();
              $sql    = 'SELECT l.usid, r.r_lid, r.lid, r.title, r.date_created, r.submitter, r.message, r.tele, r.email, r.r_usid FROM ' . $xoopsDB->prefix(
          Severity: Minor
          Found in modify.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 makeMySelBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
          Severity: Minor
          Found in class/Tree.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if ($space > 0) {
                                        $subcategories .= '<br>';
                                    }
            Severity: Major
            Found in index.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if ($photo) {
                                          $a_item['photo'] = '<a href="' . XOOPS_URL . "/modules/adslight/viewads.php?lid={$lid}\"><img class=\"thumb\" src=\"{$updir}/thumbs/thumb_{$url}\" align=\"left\" width=\"100px\" alt=\"{$title}\"></a>";
                                      }
              Severity: Major
              Found in index.php - About 45 mins to fix

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

                        $img,
                        $thumbwidth,
                        $thumbheight,
                        $pictwidth,
                        $pictheight,
                Severity: Minor
                Found in class/PicturesHandler.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (is_file("{$destination3}/resized_{$purl}")) {
                                              unlink("{$destination3}/resized_{$purl}");
                                          }
                  Severity: Major
                  Found in modify.php - About 45 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                                if ( support.qsa &&
                                    !nonnativeSelectorCache[ selector + " " ] &&
                                    (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
                    
                                    // Support: IE 8 only
                    Severity: Major
                    Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                      if ( tsfRegex.andTest.test( data.filter ) ) {
                                          var indx, filterMatched, result, query, regex,
                                              // duplicate data but split filter
                                              data2 = $.extend( {}, data ),
                                              filter = data.filter.split( tsfRegex.andSplit ),
                      Severity: Major
                      Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                                        context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
                        
                                    context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
                                    if ( !context ) {
                        Severity: Major
                        Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if ( tsfRegex.toTest.test( data.iFilter ) ) {
                                              var result, tmp, range1, range2,
                                                  table = c.table,
                                                  index = data.index,
                                                  parsed = data.parsed[index],
                          Severity: Major
                          Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                if ( ( wo.filter_$anyMatch && wo.filter_$anyMatch.length ) ||
                                                    typeof filters[c.columns] !== 'undefined' ) {
                                                    data.anyMatchFlag = true;
                                                    data.anyMatchFilter = '' + (
                                                        filters[ c.columns ] ||
                            Severity: Major
                            Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                              if ( $header && $header.length ) {
                                                  // $filter = c.$filters.filter( '[data-column="' + column + '"]' );
                                                  $filter = tsf.getColumnElm( c, c.$filters, column );
                                                  ffxn = ts.getColumnData( table, wo.filter_functions, column );
                                                  makeSelect = ( wo.filter_functions && ffxn && typeof ffxn !== 'function' ) ||
                              Severity: Major
                              Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if ( matcher[ expando ] ) {
                                                // Find the next relative operator (if any) for proper handling
                                                j = ++i;
                                                for ( ; j < len; j++ ) {
                                                    if ( Expr.relative[ tokens[j].type ] ) {
                                Severity: Major
                                Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if ( ( !support.boxSizingReliable() && isBorderBox ||
                                          val === "auto" ||
                                          !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
                                          elem.getClientRects().length ) {
                                  
                                  
                                  Severity: Major
                                  Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                        if ( ( wo.filter_$anyMatch && wo.filter_$anyMatch.length ) ||
                                                            typeof filters[c.columns] !== 'undefined' ) {
                                                            data.anyMatchFlag = true;
                                                            data.anyMatchFilter = '' + (
                                                                filters[ c.columns ] ||
                                    Severity: Major
                                    Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 40 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language