Showing 177 of 262 total issues
Function applyMask
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyMask(mask) {
var x, y, r3x, r3y;
switch (mask) {
case 0:
- Create a ticketCreate a ticket
Function handleEvents
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
util.handleEvents = function(obj) {
var eventState = {
DEBUG_BACKREF: obj,
multiple: {},
maybemultiple: [],
- Create a ticketCreate a ticket
Function getProxyInterface
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Provider.prototype.getProxyInterface = function () {
var func = function (p) {
return p.getInterface();
}.bind({}, this);
- Read upRead up
- Create a ticketCreate a ticket
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
File provider.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jslint indent:2, node:true, sloppy:true, browser:true */
var Consumer = require('./consumer');
var util = require('./util');
/**
- Create a ticketCreate a ticket
Function start
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start(ChatClient) {
var chatClient = new ChatClient(),
// If messages are going to a specific user, store that here.
activeBuddylistEntry,
buddylist,
- Create a ticketCreate a ticket
File consumer.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*globals Blob, ArrayBuffer, DataView */
/*jslint indent:2, node:true, sloppy:true */
var util = require('./util');
/**
- Create a ticketCreate a ticket
Function conform
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Consumer.conform = function (template, from, externals, separate, debug) {
/* jshint -W086 */
if (typeof (from) === 'function' && template !== 'proxy') {
//from = undefined;
//throw "Trying to conform a function";
- Create a ticketCreate a ticket
Function onmsg
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
onmsg: function (port, src, msg) {
var prop, debug, args, returnPromise, ret;
if (msg.action === 'method') {
if (typeof this[msg.type] !== 'function') {
port.debug.warn("Provider does not implement " + msg.type + "()!");
- Create a ticketCreate a ticket
Function loadLinks
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
ModuleInternal.prototype.loadLinks = function (items) {
var i, proxy, provider, core,
manifestPredicate = function (name, flow, msg) {
return flow === 'manifest' && msg.name === name;
},
- Create a ticketCreate a ticket
Function bindChannel
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Core_unprivileged.prototype.bindChannel = function(identifier, continuation, source) {
var toBind = Core_unprivileged.unboundChannels[identifier],
newSource = !source;
// when bindChannel is called directly, source will be undefined.
- Create a ticketCreate a ticket
Function deregisterFlow
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Module.prototype.deregisterFlow = function (flow, internal) {
var key,
map = internal ? this.internalPortMap : this.externalPortMap;
// TODO: this is inefficient, but seems less confusing than a 3rd
// reverse lookup map.
- Read upRead up
- Create a ticketCreate a ticket
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 aiMove
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Board.prototype.aiMove = function () {
'use strict';
if (this.playerMove) {
return;
}
- Read upRead up
- Create a ticketCreate a ticket
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 emitMessage
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Module.prototype.emitMessage = function (name, message) {
if (this.internalPortMap[name] === false && message.channel) {
this.internalPortMap[name] = message.channel;
this.emit('internalChannelReady');
return;
- Create a ticketCreate a ticket
Function setup
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
PeerConnection.prototype.setup = function (signallingChannelId, peerName,
stunServers, initiateConnection,
continuation) {
this.peerName = peerName;
var mocks = {RTCPeerConnection: this.RTCPeerConnection,
- Create a ticketCreate a ticket
Function isRunning
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Policy.prototype.isRunning = function(runtime, id, from, fullMatch) {
var i = 0, j = 0, okay;
for (i = 0; i < runtime.modules.length; i += 1) {
if (fullMatch && runtime.modules[i].length === from.length + 1) {
okay = true;
- Read upRead up
- Create a ticketCreate a ticket
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 getCore
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Api.prototype.getCore = function(name, from) {
return new PromiseCompat(function(resolve, reject) {
if (this.apis[name]) {
if (this.providers[name]) {
var args = {};
- Read upRead up
- Create a ticketCreate a ticket
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 onMessage
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Consumer.prototype.onMessage = function (source, message) {
if (source === 'control' && message.reverse) {
this.emitChannel = message.channel;
this.emit(this.emitChannel, {
type: 'channel announcement',
- Read upRead up
- Create a ticketCreate a ticket
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 mapProxies
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
ModuleInternal.prototype.mapProxies = function (manifest) {
var proxies = [], seen = ['core'], i, obj;
if (manifest.permissions) {
for (i = 0; i < manifest.permissions.length; i += 1) {
- Read upRead up
- Create a ticketCreate a ticket
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 SimpleDataPeer
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SimpleDataPeer(peerName, stunServers, dataChannelCallbacks, mocks) {
var constraints,
config,
i;
this.peerName = peerName;
- Create a ticketCreate a ticket
Function start
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function start(ChatClient) {
var chatClient = new ChatClient(),
// If messages are going to a specific user, store that here.
activeBuddylistEntry,
buddylist,
- Read upRead up
- Create a ticketCreate a ticket
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"