mambax7/moduleinstaller

View on GitHub

Showing 200 of 200 total issues

Consider simplifying this complex logical expression.
Open

        if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) {
            var style = element.style.left, rStyle = element.runtimeStyle.left;
            element.runtimeStyle.left = element.currentStyle.left;
            element.style.left = value || 0;
            value = element.style.pixelLeft;
Severity: Major
Found in assets/js/prototype.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                    if (matcher[expando]) {
                        j = ++i;
                        for (; j < len; j++) {
                            if (Expr.relative[tokens[j].type]) {
                                break;
    Severity: Major
    Found in assets/js/prototype.js - About 40 mins to fix

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

          var IS_DONTENUM_BUGGY = (function () {
              for (var p in {toString: 1}) {
                  if (p === 'toString') return false;
              }
              return true;
      Severity: Minor
      Found in assets/js/prototype.js and 1 other location - About 40 mins to fix
      assets/js/prototype.js on lines 180..185

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

      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

          var IS_DONTENUM_BUGGY = (function () {
              for (var p in {toString: 1}) {
                  if (p === 'toString') return false;
              }
              return true;
      Severity: Minor
      Found in assets/js/prototype.js and 1 other location - About 40 mins to fix
      assets/js/prototype.js on lines 69..74

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

      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 superMatcher has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                  superMatcher = function (seed, context, xml, results, outermost) {
      Severity: Minor
      Found in assets/js/prototype.js - About 35 mins to fix

        Function CHILD has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                    "CHILD": function (type, what, argument, first, last) {
        Severity: Minor
        Found in assets/js/prototype.js - About 35 mins to fix

          Function condense has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function condense(unmatched, map, filter, context, xml) {
          Severity: Minor
          Found in assets/js/prototype.js - About 35 mins to fix

            Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    string  $text,
                    ?int    $length = null,
                    ?string $ending = null,
                    ?bool   $exact = null,
                    ?bool   $considerHtml = null
            Severity: Minor
            Found in class/Common/SysUtility.php - About 35 mins to fix

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

                  Event.Methods = {
                      isLeftClick: isLeftClick,
                      isMiddleClick: isMiddleClick,
                      isRightClick: isRightClick,
              
              
              Severity: Minor
              Found in assets/js/prototype.js and 1 other location - About 35 mins to fix
              assets/js/prototype.js on lines 2564..2574

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

              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

                  Object.extend(methods, {
                      remove: remove,
                      update: update,
                      replace: replace,
                      insert: insert,
              Severity: Minor
              Found in assets/js/prototype.js and 1 other location - About 35 mins to fix
              assets/js/prototype.js on lines 6914..6927

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

              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 (false !== $module->getInfo('image') && '' != trim((string) $module->getInfo('image'))) {
                          $msgs[] = '<img src="' . XOOPS_URL . '/modules/' . $dirname . '/' . trim((string) $module->getInfo('image')) . '" alt="">';
                      }
              Severity: Minor
              Found in extras/modulesadmin.php and 1 other location - About 35 mins to fix
              extras/modulesadmin.php on lines 645..647

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

              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 (false !== $module->getInfo('image') && '' != trim((string) $module->getInfo('image'))) {
                      $msgs[] = '<img src="' . XOOPS_URL . '/modules/' . $dirname . '/' . trim((string) $module->getInfo('image')) . '" alt="">';
                  }
              Severity: Minor
              Found in extras/modulesadmin.php and 1 other location - About 35 mins to fix
              extras/modulesadmin.php on lines 859..861

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

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

              function showThemeSelected(element) {
                  if (!document.getElementsByTagName) return;
                  var divs = document.getElementsByTagName("div");
                  for (var i = 0; i < divs.length; i++) {
                      var div = divs[i];
              Severity: Minor
              Found in assets/js/xo-installer.js - About 35 mins 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 getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getEditor(Helper $helper = null, ?array $options = null)
                  {
                      /** @var Helper $helper */
                      if (null === $options) {
                          $options           = [];
              Severity: Minor
              Found in class/Common/SysUtility.php - About 35 mins 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 xoopsExternalLinks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function xoopsExternalLinks() {
                  if (!document.getElementsByTagName) return;
                  var anchors = document.getElementsByTagName("a");
                  for (var i = 0; i < anchors.length; i++) {
                      var anchor = anchors[i];
              Severity: Minor
              Found in assets/js/xo-installer.js - About 35 mins 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 request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  request: function (form, options) {
                      form = $(form), options = Object.clone(options || {});
              
                      var params = options.parameters, action = form.readAttribute('action') || '';
                      if (action.blank()) action = window.location.href;
              Severity: Minor
              Found in assets/js/prototype.js - About 35 mins 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 (DIV.className !== 'x') {
                      DIV.setAttribute('class', 'x');
                      if (DIV.className === 'x')
                          classProp = 'class';
                  }
              Severity: Minor
              Found in assets/js/prototype.js and 1 other location - About 35 mins to fix
              assets/js/prototype.js on lines 2940..2944

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

              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 (LABEL.htmlFor !== 'x') {
                      LABEL.setAttribute('htmlFor', 'x');
                      if (LABEL.htmlFor === 'x')
                          forProp = 'htmlFor';
                  }
              Severity: Minor
              Found in assets/js/prototype.js and 1 other location - About 35 mins to fix
              assets/js/prototype.js on lines 2932..2936

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

              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

              Avoid too many return statements within this function.
              Open

                                  return results;
              Severity: Major
              Found in assets/js/prototype.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return sortInput ?
                                        (indexOf.call(sortInput, a) - indexOf.call(sortInput, b)) :
                                        0;
                Severity: Major
                Found in assets/js/prototype.js - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language