mambax7/smartfaq

View on GitHub

Showing 374 of 649 total issues

Function parseTokens has a Cognitive Complexity of 247 (exceeds 5 allowed). Consider refactoring.
Open

function parseTokens(pf, ar) {
    // What the next argument is expected to be.
    var v, mode = -1, par = (pf != 'ol_');
    var fnMark = (par && !ar.length ? 1 : 0);

Severity: Minor
Found in assets/js/overlib/overlib.js - About 5 days 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 parseTokens has a Cognitive Complexity of 247 (exceeds 5 allowed). Consider refactoring.
Open

function parseTokens(pf, ar) {
    var v, mode = -1, par = (pf != 'ol_');
    var fnMark = (par && !ar.length ? 1 : 0);
    for (i = 0; i < ar.length; i++) {
        if (mode < 0) {
Severity: Minor
Found in assets/js/overlib/mini/overlib_mini.js - About 5 days 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 overlib.js has 1174 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//\/////
//\  overLIB 4.05 - You may not remove or change this notice.
//\  Copyright Erik Bosrup 1998-2004. All rights reserved.
//\
//\  Contributors are listed on the homepage.
Severity: Major
Found in assets/js/overlib/overlib.js - About 3 days to fix

    File overlib_mini.js has 1168 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    //\/////
    //\  overLIB 4.05 - You may not remove or change this notice.
    //\  Copyright Erik Bosrup 1998-2004. All rights reserved.
    //\
    //\  Contributors are listed on the homepage.
    Severity: Major
    Found in assets/js/overlib/mini/overlib_mini.js - About 3 days to fix

      Function scroll_placeLayer has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
      Open

      function scroll_placeLayer() {
          var placeX, placeY, widthFix = 0;
          var hasAnchor = (typeof o3_anchor != 'undefined' && o3_anchor);
          if (eval('o3_frame.' + docRoot) && eval("typeof o3_frame." + docRoot + ".clientWidth=='number'") && eval('o3_frame.' + docRoot + '.clientWidth')) {
              iwidth = eval('o3_frame.' + docRoot + '.clientWidth');
      Severity: Minor
      Found in assets/js/overlib/mini/overlib_followscroll_mini.js - About 2 days 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 scroll_placeLayer has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
      Open

      function scroll_placeLayer() {
          var placeX, placeY, widthFix = 0;
          var hasAnchor = (typeof o3_anchor != 'undefined' && o3_anchor);
      
          // HORIZONTAL PLACEMENT
      Severity: Minor
      Found in assets/js/overlib/overlib_followscroll.js - About 2 days 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 anchorPlaceLayer has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
      Open

      function anchorPlaceLayer() {
          var placeX, placeY, widthFix = 0;
          if (eval('o3_frame.' + docRoot) && eval("typeof o3_frame." + docRoot + ".clientWidth=='number'") && eval('o3_frame.' + docRoot + '.clientWidth')) {
              iwidth = eval('o3_frame.' + docRoot + '.clientWidth');
          } else if (typeof(o3_frame.innerWidth) == 'number') {
      Severity: Minor
      Found in assets/js/overlib/mini/overlib_anchor_mini.js - About 2 days 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 anchorPlaceLayer has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
      Open

      function anchorPlaceLayer() {
          var placeX, placeY, widthFix = 0;
      
          // HORIZONTAL PLACEMENT
          if (eval('o3_frame.' + docRoot) && eval("typeof o3_frame." + docRoot + ".clientWidth ==  'number'") && eval('o3_frame.' + docRoot + '.clientWidth')) {
      Severity: Minor
      Found in assets/js/overlib/overlib_anchor.js - About 2 days 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 xoops_version.php has 930 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php declare(strict_types=1);
      
      /**
       * Module: SmartFAQ
       * Author: The SmartFactory <www.smartfactory.ca>
      Severity: Major
      Found in xoops_version.php - About 2 days to fix

        File FaqHandler.php has 738 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php declare(strict_types=1);
        
        namespace XoopsModules\Smartfaq;
        
        /**
        Severity: Major
        Found in class/FaqHandler.php - About 1 day to fix

          Function placeLayer has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
          Open

          function placeLayer() {
              var placeX, placeY, widthFix = 0;
              if (eval('o3_frame.' + docRoot) && eval("typeof o3_frame." + docRoot + ".clientWidth=='number'") && eval('o3_frame.' + docRoot + '.clientWidth')) {
                  iwidth = eval('o3_frame.' + docRoot + '.clientWidth');
              } else if (typeof(o3_frame.innerWidth) == 'number') {
          Severity: Minor
          Found in assets/js/overlib/mini/overlib_mini.js - About 1 day 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 placeLayer has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
          Open

          function placeLayer() {
              var placeX, placeY, widthFix = 0;
          
              // HORIZONTAL PLACEMENT
              if (eval('o3_frame.' + docRoot) && eval("typeof o3_frame." + docRoot + ".clientWidth=='number'") && eval('o3_frame.' + docRoot + '.clientWidth')) {
          Severity: Minor
          Found in assets/js/overlib/overlib.js - About 1 day 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 parseTokens has 282 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function parseTokens(pf, ar) {
              var v, mode = -1, par = (pf != 'ol_');
              var fnMark = (par && !ar.length ? 1 : 0);
              for (i = 0; i < ar.length; i++) {
                  if (mode < 0) {
          Severity: Major
          Found in assets/js/overlib/mini/overlib_mini.js - About 1 day to fix

            Function parseTokens has 282 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function parseTokens(pf, ar) {
                // What the next argument is expected to be.
                var v, mode = -1, par = (pf != 'ol_');
                var fnMark = (par && !ar.length ? 1 : 0);
            
            
            Severity: Major
            Found in assets/js/overlib/overlib.js - About 1 day to fix

              File Blocksadmin.php has 611 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              declare(strict_types=1);
              
              namespace XoopsModules\Smartfaq\Common;
              Severity: Major
              Found in class/Common/Blocksadmin.php - About 1 day to fix

                Function reOrder has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                Open

                function reOrder(hookPt, fnRef, order) {
                    if (!order || typeof order == 'undefined' || typeof order == 'number') return;
                    var newPt = new Array(), match;
                    if (typeof order == 'function') {
                        if (typeof fnRef == 'object') {
                Severity: Minor
                Found in assets/js/overlib/mini/overlib_mini.js - About 1 day 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 reOrder has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                Open

                function reOrder(hookPt, fnRef, order) {
                    if (!order || typeof order == 'undefined' || typeof order == 'number') return;
                
                    var newPt = new Array(), match;
                
                
                Severity: Minor
                Found in assets/js/overlib/overlib.js - About 1 day 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 listBlocks has 229 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function listBlocks()
                    : void
                    {
                        global $xoopsModule, $pathIcon16;
                        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                Severity: Major
                Found in class/Common/Blocksadmin.php - About 1 day to fix

                  Function generateShadow has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function generateShadow(content) {
                      var wd, ht, X = 0, Y = 0, zIdx = 0, txt, dpObj, puObj, bS = '', aPos, posStr = new Array();
                  
                      if (!o3_shadow || (o3_shadowx == 0 && o3_shadowy == 0)) return;
                  
                  
                  Severity: Minor
                  Found in assets/js/overlib/overlib_shadow.js - About 1 day 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 generateShadow has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function generateShadow(content) {
                      var wd, ht, X = 0, Y = 0, zIdx = 0, txt, dpObj, puObj, bS = '', aPos, posStr = new Array();
                      if (!o3_shadow || (o3_shadowx == 0 && o3_shadowy == 0)) return;
                      X = Math.abs(o3_shadowx);
                      Y = Math.abs(o3_shadowy);
                  Severity: Minor
                  Found in assets/js/overlib/mini/overlib_shadow_mini.js - About 1 day 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