karma-runner/karma

View on GitHub
static/context.js

Summary

Maintainability
F
4 mos
Test Coverage

Function 8 has 1315 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"./reversed.json":8,"punycode":10}],8:[function(require,module,exports){
module.exports={
    "9": "Tab;",
    "10": "NewLine;",
    "33": "excl;",
Severity: Major
Found in static/context.js - About 6 days to fix

    File context.js has 2149 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
    var serialize = null
    try {
      serialize = require('dom-serialize')
    } catch (e) {
    Severity: Major
    Found in static/context.js - About 5 days to fix

      Function 10 has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring.
      Open

      },{}],10:[function(require,module,exports){
      (function (global){
      /*! https://mths.be/punycode v1.4.1 by @mathias */
      ;(function(root) {
      
      
      Severity: Minor
      Found in static/context.js - About 4 days 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 9 has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
      Open

      },{}],9:[function(require,module,exports){
      'use strict';
      
      var hasOwn = Object.prototype.hasOwnProperty;
      var toStr = Object.prototype.toString;
      Severity: Minor
      Found in static/context.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 10 has 290 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{}],10:[function(require,module,exports){
      (function (global){
      /*! https://mths.be/punycode v1.4.1 by @mathias */
      ;(function(root) {
      
      
      Severity: Major
      Found in static/context.js - About 1 day to fix

        Function 1 has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
        Open

        (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
        var serialize = null
        try {
          serialize = require('dom-serialize')
        } catch (e) {
        Severity: Minor
        Found in static/context.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 6 has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

        },{}],6:[function(require,module,exports){
        
        /**
         * Module dependencies.
         */
        Severity: Minor
        Found in static/context.js - About 6 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 3 has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
        Open

        },{}],3:[function(require,module,exports){
        // Load our dependencies
        var stringify = require('../common/stringify')
        
        // Define our context Karma constructor
        Severity: Minor
        Found in static/context.js - About 5 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 6 has 127 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{}],6:[function(require,module,exports){
        
        /**
         * Module dependencies.
         */
        Severity: Major
        Found in static/context.js - About 5 hrs to fix

          Function 3 has 114 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{}],3:[function(require,module,exports){
          // Load our dependencies
          var stringify = require('../common/stringify')
          
          // Define our context Karma constructor
          Severity: Major
          Found in static/context.js - About 4 hrs to fix

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

            },{"./karma":3}],5:[function(require,module,exports){
            (function (global){
            
            var NativeCustomEvent = global.CustomEvent;
            
            
            Severity: Minor
            Found in static/context.js - About 3 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 ContextKarma has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function ContextKarma (callParentKarmaMethod) {
              // Define local variables
              var hasError = false
              var self = this
              var isLoaded = false
            Severity: Major
            Found in static/context.js - About 3 hrs to fix

              Function 1 has 88 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
              var serialize = null
              try {
                serialize = require('dom-serialize')
              } catch (e) {
              Severity: Major
              Found in static/context.js - About 3 hrs to fix

                Function 9 has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{}],9:[function(require,module,exports){
                'use strict';
                
                var hasOwn = Object.prototype.hasOwnProperty;
                var toStr = Object.prototype.toString;
                Severity: Major
                Found in static/context.js - About 3 hrs to fix

                  Function 7 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                  },{"custom-event":5,"ent/encode":7,"extend":9,"void-elements":11}],7:[function(require,module,exports){
                  var punycode = require('punycode');
                  var revEntities = require('./reversed.json');
                  
                  module.exports = encode;
                  Severity: Minor
                  Found in static/context.js - About 3 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 stringify has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function stringify (obj, depth) {
                    if (depth === 0) {
                      return '...'
                    }
                  
                  
                  Severity: Major
                  Found in static/context.js - About 3 hrs to fix

                    Function encode has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function encode(input) {
                            var n,
                                delta,
                                handledCPCount,
                                basicLength,
                    Severity: Major
                    Found in static/context.js - About 2 hrs to fix

                      Function serialize has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function serialize (node, context, fn, eventTarget) {
                        if (!node) return '';
                        if ('function' === typeof context) {
                          fn = context;
                          context = null;
                      Severity: Major
                      Found in static/context.js - About 2 hrs to fix

                        Function setupContext has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          this.setupContext = function (contextWindow) {
                            // If we clear the context after every run and we already had an error
                            //   then stop now. Otherwise, carry on.
                            if (self.config.clearContext && hasError) {
                              return
                        Severity: Major
                        Found in static/context.js - About 2 hrs to fix

                          Function decode has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function decode(input) {
                                  // Don't use UCS-2
                                  var output = [],
                                      inputLength = input.length,
                                      out,
                          Severity: Major
                          Found in static/context.js - About 2 hrs to fix

                            Function extend has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            module.exports = function extend() {
                                var options, name, src, copy, copyIsArray, clone;
                                var target = arguments[0];
                                var i = 1;
                                var length = arguments.length;
                            Severity: Minor
                            Found in static/context.js - About 1 hr to fix

                              Function 5 has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              },{"./karma":3}],5:[function(require,module,exports){
                              (function (global){
                              
                              var NativeCustomEvent = global.CustomEvent;
                              
                              
                              Severity: Minor
                              Found in static/context.js - About 1 hr to fix

                                Function 7 has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                },{"custom-event":5,"ent/encode":7,"extend":9,"void-elements":11}],7:[function(require,module,exports){
                                var punycode = require('punycode');
                                var revEntities = require('./reversed.json');
                                
                                module.exports = encode;
                                Severity: Minor
                                Found in static/context.js - About 1 hr to fix

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

                                  function encode (str, opts) {
                                      if (typeof str !== 'string') {
                                          throw new TypeError('Expected a String');
                                      }
                                      if (!opts) opts = {};
                                  Severity: Minor
                                  Found in static/context.js - About 1 hr to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
                                                            if (copyIsArray) {
                                                                copyIsArray = false;
                                                                clone = src && isArray(src) ? src : [];
                                                            } else {
                                    Severity: Major
                                    Found in static/context.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if (q < t) {
                                                                  break;
                                                              }
                                      Severity: Major
                                      Found in static/context.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                for (var key in obj) {
                                                  if (Object.prototype.hasOwnProperty.call(obj, key)) {
                                                    if (first) {
                                                      first = false
                                                    } else {
                                        Severity: Major
                                        Found in static/context.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                  if (obj.constructor && typeof obj.constructor === 'function') {
                                                    constructor = obj.constructor.name
                                                  }
                                          Severity: Major
                                          Found in static/context.js - About 45 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                      return serialize(obj)
                                            Severity: Major
                                            Found in static/context.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                    return strs.join('')
                                              Severity: Major
                                              Found in static/context.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                        return obj.nodeValue
                                                Severity: Major
                                                Found in static/context.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                          return obj.outerHTML
                                                  Severity: Major
                                                  Found in static/context.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                            return obj.toString() + '\n' + obj.stack
                                                    Severity: Major
                                                    Found in static/context.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                              return '<!--' + obj.nodeValue + '-->'
                                                      Severity: Major
                                                      Found in static/context.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                  return 'Skipping stringify, no support for dom-serialize'
                                                        Severity: Major
                                                        Found in static/context.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return obj.toString()
                                                          Severity: Major
                                                          Found in static/context.js - About 30 mins to fix

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

                                                            },{"./reversed.json":8,"punycode":10}],8:[function(require,module,exports){
                                                            module.exports={
                                                                "9": "Tab;",
                                                                "10": "NewLine;",
                                                                "33": "excl;",
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 1 mo to fix
                                                            static/karma.js on lines 907..2223

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

                                                            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

                                                            },{}],10:[function(require,module,exports){
                                                            (function (global){
                                                            /*! https://mths.be/punycode v1.4.1 by @mathias */
                                                            ;(function(root) {
                                                            
                                                            
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 2 wks to fix
                                                            static/karma.js on lines 2342..2879

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

                                                            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

                                                            },{}],6:[function(require,module,exports){
                                                            
                                                            /**
                                                             * Module dependencies.
                                                             */
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 1 wk to fix
                                                            static/karma.js on lines 634..866

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

                                                            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 ContextKarma (callParentKarmaMethod) {
                                                              // Define local variables
                                                              var hasError = false
                                                              var self = this
                                                              var isLoaded = false
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 6 days to fix
                                                            context/karma.js on lines 5..139

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

                                                            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

                                                            },{}],9:[function(require,module,exports){
                                                            'use strict';
                                                            
                                                            var hasOwn = Object.prototype.hasOwnProperty;
                                                            var toStr = Object.prototype.toString;
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 5 days to fix
                                                            static/karma.js on lines 2223..2342

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

                                                            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(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
                                                            var serialize = null
                                                            try {
                                                              serialize = require('dom-serialize')
                                                            } catch (e) {
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 4 days to fix
                                                            static/karma.js on lines 446..548

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

                                                            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

                                                            },{"./karma":3}],5:[function(require,module,exports){
                                                            (function (global){
                                                            
                                                            var NativeCustomEvent = global.CustomEvent;
                                                            
                                                            
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 2 days to fix
                                                            static/karma.js on lines 582..634

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

                                                            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

                                                            },{"custom-event":5,"ent/encode":7,"extend":9,"void-elements":11}],7:[function(require,module,exports){
                                                            var punycode = require('punycode');
                                                            var revEntities = require('./reversed.json');
                                                            
                                                            module.exports = encode;
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 2 days to fix
                                                            static/karma.js on lines 866..907

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

                                                            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

                                                            },{"./util":2,"dom-serialize":6}],2:[function(require,module,exports){
                                                            exports.instanceOf = function (value, constructorName) {
                                                              return Object.prototype.toString.apply(value) === '[object ' + constructorName + ']'
                                                            }
                                                            
                                                            
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 1 day to fix
                                                            static/karma.js on lines 548..582

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

                                                            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

                                                            },{}],11:[function(require,module,exports){
                                                            /**
                                                             * This file automatically generated from `pre-publish.js`.
                                                             * Do not manually edit.
                                                             */
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 3 hrs to fix
                                                            static/karma.js on lines 2879..2904

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

                                                            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

                                                            ContextKarma.getDirectCallParentKarmaMethod = function (parentWindow) {
                                                              return function directCallParentKarmaMethod (method, args) {
                                                                // If the method doesn't exist, then error out
                                                                if (!parentWindow.karma[method]) {
                                                                  parentWindow.karma.error('Expected Karma method "' + method + '" to exist but it doesn\'t')
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 3 hrs to fix
                                                            context/karma.js on lines 142..153

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

                                                            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

                                                            ContextKarma.getPostMessageCallParentKarmaMethod = function (parentWindow) {
                                                              return function postMessageCallParentKarmaMethod (method, args) {
                                                                parentWindow.postMessage({ __karmaMethod: method, __karmaArguments: args }, window.location.origin)
                                                              }
                                                            }
                                                            Severity: Major
                                                            Found in static/context.js and 1 other location - About 1 hr to fix
                                                            context/karma.js on lines 154..158

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

                                                            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