browsers/polyfill.js

Summary

Maintainability
D
2 days
Test Coverage

File polyfill.js has 608 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable */
/*!
Copyright (C) 2013-2015 by WebReflection

Permission is hereby granted, free of charge, to any person obtaining a copy
Severity: Major
Found in browsers/polyfill.js - About 1 day to fix

    Function addEventListener has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            addEventListener: valueDesc(function (type, handler, capture) {
              if (typeof handler !== 'function' && typeof handler !== 'object') return;
              var
                self = this,
                ontype = 'on' + type,
    Severity: Major
    Found in browsers/polyfill.js - About 2 hrs to fix

      Function getComputedStyle has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              getComputedStyle: valueDesc(function(){
        
                var // partially grabbed from jQuery and Dean's hack
                  notpixel = /^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,
                  position = /^(top|right|bottom|left)$/,
      Severity: Major
      Found in browsers/polyfill.js - About 2 hrs to fix

        Function getPropertyValue has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  ComputedStyle.prototype.getPropertyValue = function (name) {
                    var
                      el = this._,
                      style = el.style,
                      currentStyle = el.currentStyle,
        Severity: Minor
        Found in browsers/polyfill.js - About 1 hr to fix

          Function commonEventLoop has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function commonEventLoop(currentTarget, e, $handlers, synthetic) {
                for(var
                  handler,
                  continuePropagation,
                  handlers = $handlers.slice(),
          Severity: Minor
          Found in browsers/polyfill.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                                if ((attr = self.getAttribute(ontype))) {
                                  removeAttribute.call(self, ontype);
                                }
            Severity: Major
            Found in browsers/polyfill.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if (self.parentNode == null) {
                                    div.appendChild(self);
                                  }
              Severity: Major
              Found in browsers/polyfill.js - About 45 mins to fix

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

                        previousElementSibling: {
                          get: function () {
                            var previousElementSibling = this.previousSibling;
                            while (previousElementSibling && previousElementSibling.nodeType != 1) {
                              previousElementSibling = previousElementSibling.previousSibling;
                Severity: Major
                Found in browsers/polyfill.js and 1 other location - About 1 hr to fix
                browsers/polyfill.js on lines 343..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 60.

                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

                        nextElementSibling: {
                          get: function () {
                            var nextElementSibling = this.nextSibling;
                            while (nextElementSibling && nextElementSibling.nodeType != 1) {
                              nextElementSibling = nextElementSibling.nextSibling;
                Severity: Major
                Found in browsers/polyfill.js and 1 other location - About 1 hr to fix
                browsers/polyfill.js on lines 334..342

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

                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

                        pageX: {get: function(){ return this._pageX || (this._pageX = this.clientX + window.scrollX - (html.clientLeft || 0)); }},
                Severity: Major
                Found in browsers/polyfill.js and 1 other location - About 1 hr to fix
                browsers/polyfill.js on lines 588..588

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

                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

                        pageY: {get: function(){ return this._pageY || (this._pageY = this.clientY + window.scrollY - (html.clientTop || 0)); }},
                Severity: Major
                Found in browsers/polyfill.js and 1 other location - About 1 hr to fix
                browsers/polyfill.js on lines 587..587

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

                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

                There are no issues that match your filters.

                Category
                Status