mambax7/smartfaq

View on GitHub

Showing 649 of 649 total issues

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

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

        if (olNs4 && bkSet) {
            dpObj = over.document.layers['backdrop'];
            if (typeof dpObj == 'undefined') return;
            puObj = over.document.layers['PUContent'];
            wd = puObj.clip.width;
    Severity: Major
    Found in assets/js/overlib/mini/overlib_shadow_mini.js and 1 other location - About 1 day to fix
    assets/js/overlib/overlib_shadow.js on lines 181..221

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

    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 (olNs4 && bkSet) {
            dpObj = over.document.layers['backdrop'];
            if (typeof dpObj == 'undefined') return;  // if shadow layer not found, then content layer won't be either
    
            puObj = over.document.layers['PUContent'];
    Severity: Major
    Found in assets/js/overlib/overlib_shadow.js and 1 other location - About 1 day to fix
    assets/js/overlib/mini/overlib_shadow_mini.js on lines 131..164

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

    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

    function parseAnchorExtras(pf, i, ar) {
        var v, k = i;
    
        if (k < ar.length) {
            if (ar[k] == ANCHOR) {
    Severity: Major
    Found in assets/js/overlib/overlib_anchor.js and 1 other location - About 1 day to fix
    assets/js/overlib/mini/overlib_anchor_mini.js on lines 31..56

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

    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

    function parseAnchorExtras(pf, i, ar) {
        var v, k = i;
        if (k < ar.length) {
            if (ar[k] == ANCHOR) {
                eval(pf + "anchor='" + escSglQuote(ar[++k]) + "'");
    Severity: Major
    Found in assets/js/overlib/mini/overlib_anchor_mini.js and 1 other location - About 1 day to fix
    assets/js/overlib/overlib_anchor.js on lines 63..90

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

    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

    function ol_content_background_cssstyle(text, picture, hasfullhtml) {
        if (hasfullhtml) {
            txt = text;
        } else {
            var pU, hU, wU;
    Severity: Major
    Found in assets/js/overlib/overlib_cssstyle.js and 1 other location - About 1 day to fix
    assets/js/overlib/mini/overlib_cssstyle_mini.js on lines 151..163

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

    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

    function ol_content_background_cssstyle(text, picture, hasfullhtml) {
        if (hasfullhtml) {
            txt = text;
        } else {
            var pU, hU, wU;
    Severity: Major
    Found in assets/js/overlib/mini/overlib_cssstyle_mini.js and 1 other location - About 1 day to fix
    assets/js/overlib/overlib_cssstyle.js on lines 203..217

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

    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 (!(olNs4 || olOp || olIe55 || navigator.userAgent.indexOf('Netscape6') != -1)) {
        var MMStr = olMouseMove.toString();
        var strRe = /(if\s*\(o3_allowmove\s*==\s*1.*\)\s*)/;
        var f = MMStr.match(strRe);
    
    
    Severity: Major
    Found in assets/js/overlib/overlib_hideform.js and 1 other location - About 1 day to fix
    assets/js/overlib/mini/overlib_hideform_mini.js on lines 79..92

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

    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 (!(olNs4 || olOp || olIe55 || navigator.userAgent.indexOf('Netscape6') != -1)) {
        var MMStr = olMouseMove.toString();
        var strRe = /(if\s*\(o3_allowmove\s*==\s*1.*\)\s*)/;
        var f = MMStr.match(strRe);
        if (f) {
    Severity: Major
    Found in assets/js/overlib/mini/overlib_hideform_mini.js and 1 other location - About 1 day to fix
    assets/js/overlib/overlib_hideform.js on lines 110..125

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

    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

    function showSelectBox() {
        if (olNs4 || olOp || olIe55) return;
        var selEl, v;
        if (olIe4) v = 0; else {
            v = navigator.userAgent.match(/Gecko\/(\d{8})/i);
    Severity: Major
    Found in assets/js/overlib/mini/overlib_hideform_mini.js and 1 other location - About 1 day to fix
    assets/js/overlib/overlib_hideform.js on lines 68..88

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

    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

    function showSelectBox() {
        if (olNs4 || olOp || olIe55) return;
        var selEl, v;
    
        if (olIe4) v = 0;
    Severity: Major
    Found in assets/js/overlib/overlib_hideform.js and 1 other location - About 1 day to fix
    assets/js/overlib/mini/overlib_hideform_mini.js on lines 52..69

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

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

      Function getAnchorOffsets has a Cognitive Complexity of 56 (exceeds 5 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: Minor
      Found in assets/js/overlib/mini/overlib_anchor_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 getAnchorOffsets has a Cognitive Complexity of 56 (exceeds 5 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: Minor
      Found in assets/js/overlib/overlib_anchor.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

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

          if (mkAry.length < 3) {
              mp = mkAry[0].toUpperCase();
              puc = (mkAry.length == 1) ? mp : mkAry[1].toUpperCase();
          } else if (mkAry.length == 3) {
              if (!isNaN(mkAry[0])) {
      Severity: Major
      Found in assets/js/overlib/overlib_anchor.js and 1 other location - About 1 day to fix
      assets/js/overlib/mini/overlib_anchor_mini.js on lines 206..220

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

      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 (mkAry.length < 3) {
              mp = mkAry[0].toUpperCase();
              puc = (mkAry.length == 1) ? mp : mkAry[1].toUpperCase();
          } else if (mkAry.length == 3) {
              if (!isNaN(mkAry[0])) {
      Severity: Major
      Found in assets/js/overlib/mini/overlib_anchor_mini.js and 1 other location - About 1 day to fix
      assets/js/overlib/overlib_anchor.js on lines 308..322

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

      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

      Severity
      Category
      Status
      Source
      Language