mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Function adslight_b2_show has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function adslight_b2_show($options)
{
    if (!class_exists(Helper::class)) {
        return [];
    }
Severity: Minor
Found in blocks/ads_2.php - About 3 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

File index.php has 315 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);

/*
-------------------------------------------------------------------------
                     ADSLIGHT 2 : Module for Xoops
Severity: Minor
Found in index.php - About 3 hrs to fix

    Function bindMethods has 87 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            bindMethods : function( c ) {
                var $table = c.$table,
                    namespace = c.namespace,
                    events = ( 'sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete ' +
                        'sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup ' +
    Severity: Major
    Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 3 hrs to fix

      Function bindMethods has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              bindMethods : function( c ) {
                  var $table = c.$table,
                      namespace = c.namespace,
                      events = ( 'sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete ' +
                          'sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup ' +
      Severity: Major
      Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 3 hrs to fix

        Function buildRow has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                buildRow: function( table, c, wo ) {
                    var $filter, col, column, $header, makeSelect, disabled, name, ffxn, tmp,
                        // c.columns defined in computeThIndexes()
                        cellFilter = wo.filter_cellFilter,
                        columns = c.columns,
        Severity: Major
        Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 3 hrs to fix

          Function buildRow has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  buildRow: function( table, c, wo ) {
                      var $filter, col, column, $header, makeSelect, disabled, name, ffxn, tmp,
                          // c.columns defined in computeThIndexes()
                          cellFilter = wo.filter_cellFilter,
                          columns = c.columns,
          Severity: Major
          Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 3 hrs to fix

            Method listingValid has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function listingValid(
                $lid,
                $cat,
                $title,
                $status,
            Severity: Major
            Found in admin/validate_ads.php - About 3 hrs to fix

              Function setupParsers has 84 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      setupParsers : function( c, $tbodies ) {
                          var rows, list, span, max, colIndex, indx, header, configHeaders,
                              noParser, parser, extractor, time, tbody, len,
                              table = c.table,
                              tbodyIndex = 0,
              Severity: Major
              Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 3 hrs to fix

                Function setupParsers has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        setupParsers : function( c, $tbodies ) {
                            var rows, list, span, max, colIndex, indx, header, configHeaders,
                                noParser, parser, extractor, time, tbody, len,
                                table = c.table,
                                tbodyIndex = 0,
                Severity: Major
                Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 3 hrs to fix

                  Method getMoneyFormat has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function getMoneyFormat(
                          $format,
                          $number
                      ) {
                          $regex = '/%((?:[\^!\-]|\+|\(|\=.)*)(\d+)?' . '(?:#(\d+))?(?:\.(\d+))?([in%])/';
                  Severity: Major
                  Found in class/Utility.php - About 3 hrs to fix

                    Function buildHeaders has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            buildHeaders : function( c ) {
                                var $temp, icon, timer, indx;
                                c.headerList = [];
                                c.headerContent = [];
                                c.sortVars = [];
                    Severity: Major
                    Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 3 hrs to fix

                      Function buildHeaders has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              buildHeaders : function( c ) {
                                  var $temp, icon, timer, indx;
                                  c.headerList = [];
                                  c.headerContent = [];
                                  c.sortVars = [];
                      Severity: Major
                      Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 3 hrs to fix

                        Method listingValid has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function listingValid(
                            $lid,
                            $cid,
                            $title,
                            $status,
                        Severity: Major
                        Found in admin/view_ads.php - About 3 hrs to fix

                          File members.php has 305 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 members.php - About 3 hrs to fix

                            File category.php has 302 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/category.php - About 3 hrs to fix

                              File PicturesHandler.php has 302 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php declare(strict_types=1);
                              
                              namespace XoopsModules\Adslight;
                              
                              /*
                              Severity: Minor
                              Found in class/PicturesHandler.php - About 3 hrs to fix

                                Method printAd has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function printAd($lid): void
                                {
                                    global $xoopsConfig, $xoopsDB, $useroffset, $myts;
                                    $helper       = Helper::getInstance();
                                    $currenttheme = $xoopsConfig['theme_set'];
                                Severity: Major
                                Found in print.php - About 3 hrs to fix

                                  Function CHILD has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          "CHILD": function( type, what, argument, first, last ) {
                                              var simple = type.slice( 0, 3 ) !== "nth",
                                                  forward = type.slice( -4 ) !== "last",
                                                  ofType = what === "of-type";
                                  
                                  
                                  Severity: Major
                                  Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 3 hrs to fix

                                    Function Sizzle has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function Sizzle( selector, context, results, seed ) {
                                        var m, i, elem, nid, match, groups, newSelector,
                                            newContext = context && context.ownerDocument,
                                    
                                            // nodeType defaults to 9, since context defaults to document
                                    Severity: Major
                                    Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 3 hrs to fix

                                      Function send has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                                  send: function( headers, complete ) {
                                                      var i,
                                                          xhr = options.xhr();
                                      
                                                      xhr.open(
                                      Severity: Major
                                      Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 3 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language