mambax7/smartfaq

View on GitHub

Showing 649 of 649 total issues

File faq.php has 400 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/faq.php - About 5 hrs to fix

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

    function cursorOff() {
        var left = parseInt(over.style.left);
        var top = parseInt(over.style.top);
        var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
        var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);
    Severity: Major
    Found in assets/js/overlib/overlib.js and 1 other location - About 5 hrs to fix
    assets/js/overlib/mini/overlib_mini.js on lines 872..879

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

    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 cursorOff() {
        var left = parseInt(over.style.left);
        var top = parseInt(over.style.top);
        var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
        var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);
    Severity: Major
    Found in assets/js/overlib/mini/overlib_mini.js and 1 other location - About 5 hrs to fix
    assets/js/overlib/overlib.js on lines 1106..1115

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

    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 (($criteria instanceof \CriteriaCompo) || ($criteria instanceof \Criteria)) {
                $whereClause = $criteria->renderWhere();
    
                if ('WHERE ()' !== $whereClause) {
                    $sql .= ' ' . $criteria->renderWhere();
    Severity: Major
    Found in class/FaqHandler.php and 1 other location - About 5 hrs to fix
    class/FaqHandler.php on lines 252..270

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

    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 (($criteria instanceof \CriteriaCompo) || ($criteria instanceof \Criteria)) {
                $whereClause = $criteria->renderWhere();
    
                if ('WHERE ()' !== $whereClause) {
                    $sql .= ' ' . $criteria->renderWhere();
    Severity: Major
    Found in class/FaqHandler.php and 1 other location - About 5 hrs to fix
    class/FaqHandler.php on lines 333..351

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

    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 generatePopUp(content) {
        if (!olIe4 || olOp || !olIe55 || (typeof o3_shadow != 'undefined' && o3_shadow) || (typeof o3_bubble != 'undefined' && o3_bubble)) return;
        var wd, ht, txt, zIdx = 0;
        wd = parseInt(o3_width);
        ht = over.offsetHeight;
    Severity: Major
    Found in assets/js/overlib/mini/overlib_hideform_mini.js and 1 other location - About 5 hrs to fix
    assets/js/overlib/overlib_hideform.js on lines 18..28

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

    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 generatePopUp(content) {
        if (!olIe4 || olOp || !olIe55 || (typeof o3_shadow != 'undefined' && o3_shadow) || (typeof o3_bubble != 'undefined' && o3_bubble)) return;
    
        var wd, ht, txt, zIdx = 0;
    
    
    Severity: Major
    Found in assets/js/overlib/overlib_hideform.js and 1 other location - About 5 hrs to fix
    assets/js/overlib/mini/overlib_hideform_mini.js on lines 14..22

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

    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

    Faq has 39 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Faq extends XoopsObject
    {
        public $db;
        /**
         * @var Smartfaq\Category|null
    Severity: Minor
    Found in class/Faq.php - About 5 hrs to fix

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

      function nd(time) {
          if (olLoaded && !isExclusive()) {
              if (time && !o3_delay) {
                  if (o3_timerid > 0) clearTimeout(o3_timerid);
      
      
      Severity: Major
      Found in assets/js/overlib/overlib.js and 1 other location - About 5 hrs to fix
      assets/js/overlib/mini/overlib_mini.js on lines 280..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 138.

      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 nd(time) {
          if (olLoaded && !isExclusive()) {
              if (time && !o3_delay) {
                  if (o3_timerid > 0) clearTimeout(o3_timerid);
                  o3_timerid = setTimeout("cClick()", (o3_timeout = time));
      Severity: Major
      Found in assets/js/overlib/mini/overlib_mini.js and 1 other location - About 5 hrs to fix
      assets/js/overlib/overlib.js on lines 348..369

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

      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 (ar[i] == FUNCTION) {
                      if (pf == 'ol_') {
                          if (typeof ar[i + 1] != 'number') {
                              v = ar[++i];
                              ol_function = (typeof v == 'function' ? v : null);
      Severity: Major
      Found in assets/js/overlib/mini/overlib_mini.js and 1 other location - About 5 hrs to fix
      assets/js/overlib/overlib.js on lines 939..952

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

      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 (ar[i] == FUNCTION) {
                      if (pf == 'ol_') {
                          if (typeof ar[i + 1] != 'number') {
                              v = ar[++i];
                              ol_function = (typeof v == 'function' ? v : null);
      Severity: Major
      Found in assets/js/overlib/overlib.js and 1 other location - About 5 hrs to fix
      assets/js/overlib/mini/overlib_mini.js on lines 732..745

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

      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 parseCSSStyleExtras has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      function parseCSSStyleExtras(pf, i, ar) {
          var k = i;
          if (k < ar.length) {
              if (ar[k] == CSSSTYLE) {
                  eval(pf + 'css=' + ar[k]);
      Severity: Minor
      Found in assets/js/overlib/mini/overlib_cssstyle_mini.js - About 4 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 parseCSSStyleExtras has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      function parseCSSStyleExtras(pf, i, ar) {
          var k = i;
      
          if (k < ar.length) {
              if (ar[k] == CSSSTYLE) {
      Severity: Minor
      Found in assets/js/overlib/overlib_cssstyle.js - About 4 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

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

              if (!$userIsAdmin) {
                  /** @var Smartfaq\PermissionHandler $smartPermHandler */
                  $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission');
      
                  $categoriesGranted = $smartPermHandler->getPermissions('category');
      Severity: Major
      Found in class/FaqHandler.php and 1 other location - About 4 hrs to fix
      class/FaqHandler.php on lines 441..455

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

      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 (!$userIsAdmin) {
                  /** @var Smartfaq\PermissionHandler $smartPermHandler */
                  $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission');
      
                  $categoriesGranted = $smartPermHandler->getPermissions('category');
      Severity: Major
      Found in class/FaqHandler.php and 1 other location - About 4 hrs to fix
      class/FaqHandler.php on lines 563..577

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

      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 listBlocks has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function listBlocks()
          : void
          {
              global $xoopsModule, $pathIcon16;
              require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
      Severity: Minor
      Found in class/Common/Blocksadmin.php - About 4 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

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

          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') {
              widthFix = Math.ceil(1.2 * (o3_frame.outerWidth - o3_frame.innerWidth));
              iwidth = o3_frame.innerWidth;
      Severity: Major
      Found in assets/js/overlib/overlib_followscroll.js and 1 other location - About 4 hrs to fix
      assets/js/overlib/overlib_anchor.js on lines 121..126

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

      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 (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') {
              widthFix = Math.ceil(1.2 * (o3_frame.outerWidth - o3_frame.innerWidth));
              iwidth = o3_frame.innerWidth;
      Severity: Major
      Found in assets/js/overlib/overlib_anchor.js and 1 other location - About 4 hrs to fix
      assets/js/overlib/overlib_followscroll.js on lines 75..80

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

      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 3 locations. Consider refactoring.
      Open

          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') {
              widthFix = Math.ceil(1.2 * (o3_frame.outerWidth - o3_frame.innerWidth));
              iwidth = o3_frame.innerWidth;
      Severity: Major
      Found in assets/js/overlib/mini/overlib_anchor_mini.js and 2 other locations - About 4 hrs to fix
      assets/js/overlib/mini/overlib_followscroll_mini.js on lines 37..42
      assets/js/overlib/mini/overlib_mini.js on lines 425..430

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

      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