mambax7/adslight

View on GitHub

Showing 5,122 of 5,122 total issues

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

        if (\class_exists('XoopsFormEditor')) {
            $editorOptions           = [];
            $editorOptions['name']   = 'desctext';
            $editorOptions['value']  = $this->targetObject->getVar('desctext', 'e');
            $editorOptions['rows']   = 5;
Severity: Major
Found in class/Form/ListingForm.php and 2 other locations - About 1 day to fix
class/Form/CategoriesForm.php on lines 88..105
class/Form/RepliesForm.php on lines 81..98

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 249.

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

File main.php has 504 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);
/*
-------------------------------------------------------------------------
                     ADSLIGHT 2: Module for Xoops

Severity: Major
Found in language/english/main.php - About 1 day to fix

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

        if ($numrows > 0) {
            $nom_price = \htmlspecialchars($numrows, ENT_QUOTES | ENT_HTML5); //mb
            //        require_once __DIR__ . '/admin_header.php';
            xoops_cp_header();
            //    loadModuleAdminMenu(2, "");
    Severity: Major
    Found in admin/options.php and 1 other location - About 7 hrs to fix
    admin/options.php on lines 413..438

    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 230.

    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

        if ($numrows > 0) {
            $nom_condition = \htmlspecialchars($numrows, ENT_QUOTES | ENT_HTML5); //mb
    
            //        require_once __DIR__ . '/admin_header.php';
            xoops_cp_header();
    Severity: Major
    Found in admin/options.php and 1 other location - About 7 hrs to fix
    admin/options.php on lines 293..317

    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 230.

    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 init has 181 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            init: function( table ) {
                // filter language options
                ts.language = $.extend( true, {}, {
                    to  : 'to',
                    or  : 'or',
    Severity: Major
    Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 7 hrs to fix

      Function init has 181 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              init: function( table ) {
                  // filter language options
                  ts.language = $.extend( true, {}, {
                      to  : 'to',
                      or  : 'or',
      Severity: Major
      Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 7 hrs to fix

        File viewads.php has 467 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 viewads.php - About 7 hrs to fix

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

                  format: function(table, c, wo) {
                      // filter widget doesn't initialize on an empty table. Fixes #449
                      if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
                          return;
                      }
          Severity: Major
          Found in assets/js/tablesorter/js/jquery.tablesorter.widgets.js - About 7 hrs to fix

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

                    format: function(table, c, wo) {
                        // filter widget doesn't initialize on an empty table. Fixes #449
                        if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
                            return;
                        }
            Severity: Major
            Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 7 hrs to fix

              Function Deferred has 178 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Deferred: function( func ) {
                      var tuples = [
              
                              // action, add listener, callbacks,
                              // ... .then handlers, argument index, [final state]
              Severity: Major
              Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 7 hrs to fix

                File admin.php has 461 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php declare(strict_types=1);
                /*
                -------------------------------------------------------------------------
                                     ADSLIGHT 2 : Module for Xoops
                
                
                Severity: Minor
                Found in language/english/admin.php - About 7 hrs to fix

                  Method modifyAd has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function modifyAd($lid): void
                  {
                      global $xoopsDB, $xoopsModule, $xoopsConfig, $myts, $desctext;
                  
                      $helper        = Helper::getInstance();
                  Severity: Major
                  Found in admin/modify_ads.php - About 6 hrs to fix

                    File options.php has 443 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/options.php - About 6 hrs to fix

                      File modify.php has 441 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 modify.php - About 6 hrs to fix

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

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

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

                          return (object)[
                              //    'name'  => mb_strtoupper($moduleDirName) . ' IconConfigurator',
                              //    'icons' => [
                              'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
                              'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
                          Severity: Major
                          Found in config/icons.php and 1 other location - About 6 hrs to fix
                          include/common.php on lines 63..73

                          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 213.

                          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

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

                          $icons = [
                              'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
                              'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
                              'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
                              'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
                          Severity: Major
                          Found in include/common.php and 1 other location - About 6 hrs to fix
                          config/icons.php on lines 10..23

                          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 213.

                          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

                          Method modifyAds has 160 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function modifyAds($lid): void
                          {
                              global $xoopsDB, $xoopsModule, $myts, $desctext, $admin_lang;
                              $mytree        = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
                              $helper        = Helper::getInstance();
                          Severity: Major
                          Found in admin/validate_ads.php - About 6 hrs to fix

                            Method modifyAds has 159 lines of code (exceeds 25 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: Major
                            Found in admin/view_ads.php - About 6 hrs to fix

                              Method listBlocks has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function listBlocks(): void
                                  {
                                      $pathIcon16 = Admin::iconUrl('', '16');
                              
                                      require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                              Severity: Major
                              Found in class/Common/Blocksadmin.php - About 6 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language