mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Function index has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

function index(): void
{
    global $xoopsDB, $myts, $desctext, $admin_lang;
    $helper = Helper::getInstance();

Severity: Minor
Found in admin/view_ads.php - About 5 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

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

function index(): void
{
    global $xoopsDB, $myts, $desctext, $admin_lang;
    $helper = Helper::getInstance();

Severity: Major
Found in admin/view_ads.php - About 5 hrs to fix

    Function modifyAds has a Cognitive Complexity of 37 (exceeds 5 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: Minor
    Found in admin/validate_ads.php - About 5 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

    Method indexView has 136 lines of code (exceeds 25 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: Major
    Found in admin/validate_ads.php - About 5 hrs to fix

      Function listingDel has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

      function listingDel($lid, $ok): void
      {
          global $xoopsDB;
          $helper = Helper::getInstance();
          $sql = 'SELECT usid FROM ' . $xoopsDB->prefix('adslight_listing') . ' WHERE lid=' . $xoopsDB->escape($lid);
      Severity: Minor
      Found in modify.php - About 5 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

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

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

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

          Method adslight_seo_title has 132 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function adslight_seo_title($title = '', $withExt = false)
          {
              /**
               * if XOOPS ML is present, let's sanitize the title with the current language
               */
          Severity: Major
          Found in seo_url.php - About 5 hrs to fix

            File modify_ads.php has 386 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/modify_ads.php - About 5 hrs to fix

              Function index has a Cognitive Complexity of 35 (exceeds 5 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: Minor
              Found in admin/validate_ads.php - About 5 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 buildCache has 129 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      buildCache : function( c, callback, $tbodies ) {
                          var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row,
                              cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
                              colMax, span, cacheIndex, hasParser, max, len, index,
                              table = c.table,
              Severity: Major
              Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 5 hrs to fix

                Function buildCache has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        buildCache : function( c, callback, $tbodies ) {
                            var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row,
                                cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
                                colMax, span, cacheIndex, hasParser, max, len, index,
                                table = c.table,
                Severity: Major
                Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 5 hrs to fix

                  File viewcats.php has 374 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 viewcats.php - About 5 hrs to fix

                    Function initSort has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            initSort : function( c, cell, event ) {
                                if ( c.table.isUpdating ) {
                                    // let any updates complete before initializing a sort
                                    return setTimeout( function() {
                                        ts.initSort( c, cell, event );
                    Severity: Major
                    Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 4 hrs to fix

                      Function initSort has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              initSort : function( c, cell, event ) {
                                  if ( c.table.isUpdating ) {
                                      // let any updates complete before initializing a sort
                                      return setTimeout( function() {
                                          ts.initSort( c, cell, event );
                      Severity: Major
                      Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 4 hrs to fix

                        File lightbox.js has 373 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /*!
                         * Lightbox v2.11.3
                         * by Lokesh Dhakar
                         *
                         * More info:
                        Severity: Minor
                        Found in assets/js/lightbox/js/lightbox.js - About 4 hrs to fix

                          Function defaultPrefilter has 122 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function defaultPrefilter( elem, props, opts ) {
                              var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
                                  isBox = "width" in props || "height" in props,
                                  anim = this,
                                  orig = {},
                          Severity: Major
                          Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 4 hrs to fix

                            Function Callbacks has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            jQuery.Callbacks = function( options ) {
                            
                                // Convert options from String-formatted to Object-formatted if needed
                                // (we check in cache first)
                                options = typeof options === "string" ?
                            Severity: Major
                            Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 4 hrs to fix

                              Method getFormFeedback has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function getFormFeedback($action = false): \XoopsThemeForm
                                  {
                                      if (!$action) {
                                          $action = $_SERVER['REQUEST_URI'];
                                      }
                              Severity: Major
                              Found in class/Common/ModuleFeedback.php - About 4 hrs to fix

                                Function listBlocks has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function listBlocks(): void
                                    {
                                        $pathIcon16 = Admin::iconUrl('', '16');
                                
                                        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                                Severity: Minor
                                Found in class/Common/Blocksadmin.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

                                Severity
                                Category
                                Status
                                Source
                                Language