mambax7/smartfaq

View on GitHub

Showing 374 of 649 total issues

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

    Method sendNotifications has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function sendNotifications($notifications = []): void
        {
            $smartModule = Smartfaq\Utility::getModuleInfo();
    
            $myts = MyTextSanitizer::getInstance();
    Severity: Major
    Found in class/Faq.php - About 2 hrs to fix

      Method getFaqs has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getFaqs(
              $limit = 0,
              $start = 0,
              $status = '',
              $categoryid = -1,
      Severity: Major
      Found in class/FaqHandler.php - About 2 hrs to fix

        File SmartDbTable.php has 258 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php declare(strict_types=1);
        
        namespace XoopsModules\Smartfaq;
        
        /**
        Severity: Minor
        Found in class/SmartDbTable.php - About 2 hrs to fix

          Method isBlockCloned has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
              {
                  \xoops_loadLanguage('admin', 'system');
                  \xoops_loadLanguage('admin/blocksadmin', 'system');
                  \xoops_loadLanguage('admin/groups', 'system');
          Severity: Major
          Found in class/Common/Blocksadmin.php - About 2 hrs to fix

            Function parseShadowExtras has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            function parseShadowExtras(pf, i, ar) {
                var k = i, v;
            
                if (k < ar.length) {
                    if (ar[k] == SHADOW) {
            Severity: Minor
            Found in assets/js/overlib/overlib_shadow.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 runHook has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            function runHook(fnHookTo, hookType) {
                var l = hookPts[fnHookTo], optPm, arS, ar = runHook.arguments;
                if (hookType == FREPLACE) {
                    arS = argToString(ar, 2);
                    if (typeof l == 'undefined' || !(l = l.ovload)) return eval(fnHookTo + '(' + arS + ')'); else return eval('l(' + arS + ')');
            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 runHook has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            function runHook(fnHookTo, hookType) {
                var l = hookPts[fnHookTo], optPm, arS, ar = runHook.arguments;
            
                if (hookType == FREPLACE) {
                    arS = argToString(ar, 2);
            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 parseShadowExtras has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            function parseShadowExtras(pf, i, ar) {
                var k = i, v;
                if (k < ar.length) {
                    if (ar[k] == SHADOW) {
                        eval(pf + 'shadow=(' + pf + 'shadow==0)?1:0');
            Severity: Minor
            Found in assets/js/overlib/mini/overlib_shadow_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

            Method b_faqs_recent_show has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function b_faqs_recent_show($options)
            {
                //    require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
                $myts = \MyTextSanitizer::getInstance();
            
            
            Severity: Major
            Found in blocks/faqs_recent.php - About 2 hrs to fix

              Method render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function render()
                  {
                      // load all child ids for javascript codes
                      foreach (\array_keys($this->_itemTree) as $item_id) {
                          $this->_itemTree[$item_id]['allchild'] = [];
              Severity: Minor
              Found in class/GroupPermForm.php - About 1 hr to fix

                Function nd has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                function nd(time) {
                    if (olLoaded && !isExclusive()) {
                        if (time && !o3_delay) {
                            if (o3_timerid > 0) clearTimeout(o3_timerid);
                            o3_timerid = setTimeout("cClick()", (o3_timeout = time));
                Severity: Minor
                Found in assets/js/overlib/mini/overlib_mini.js - About 1 hr 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 nd has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                function nd(time) {
                    if (olLoaded && !isExclusive()) {
                        if (time && !o3_delay) {
                            if (o3_timerid > 0) clearTimeout(o3_timerid);
                
                
                Severity: Minor
                Found in assets/js/overlib/overlib.js - About 1 hr 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 orderBlock has 15 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        array $bid,
                        array $oldtitle,
                        array $oldside,
                        array $oldweight,
                        array $oldvisible,
                Severity: Major
                Found in class/Common/Blocksadmin.php - About 1 hr to fix

                  Method sf_attachmentImage has 45 lines of code (exceeds 25 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 1 hr to fix

                    Function getFrmRef has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function getFrmRef(srcFrm, tgetFrm) {
                        var rtnVal = ''
                    
                        if (tgetFrm != srcFrm) {
                            var tFrm = frmDepth(top.frames, tgetFrm)
                    Severity: Minor
                    Found in assets/js/overlib/overlib_crossframe.js - About 1 hr 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 getFrmRef has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function getFrmRef(srcFrm, tgetFrm) {
                        var rtnVal = ''
                        if (tgetFrm != srcFrm) {
                            var tFrm = frmDepth(top.frames, tgetFrm)
                            var sFrm = frmDepth(top.frames, srcFrm)
                    Severity: Minor
                    Found in assets/js/overlib/mini/overlib_crossframe_mini.js - About 1 hr 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 showSelectBox has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function showSelectBox() {
                        if (olNs4 || olOp || olIe55) return;
                        var 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 1 hr 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 showSelectBox has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function showSelectBox() {
                        if (olNs4 || olOp || olIe55) return;
                        var selEl, v;
                    
                        if (olIe4) v = 0;
                    Severity: Minor
                    Found in assets/js/overlib/overlib_hideform.js - About 1 hr 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 faqAccessGranted has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function faqAccessGranted($faqObj)
                        {
                            global $xoopsUser;
                    
                            if (self::userIsAdmin()) {
                    Severity: Minor
                    Found in class/Utility.php - About 1 hr 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