mambax7/adslight

View on GitHub

Showing 5,122 of 5,122 total issues

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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              case 'copyfile':
                  if (Request::hasVar('original_file_path', 'POST')) {
                      $original_file_path = $_POST['original_file_path'];
                  }
                  if (Request::hasVar('file_path', 'POST')) {
          Severity: Major
          Found in class/Common/FileChecker.php and 1 other location - About 4 hrs to fix
          class/Common/DirectoryChecker.php on lines 146..158

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 168.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              case 'setdirperm':
                  if (Request::hasVar('path', 'POST')) {
                      $path = $_POST['path'];
                  }
                  if (Request::hasVar('redirect', 'POST')) {
          Severity: Major
          Found in class/Common/DirectoryChecker.php and 1 other location - About 4 hrs to fix
          class/Common/FileChecker.php on lines 147..159

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 168.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

                                Severity
                                Category
                                Status
                                Source
                                Language