mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Avoid deeply nested control flow statements.
Open

                            if ( hasParser && ( parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
                                // determine column max value (ignore sign)
                                colMax[ cacheIndex ] = Math.max( Math.abs( txt ) || 0, colMax[ cacheIndex ] || 0 );
                            }
Severity: Major
Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 45 mins to fix

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

    function xoops_module_install_adslight(\XoopsModule $module): bool
    {
        require_once \dirname(__DIR__, 3) . '/mainfile.php';
    
        global $xoopsDB;
    Severity: Minor
    Found in include/oninstall.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

    Avoid deeply nested control flow statements.
    Open

                                if ( $.inArray( setting, ignore ) < 0 && typ === 'undefined' ) {
                                    console.warn( 'Tablesorter Warning! "table.config.' + setting + '.' + setting2 + '" option not recognized' );
                                }
    Severity: Major
    Found in assets/js/tablesorter/js/jquery.tablesorter.js - 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 sortNumericAsc has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                sortNumericAsc : function( a, b, num, max, col, c ) {
        Severity: Minor
        Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 45 mins to fix

          Function sortNumericDesc has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  sortNumericDesc : function( a, b, num, max, col, c ) {
          Severity: Minor
          Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ( !$sorted[ column ].sortDisabled ) {
                                            updateColumnSort( $sorted.eq( column ), list[ indx ][ 1 ] );
                                        }
            Severity: Major
            Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          for ( indx = 1; indx < th.colSpan; indx++ ) {
                                              c.sortList[ c.sortList.length ] = [ col + indx, dir ];
                                              // update count on columns in colSpan
                                              c.sortVars[ col + indx ].count = $.inArray( dir, order );
                                              c.sortVars[ col + indx ].sortedBy = sortedBy;
              Severity: Major
              Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if ( span > 0 ) {
                                                index = 0;
                                                while ( index <= span ) {
                                                    // duplicate text (or not) to spanned columns
                                                    // instead of setting duplicate span to empty string, use textExtraction to try to get a value
                Severity: Major
                Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if ( temp ) {
                                                  tmp = c.sortList[ 0 ][ 1 ];
                                                  switch ( temp[ 0 ] ) {
                                                      case 'd' :
                                                          dir = 1;
                  Severity: Major
                  Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if ( tmp[1] === 2 ) {
                                                    c.sortList.splice( indx, 1 );
                                                    c.sortVars[ col ].count = -1;
                                                }
                    Severity: Major
                    Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if ( noParser ) {
                                                      parser = ts.getParserById( 'no-parser' );
                                                  }
                      Severity: Major
                      Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 45 mins to fix

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

                                $criteria = [],
                                $asobject = false,
                                $sort = 'cod_img',
                                $cat_order = 'ASC',
                                $limit = 0,
                        Severity: Minor
                        Found in class/Pictures.php - About 45 mins to fix

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

                              public static function convertOrderByOut($orderby): string
                              {
                                  if ('title ASC' === $orderby) {
                                      $orderby = 'titleA';
                                  }
                          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 getFileStatus has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
                              {
                                  global $pathIcon16;
                                  $moduleDirName      = \basename(\dirname(__DIR__, 2));
                                  $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                          Severity: Minor
                          Found in class/Common/FileChecker.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 makeAdSelBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function makeAdSelBox($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 ($photo) {
                                                        $a_item['photo'] = '<img src="' . XOOPS_URL . "/modules/adslight/assets/images/camera_photo.png\" align=\"left\" width=\"24\" alt=\"{$title}\">";
                                                    }
                            Severity: Major
                            Found in index.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ($chcount > $helper->getConfig('adslight_nbsouscat')) {
                                                          $subcategories .= "<a href=\"viewcats.php?cid={$myrow['cid']}\">" . _ADSLIGHT_CATPLUS . '</a>';
                                                          break;
                                                      }
                              Severity: Major
                              Found in index.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (is_file("{$destination2}/thumb_{$purl}")) {
                                                              unlink("{$destination2}/thumb_{$purl}");
                                                          }
                                  Severity: Major
                                  Found in modify.php - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language