mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

File Tree.php has 362 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);

namespace XoopsModules\Adslight;

/*
Severity: Minor
Found in class/Tree.php - About 4 hrs to fix

    Method expireAd has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function expireAd(): void
        {
            global $xoopsDB, $xoopsConfig, $xoopsModule, $myts, $meta;
            $helper = Helper::getInstance();
    
    
    Severity: Major
    Found in class/Utility.php - About 4 hrs to fix

      Function processRow has 110 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              processRow: function( c, data, vars ) {
                  var result, filterMatched,
                      fxn, ffxn, txt,
                      wo = c.widgetOptions,
                      showRow = true,
      Severity: Major
      Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 4 hrs to fix

        Function processRow has 110 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                processRow: function( c, data, vars ) {
                    var result, filterMatched,
                        fxn, ffxn, txt,
                        wo = c.widgetOptions,
                        showRow = true,
        Severity: Major
        Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 4 hrs to fix

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

          function index(): void
          {
              global $xoopsDB, $myts, $admin_lang;
              //    require_once __DIR__ . '/admin_header.php';
              xoops_cp_header();
          Severity: Major
          Found in admin/options.php - About 4 hrs to fix

            Function modifyAds has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            function modifyAds($lid): void
            {
                global $xoopsDB, $myts, $desctext, $admin_lang;
                $helper = Helper::getInstance();
                $mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
            Severity: Minor
            Found in admin/view_ads.php - About 4 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 modifyAd has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            function modifyAd($lid): void
            {
                global $xoopsDB, $xoopsModule, $xoopsConfig, $myts, $desctext;
            
                $helper        = Helper::getInstance();
            Severity: Minor
            Found in admin/modify_ads.php - About 4 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 setup has 103 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    setup : function( table, c ) {
                        // if no thead or tbody, or tablesorter is already present, quit
                        if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
                            if ( ts.debug(c, 'core') ) {
                                if ( table.hasInitialized ) {
            Severity: Major
            Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 4 hrs to fix

              Function setup has 103 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      setup : function( table, c ) {
                          // if no thead or tbody, or tablesorter is already present, quit
                          if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
                              if ( ts.debug(c, 'core') ) {
                                  if ( table.hasInitialized ) {
              Severity: Major
              Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 4 hrs to fix

                Function then has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                then: function( onFulfilled, onRejected, onProgress ) {
                                    var maxDepth = 0;
                                    function resolve( depth, deferred, handler, special ) {
                                        return function() {
                                            var that = this,
                Severity: Major
                Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 4 hrs to fix

                  Function format has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          format: function(table, c, wo) {
                              var i, tmp, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme,
                                  themesAll = ts.themes,
                                  $table = c.$table.add( $( c.namespace + '_extra_table' ) ),
                                  $headers = c.$headers.add( $( c.namespace + '_extra_headers' ) ),
                  Severity: Major
                  Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 4 hrs to fix

                    Function format has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            format: function(table, c, wo) {
                                var i, tmp, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme,
                                    themesAll = ts.themes,
                                    $table = c.$table.add( $( c.namespace + '_extra_table' ) ),
                                    $headers = c.$headers.add( $( c.namespace + '_extra_headers' ) ),
                    Severity: Major
                    Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 4 hrs to fix

                      Function Animation has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function Animation( elem, properties, options ) {
                          var result,
                              stopped,
                              index = 0,
                              length = Animation.prefilters.length,
                      Severity: Major
                      Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 3 hrs to fix

                        Method adsModCat has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function adsModCat($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 3 hrs to fix

                          Method render has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function render(?array $block = null): void
                              {
                                  \xoops_load('XoopsFormLoader');
                                  \xoops_loadLanguage('common', $this->moduleDirNameUpper);
                          
                          
                          Severity: Major
                          Found in class/Common/Blocksadmin.php - About 3 hrs to fix

                            Method __construct has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function __construct($target)
                                {
                                    $this->helper       = $target->helper;
                                    $this->targetObject = $target;
                            
                            
                            Severity: Major
                            Found in class/Form/ListingForm.php - About 3 hrs to fix

                              Function trigger has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  trigger: function( event, data, elem, onlyHandlers ) {
                              
                                      var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
                                          eventPath = [ elem || document ],
                                          type = hasOwn.call( event, "type" ) ? event.type : event,
                              Severity: Major
                              Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 3 hrs to fix

                                Method adslight_b2_show has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function adslight_b2_show($options)
                                {
                                    if (!class_exists(Helper::class)) {
                                        return [];
                                    }
                                Severity: Major
                                Found in blocks/ads_2.php - About 3 hrs to fix

                                  Function indexView has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function indexView($lid = null): void
                                  {
                                      global $xoopsDB, $myts, $desctext, $admin_lang;
                                      $helper = Helper::getInstance();
                                      $mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
                                  Severity: Minor
                                  Found in admin/view_ads.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

                                  Function indexView has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function indexView($lid): void
                                  {
                                      global $xoopsDB, $xoopsModule, $myts, $desctext, $admin_lang;
                                      $helper = Helper::getInstance();
                                      $mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
                                  Severity: Minor
                                  Found in admin/validate_ads.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language