Showing 97 of 165 total issues
Function ready
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ChannelIFrame.prototype.ready = function () {
var self = this;
var promise = this.readyPromise;
if (!promise) {
var channel = this.channel;
Function ready
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ChannelIFrame.prototype.ready = function () {
var self = this;
var promise = this.readyPromise;
if (!promise) {
var channel = this.channel;
Function output
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var output = map($keys, function (key) {
var name, str;
if (value.__lookupGetter__) {
if (value.__lookupGetter__(key)) {
if (value.__lookupSetter__(key)) {
Function e
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
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){
- Read upRead up
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
Open
function waitMessageResponse(self, id, timeout, resolve, reject) {
var _myWindow = self.findMyWindow();
var listener = function responseListener(event) {
- Read upRead up
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
Open
},{"./channel":14,"_process":2}],2:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
Function write
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)) {
Function 5
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function _augment
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer._augment = function (arr) {
arr._isBuffer = true
// save reference to original Uint8Array get/set methods before overwriting
arr._get = arr.get
Function emit
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
EventEmitter.prototype.emit = function(type) {
var er, handler, len, args, i, listeners;
if (!this._events)
this._events = {};
Function Buffer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Buffer (subject, encoding, noZero) {
if (!(this instanceof Buffer))
return new Buffer(subject, encoding, noZero)
var type = typeof subject
Function write
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
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,
Function 9
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./util/globals":10,"./util/mock-window":11}],9:[function(require,module,exports){
require('./globals');
var instanceCount = 0;
Function 4
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./promise/polyfill":7,"./promise/promise":8}],4:[function(require,module,exports){
"use strict";
/* global toString */
var isArray = require("./utils").isArray;
Function toString
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.prototype.toString = function (encoding, start, end) {
var self = this
encoding = String(encoding || 'utf8').toLowerCase()
start = Number(start) || 0
Function parse
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function addListener
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
EventEmitter.prototype.addListener = function(type, listener) {
var m;
if (!isFunction(listener))
throw TypeError('listener must be a function');
Function property
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) }
Function removeListener
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
EventEmitter.prototype.removeListener = function(type, listener) {
var list, position, length, i;
if (!isFunction(listener))
throw TypeError('listener must be a function');
Function 11
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"expect.js":6}],11:[function(require,module,exports){
var EventEmitter = require('events').EventEmitter;
var instanceCount = 0;