mambax7/moduleinstaller

View on GitHub

Showing 200 of 200 total issues

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

            'right': function (element) {
                var offset = element.positionedOffset(),
                    parent = element.getOffsetParent(),
                    pWidth = parent.measure('width');

Severity: Major
Found in assets/js/prototype.js and 1 other location - About 2 hrs to fix
assets/js/prototype.js on lines 3933..3941

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

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

            'right': function (element) {
                var parent = hasLayout(element.getOffsetParent());
                var rect = element.getBoundingClientRect(),
                    pRect = parent.getBoundingClientRect();

Severity: Major
Found in assets/js/prototype.js and 1 other location - About 2 hrs to fix
assets/js/prototype.js on lines 4018..4024

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

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 (isNaN(i)) {
            i = 0;
        } else if (i !== 0 && isFinite(i)) {
            i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i));
        }
Severity: Major
Found in assets/js/prototype.js and 1 other location - About 2 hrs to fix
assets/js/prototype.js on lines 1243..1247

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

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

            'bottom': function (element) {
                var parent = hasLayout(element.getOffsetParent());
                var rect = element.getBoundingClientRect(),
                    pRect = parent.getBoundingClientRect();

Severity: Major
Found in assets/js/prototype.js and 1 other location - About 2 hrs to fix
assets/js/prototype.js on lines 4010..4016

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

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 (isNaN(i)) {
                i = 0;
            } else if (i !== 0 && isFinite(i)) {
                i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i));
            }
Severity: Major
Found in assets/js/prototype.js and 1 other location - About 2 hrs to fix
assets/js/prototype.js on lines 1220..1224

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

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 Str has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function Str(key, holder, stack) {
        var value = holder[key];
        if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
            value = value.toJSON(key);
        }
Severity: Major
Found in assets/js/prototype.js - About 2 hrs to fix

    Function clonePosition has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function clonePosition(element, source, options) {
            options = Object.extend({
                setLeft: true,
                setTop: true,
                setWidth: true,
    Severity: Minor
    Found in assets/js/prototype.js - About 2 hrs to fix

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

                  'margin-box-height': function (element) {
                      var bHeight = this.get('border-box-height'),
                          mTop = this.get('margin-top'),
                          mBottom = this.get('margin-bottom');
      
      
      Severity: Major
      Found in assets/js/prototype.js and 1 other location - About 1 hr to fix
      assets/js/prototype.js on lines 3918..3926

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

      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

                  'margin-box-width': function (element) {
                      var bWidth = this.get('border-box-width'),
                          mLeft = this.get('margin-left'),
                          mRight = this.get('margin-right');
      
      
      Severity: Major
      Found in assets/js/prototype.js and 1 other location - About 1 hr to fix
      assets/js/prototype.js on lines 3908..3916

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

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

          request: function (url) {
              this.url = url;
              this.method = this.options.method;
              var params = Object.isString(this.options.parameters) ?
                  this.options.parameters :
      Severity: Minor
      Found in assets/js/prototype.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          setRequestHeaders: function () {
              var headers = {
                  'X-Requested-With': 'XMLHttpRequest',
                  'X-Prototype-Version': Prototype.Version,
                  'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
      Severity: Minor
      Found in assets/js/prototype.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          select = Sizzle.select = function (selector, context, results, seed) {
              var i, tokens, token, type, find,
                  compiled = typeof selector === "function" && selector,
                  match = !seed && tokenize((selector = compiled.selector || selector));
      
      
      Severity: Minor
      Found in assets/js/prototype.js - About 1 hr to fix

        Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function tokenize(selector, parseOnly) {
                var matched, match, tokens, type,
                    soFar, groups, preFilters,
                    cached = tokenCache[selector + " "];
        
        
        Severity: Minor
        Found in assets/js/prototype.js - About 1 hr to fix

          Function getPixelValue has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function getPixelValue(value, property, context) {
                  var element = null;
                  if (Object.isElement(value)) {
                      element = value;
                      value = getRawStyle(element, property);
          Severity: Minor
          Found in assets/js/prototype.js - About 1 hr to fix

            Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function matcherFromTokens(tokens) {
                    var checkContext, matcher, j,
                        len = tokens.length,
                        leadingRelative = Expr.relative[tokens[0].type],
                        implicitRelative = leadingRelative || Expr.relative[" "],
            Severity: Minor
            Found in assets/js/prototype.js - About 1 hr to fix

              Function _begin has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _begin: function () {
                          if (this._isPrepared()) return;
              
                          var element = this.element;
                          if (isDisplayed(element)) {
              Severity: Minor
              Found in assets/js/prototype.js - About 1 hr to fix

                Function findDOMClass has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function findDOMClass(tagName) {
                        var klass;
                        var trans = {
                            "OPTGROUP": "OptGroup",
                            "TEXTAREA": "TextArea",
                Severity: Minor
                Found in assets/js/prototype.js - About 1 hr to fix

                  Method checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                      {
                          $moduleDirName      = \basename(\dirname(__DIR__, 2));
                          $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                          $update             = '';
                  Severity: Minor
                  Found in class/Common/VersionChecks.php - About 1 hr to fix

                    Function serializeElements has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        serializeElements: function (elements, options) {
                            if (typeof options != 'object') options = {hash: !!options};
                            else if (Object.isUndefined(options.hash)) options.hash = true;
                            var key, value, submitted = false, submit = options.submit, accumulator, initial;
                    
                    
                    Severity: Minor
                    Found in assets/js/prototype.js - About 1 hr to fix

                      Function getElementsByClassName has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                      if (!document.getElementsByClassName) document.getElementsByClassName = function (instanceMethods) {
                          function iter(name) {
                              return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
                          }
                      
                      
                      Severity: Minor
                      Found in assets/js/prototype.js - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Severity
                      Category
                      Status
                      Source
                      Language