mambax7/smartfaq

View on GitHub

Showing 649 of 649 total issues

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

function getAnchorLocation(objRef) {
    var mkObj, of, offsets, mlyr
    mkObj = mlyr = objRef
    offsets = [o3_anchorx, o3_anchory]
    if (document.layers) {
Severity: Major
Found in assets/js/overlib/mini/overlib_anchor_mini.js and 1 other location - About 2 days to fix
assets/js/overlib/overlib_anchor.js on lines 256..298

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

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

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

function getAnchorLocation(objRef) {
    var mkObj, of, offsets, mlyr

    mkObj = mlyr = objRef
    offsets = [o3_anchorx, o3_anchory]
Severity: Major
Found in assets/js/overlib/overlib_anchor.js and 1 other location - About 2 days to fix
assets/js/overlib/mini/overlib_anchor_mini.js on lines 165..200

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

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

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

    if (o3_shadowx == 0) {
        if (o3_shadowy < 0) {
            posStr[0] = ' left:0; top: 0';
            posStr[1] = ' left:0; top: ' + Y + 'px';
        } else if (o3_shadowy > 0) {
Severity: Major
Found in assets/js/overlib/mini/overlib_shadow_mini.js and 1 other location - About 2 days to fix
assets/js/overlib/overlib_shadow.js on lines 129..161

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

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

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

    if (o3_shadowx == 0) {
        if (o3_shadowy < 0) {
            posStr[0] = ' left:0; top: 0';
            posStr[1] = ' left:0; top: ' + Y + 'px';
        } else if (o3_shadowy > 0) {
Severity: Major
Found in assets/js/overlib/overlib_shadow.js and 1 other location - About 2 days to fix
assets/js/overlib/mini/overlib_shadow_mini.js on lines 84..116

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

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

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

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

    function runHook(fnHookTo, hookType) {
        var l = hookPts[fnHookTo], optPm, arS, ar = runHook.arguments;
    
        if (hookType == FREPLACE) {
            arS = argToString(ar, 2);
    Severity: Major
    Found in assets/js/overlib/overlib.js and 1 other location - About 1 day to fix
    assets/js/overlib/mini/overlib_mini.js on lines 1066..1086

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

    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 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: Major
    Found in assets/js/overlib/mini/overlib_mini.js and 1 other location - About 1 day to fix
    assets/js/overlib/overlib.js on lines 1381..1409

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

    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

    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

      Similar blocks of code found in 2 locations. 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: Major
      Found in assets/js/overlib/mini/overlib_crossframe_mini.js and 1 other location - About 1 day to fix
      assets/js/overlib/overlib_crossframe.js on lines 89..117

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

      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 parseShadowExtras(pf, i, ar) {
          var k = i, v;
      
          if (k < ar.length) {
              if (ar[k] == SHADOW) {
      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 34..64

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

      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 getFrmRef(srcFrm, tgetFrm) {
          var rtnVal = ''
      
          if (tgetFrm != srcFrm) {
              var tFrm = frmDepth(top.frames, tgetFrm)
      Severity: Major
      Found in assets/js/overlib/overlib_crossframe.js and 1 other location - About 1 day to fix
      assets/js/overlib/mini/overlib_crossframe_mini.js on lines 56..79

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

      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 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: 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 65..97

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

      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 (typeof o3_dragimg != 'undefined' && o3_dragimg) return off;
          else {
              if (!isNaN(puc) || typeof puc == 'object') {
                  if (typeof puc == 'object') {
                      fx = parseFloat(puc[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 253..275

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

      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 (typeof o3_dragimg != 'undefined' && o3_dragimg) return off; else {
              if (!isNaN(puc) || typeof puc == 'object') {
                  if (typeof puc == 'object') {
                      fx = parseFloat(puc[0]);
                      fy = parseFloat(puc[1]);
      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 362..385

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

      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 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: Major
      Found in assets/js/overlib/overlib.js and 1 other location - About 1 day to fix
      assets/js/overlib/mini/overlib_mini.js on lines 952..960

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

      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 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: Major
      Found in assets/js/overlib/mini/overlib_mini.js and 1 other location - About 1 day to fix
      assets/js/overlib/overlib.js on lines 1221..1230

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

      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 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
          Severity
          Category
          Status
          Source
          Language