mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

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-plus-jquery.js - About 2 hrs to fix

    Function done has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function done( status, nativeStatusText, responses, headers ) {
                var isSuccess, success, error, response, modified,
                    statusText = nativeStatusText;
    
                // Ignore repeat invocations
    Severity: Major
    Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 2 hrs to fix

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

        Consider simplifying this complex logical expression.
        Open

                                if ( forward && useCache ) {
        
                                    // Seek `elem` from a previously-cached index
        
                                    // ...in a gzip-friendly way
        Severity: Critical
        Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 2 hrs to fix

          Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
              if ( postFilter && !postFilter[ expando ] ) {
                  postFilter = setMatcher( postFilter );
              }
              if ( postFinder && !postFinder[ expando ] ) {
          Severity: Major
          Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 2 hrs to fix

            Function superMatcher has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    superMatcher = function( seed, context, xml, results, outermost ) {
                        var elem, j, matcher,
                            matchedCount = 0,
                            i = "0",
                            unmatched = seed && [],
            Severity: Major
            Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 2 hrs to fix

              Function loadTableFromArrayWithReplace has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

              function loadTableFromArrayWithReplace($table, $data, $search, $replace): int
              {
                  /** @var \XoopsMySQLDatabase $db */
                  $db = \XoopsDatabaseFactory::getDatabaseConnection();
              
              
              Severity: Minor
              Found in testdata/index.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 bindEvents has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      bindEvents : function( table, $headers, core ) {
                          table = $( table )[ 0 ];
                          var tmp,
                              c = table.config,
                              namespace = c.namespace,
              Severity: Major
              Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 2 hrs to fix

                Function bindEvents has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        bindEvents : function( table, $headers, core ) {
                            table = $( table )[ 0 ];
                            var tmp,
                                c = table.config,
                                namespace = c.namespace,
                Severity: Major
                Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 2 hrs to fix

                  Method xoops_module_update_adslight has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function xoops_module_update_adslight(\XoopsModule $module, $previousVersion = null): bool
                  {
                      global $xoopsDB;
                      $moduleDirName = \basename(\dirname(__DIR__));
                      $helper        = Helper::getInstance();
                  Severity: Major
                  Found in include/onupdate.php - About 2 hrs to fix

                    Method mailAd has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function mailAd($lid, $yname, $ymail, $fname, $fmail): void
                    {
                        global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
                        $helper = Helper::getInstance();
                    
                    
                    Severity: Major
                    Found in sendfriend.php - About 2 hrs to fix

                      Method adsNewCat has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Method mailAd has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function mailAd($lid, $yname, $ymail, $fname, $fmail): void
                        {
                            global $xoopsConfig, $xoopsTpl, $xoopsDB, $xoopsModule, $myts;
                            $helper = Helper::getInstance();
                            if ('1' === $helper->getConfig('adslight_use_captcha')) {
                        Severity: Major
                        Found in report-abuse.php - About 2 hrs to fix

                          Method truncateHtml has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function truncateHtml(
                                  string $text,
                                  ?int $length = 100,
                                  string $ending = '...',
                                  bool $exact = false,
                          Severity: Major
                          Found in class/Common/SysUtility.php - About 2 hrs to fix

                            Method modifyAdsS has 20 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                $lid,
                                $cat,
                                $title,
                                $status,
                                $expire,
                            Severity: Major
                            Found in admin/validate_ads.php - About 2 hrs to fix

                              Method modifyAds has 20 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  $lid,
                                  $cat,
                                  $title,
                                  $status,
                                  $expire,
                              Severity: Major
                              Found in admin/modify_ads.php - About 2 hrs to fix

                                Method modifyAdsS has 20 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    $lid,
                                    $cat,
                                    $title,
                                    $status,
                                    $expire,
                                Severity: Major
                                Found in admin/view_ads.php - About 2 hrs to fix

                                  Method listingValid has 20 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      $lid,
                                      $cid,
                                      $title,
                                      $status,
                                      $expire,
                                  Severity: Major
                                  Found in admin/view_ads.php - About 2 hrs to fix

                                    Method listingValid has 20 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        $lid,
                                        $cat,
                                        $title,
                                        $status,
                                        $expire,
                                    Severity: Major
                                    Found in admin/validate_ads.php - About 2 hrs to fix

                                      Utility has 23 functions (exceeds 20 allowed). Consider refactoring.
                                      Open

                                      class Utility extends Common\SysUtility
                                      {
                                          //--------------- Custom module methods -----------------------------
                                          /**
                                           * @return void
                                      Severity: Minor
                                      Found in class/Utility.php - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language