benjamine/frame-channels

View on GitHub

Showing 97 of 165 total issues

Function ready has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ChannelIFrame.prototype.ready = function () {
  var self = this;
  var promise = this.readyPromise;
  if (!promise) {
    var channel = this.channel;
Severity: Major
Found in src/channel-iframe.js - About 2 hrs to fix

    Function ready has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ChannelIFrame.prototype.ready = function () {
      var self = this;
      var promise = this.readyPromise;
      if (!promise) {
        var channel = this.channel;
    Severity: Major
    Found in public/build/frame-channels.js - About 2 hrs to fix

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

            var output = map($keys, function (key) {
              var name, str;
              if (value.__lookupGetter__) {
                if (value.__lookupGetter__(key)) {
                  if (value.__lookupSetter__(key)) {
      Severity: Major
      Found in public/build/test-bundle.js - About 2 hrs to fix

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

        (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
        Severity: Minor
        Found in public/build/test-bundle.js - About 2 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 waitMessageResponse has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

        function waitMessageResponse(self, id, timeout, resolve, reject) {
        
          var _myWindow = self.findMyWindow();
        
          var listener = function responseListener(event) {
        Severity: Minor
        Found in src/channel.js - About 2 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 2 has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{"./channel":14,"_process":2}],2:[function(require,module,exports){
        // shim for using process in browser
        
        var process = module.exports = {};
        
        
        Severity: Minor
        Found in public/build/frame-channels.js - About 2 hrs to fix

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

          Buffer.prototype.write = function (string, offset, length, encoding) {
            // Support both (string, offset, length, encoding)
            // and the legacy (string, encoding, offset, length)
            if (isFinite(offset)) {
              if (!isFinite(length)) {
          Severity: Minor
          Found in public/build/test-bundle.js - About 2 hrs to fix

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

            },{"./utils":12}],5:[function(require,module,exports){
            (function (process,global){
            "use strict";
            var browserGlobal = (typeof window !== 'undefined') ? window : {};
            var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
            Severity: Minor
            Found in public/build/frame-channels.js - About 1 hr to fix

              Function _augment has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Buffer._augment = function (arr) {
                arr._isBuffer = true
              
                // save reference to original Uint8Array get/set methods before overwriting
                arr._get = arr.get
              Severity: Minor
              Found in public/build/test-bundle.js - About 1 hr to fix

                Function emit has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                EventEmitter.prototype.emit = function(type) {
                  var er, handler, len, args, i, listeners;
                
                  if (!this._events)
                    this._events = {};
                Severity: Minor
                Found in public/build/test-bundle.js - About 1 hr to fix

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

                  function Buffer (subject, encoding, noZero) {
                    if (!(this instanceof Buffer))
                      return new Buffer(subject, encoding, noZero)
                  
                    var type = typeof subject
                  Severity: Minor
                  Found in public/build/test-bundle.js - About 1 hr to fix

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

                    exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
                      var e, m, c,
                          eLen = nBytes * 8 - mLen - 1,
                          eMax = (1 << eLen) - 1,
                          eBias = eMax >> 1,
                    Severity: Minor
                    Found in public/build/test-bundle.js - About 1 hr to fix

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

                      },{"./util/globals":10,"./util/mock-window":11}],9:[function(require,module,exports){
                      require('./globals');
                      
                      var instanceCount = 0;
                      
                      
                      Severity: Minor
                      Found in public/build/test-bundle.js - About 1 hr to fix

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

                        },{"./promise/polyfill":7,"./promise/promise":8}],4:[function(require,module,exports){
                        "use strict";
                        /* global toString */
                        
                        var isArray = require("./utils").isArray;
                        Severity: Minor
                        Found in public/build/frame-channels.js - About 1 hr to fix

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

                          Buffer.prototype.toString = function (encoding, start, end) {
                            var self = this
                          
                            encoding = String(encoding || 'utf8').toLowerCase()
                            start = Number(start) || 0
                          Severity: Minor
                          Found in public/build/test-bundle.js - About 1 hr to fix

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

                                JSON.parse = function (text, reviver) {
                                // The parse method takes a text and an optional reviver function, and returns
                                // a JavaScript value if the text is a valid JSON text.
                            
                                    var j;
                            Severity: Minor
                            Found in public/build/test-bundle.js - About 1 hr to fix

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

                              EventEmitter.prototype.addListener = function(type, listener) {
                                var m;
                              
                                if (!isFunction(listener))
                                  throw TypeError('listener must be a function');
                              Severity: Minor
                              Found in public/build/test-bundle.js - About 1 hr to fix

                                Function property has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  Assertion.prototype.property = function (name, val) {
                                    if (this.flags.own) {
                                      this.assert(
                                          Object.prototype.hasOwnProperty.call(this.obj, name)
                                        , function(){ return 'expected ' + i(this.obj) + ' to have own property ' + i(name) }
                                Severity: Minor
                                Found in public/build/test-bundle.js - About 1 hr to fix

                                  Function removeListener has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  EventEmitter.prototype.removeListener = function(type, listener) {
                                    var list, position, length, i;
                                  
                                    if (!isFunction(listener))
                                      throw TypeError('listener must be a function');
                                  Severity: Minor
                                  Found in public/build/test-bundle.js - About 1 hr to fix

                                    Function 11 has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    },{"expect.js":6}],11:[function(require,module,exports){
                                    
                                    var EventEmitter = require('events').EventEmitter;
                                    
                                    var instanceCount = 0;
                                    Severity: Minor
                                    Found in public/build/test-bundle.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language