mambax7/smartfaq

View on GitHub

Showing 374 of 649 total issues

File overlib_anchor_mini.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//\/////
//\  overLIB Anchor Plugin
//\  This file requires overLIB 4.00 or later.
//\
//\  overLIB 4.05 - You may not remove or change this notice.
Severity: Minor
Found in assets/js/overlib/mini/overlib_anchor_mini.js - About 3 hrs to fix

    File myblocksadmin.php has 304 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php declare(strict_types=1);
    
    /**
     * Module: SmartFAQ
     * Author: The SmartFactory <www.smartfactory.ca>
    Severity: Minor
    Found in admin/myblocksadmin.php - About 3 hrs to fix

      Method insert has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function insert(\XoopsObject $object, $force = false)
          {
              if ('xoopsmodules\smartfaq\faq' !== \mb_strtolower(\get_class($object))) {
                  return false;
              }
      Severity: Major
      Found in class/FaqHandler.php - About 3 hrs to fix

        Function ol_content_caption has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

        function ol_content_caption(text, title, close) {
            var nameId;
            closing = "";
            closeevent = "onmouseover";
            if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle + "'" : "") + " onclick";
        Severity: Minor
        Found in assets/js/overlib/mini/overlib_mini.js - 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 ol_content_caption has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

        function ol_content_caption(text, title, close) {
            var nameId;
            closing = "";
            closeevent = "onmouseover";
            if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle + "'" : "") + " onclick";
        Severity: Minor
        Found in assets/js/overlib/overlib.js - 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 sf_attachmentImage has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            function sf_attachmentImage($source)
            {
                /** @var Smartfaq\Helper $helper */
                $helper = Smartfaq\Helper::getInstance();
        
        
        Severity: Minor
        Found in include/functions.image.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

        Method displayAttachment has 81 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function displayAttachment($asSource = false)
            {
                global $xoopsModule;
                /** @var Smartfaq\Helper $helper */
                $helper = Smartfaq\Helper::getInstance();
        Severity: Major
        Found in class/Answer.php - About 3 hrs to fix

          File modinfo.php has 299 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php declare(strict_types=1);
          
          /**
           * Module: SmartFAQ
           * Author: The SmartFactory <www.smartfactory.ca>
          Severity: Minor
          Found in language/english/modinfo.php - About 3 hrs to fix

            Function overlib has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function overlib() {
                if (!olLoaded || isExclusive(overlib.arguments)) return true;
                if (olCheckMouseCapture) olMouseCapture();
                if (over) cClick();
            
            
            Severity: Major
            Found in assets/js/overlib/overlib.js - About 3 hrs to fix

              Function placeLayer has 79 lines of code (exceeds 25 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: Major
              Found in assets/js/overlib/overlib.js - About 3 hrs to fix

                Function overlib has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function overlib() {
                    if (!olLoaded || isExclusive(overlib.arguments)) return true;
                    if (olCheckMouseCapture) olMouseCapture();
                    if (over) cClick();
                    o3_text = ol_text;
                Severity: Major
                Found in assets/js/overlib/mini/overlib_mini.js - About 3 hrs to fix

                  Function placeLayer has 79 lines of code (exceeds 25 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: Major
                  Found in assets/js/overlib/mini/overlib_mini.js - About 3 hrs to fix

                    Method editcat has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function editcat($showmenu = false, $categoryid = 0): void
                    {
                        //$moderators = []; // just to define the variable
                        //$allmods = [];
                        $startfaq = Request::getInt('startfaq', 0, 'GET');
                    Severity: Major
                    Found in admin/category.php - About 3 hrs to fix

                      Function getAnchorOffsets has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getAnchorOffsets(mkObj) {
                          var fx = fy = 0, mp, puc, mkAry, sx = sy = 0, w = o3_anchoralign
                          var mW = mH = pW = pH = 0
                          var off = [0, 0]
                      
                      
                      Severity: Major
                      Found in assets/js/overlib/overlib_anchor.js - About 3 hrs to fix

                        Function getAnchorOffsets has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function getAnchorOffsets(mkObj) {
                            var fx = fy = 0, mp, puc, mkAry, sx = sy = 0, w = o3_anchoralign
                            var mW = mH = pW = pH = 0
                            var off = [0, 0]
                            mkAry = w.split(',');
                        Severity: Major
                        Found in assets/js/overlib/mini/overlib_anchor_mini.js - About 2 hrs to fix

                          Function wrapStr has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function wrapStr(endWrap, fontSizeStr, whichString) {
                              var fontStr, fontColor, isClose = ((whichString == 'close') ? 1 : 0), hasDims = /[%\-a-z]+$/.test(fontSizeStr);
                              fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
                              if (endWrap) return (hasDims && !olNs4) ? (isClose ? '</span>' : '</div>') : '</font>'; else {
                                  fontStr = 'o3_' + whichString + 'font';
                          Severity: Minor
                          Found in assets/js/overlib/mini/overlib_mini.js - About 2 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 wrapStr has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function wrapStr(endWrap, fontSizeStr, whichString) {
                              var fontStr, fontColor, isClose = ((whichString == 'close') ? 1 : 0), hasDims = /[%\-a-z]+$/.test(fontSizeStr);
                              fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
                              if (endWrap) return (hasDims && !olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';
                              else {
                          Severity: Minor
                          Found in assets/js/overlib/overlib.js - About 2 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 hideSelectBox has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function hideSelectBox() {
                              if (olNs4 || olOp || olIe55) return;
                              var px, py, pw, ph, sx, sw, sy, sh, selEl, v;
                              if (olIe4) v = 0; else {
                                  v = navigator.userAgent.match(/Gecko\/(\d{8})/i);
                          Severity: Minor
                          Found in assets/js/overlib/mini/overlib_hideform_mini.js - About 2 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 hideSelectBox has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function hideSelectBox() {
                              if (olNs4 || olOp || olIe55) return;
                              var px, py, pw, ph, sx, sw, sy, sh, selEl, v;
                          
                              if (olIe4) v = 0;
                          Severity: Minor
                          Found in assets/js/overlib/overlib_hideform.js - About 2 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 updateBlock has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups)
                              : void {
                                  $myblock = new \XoopsBlock($bid);
                                  $myblock->setVar('title', $btitle);
                                  $myblock->setVar('weight', $bweight);
                          Severity: Minor
                          Found in class/Common/Blocksadmin.php - About 2 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