Showing 177 of 262 total issues
Function findDestination
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Policy.prototype.findDestination = function(lineage, id, constraints) {
var i;
// Step 1: if an instance already exists, the m
if (constraints.isolation !== 'always') {
- 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 a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function SimpleDataPeer(peerName, stunServers, dataChannelCallbacks, mocks) {
var constraints,
config,
i;
this.peerName = peerName;
- 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 getContents
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Resource.prototype.getContents = function (url) {
return new PromiseCompat(function (resolve, reject) {
var prop;
if (!url) {
this.debug.warn("Asked to get contents of undefined URL.");
- 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 39 lines of code (exceeds 25 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',
- Create a ticketCreate a ticket
Function IndexedDBStorageProvider
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function IndexedDBStorageProvider() {
this.dbName = 'freedomjs';
this.storeName = 'freedomjs';
if (typeof freedom.storage !== 'undefined') {
this.ERRCODE = freedom.storage().ERRCODE;
- Create a ticketCreate a ticket
Function getInterface
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Provider.prototype.getInterface = function () {
if (this.iface) {
return this.iface;
} else {
var sanityCheck = function (provider) {
- Create a ticketCreate a ticket
Function start
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Module.prototype.start = function () {
var Port;
if (this.started || this.port) {
return false;
}
- Create a ticketCreate a ticket
Function aiMove
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Board.prototype.aiMove = function () {
'use strict';
if (this.playerMove) {
return;
}
- Create a ticketCreate a ticket
Function WS
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
var WS = function (cap, dispatchEvent, url, protocols, socket) {
var WSImplementation = null,
error;
this.isNode = nodeStyle;
if (typeof socket !== 'undefined') {
- 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 updateUsers
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
var updateUsers = function (users) {
var user, node;
if (!stage || typeof stage === 'function') {
stage = updateUsers.bind({}, users);
- 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 launchAuthFlow
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
RemotePageAuth.prototype.launchAuthFlow = function(authUrl, stateObj, interactive, continuation) {
"use strict";
var frame = global.document.createElement('iframe');
frame.src = stateObj.redirect;
frame.style.display = 'none';
- Create a ticketCreate a ticket
Function print
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Logger_console.prototype.print = function (severity, source, msg) {
var arr = msg;
if (typeof this.console === 'undefined' ||
this.console.freedom === true) {
return;
- Create a ticketCreate a ticket
Function fillClients
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
LoopbackSocialProvider.prototype.fillClients = function() {
var STATUSES = ['ONLINE', 'OFFLINE', 'ONLINE_WITH_OTHER_APP'],
userId, nClients, clientId, i;
this.clients = {
"Test User.0": {
- Create a ticketCreate a ticket
Function send
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
WS.prototype.send = function (data, continuation) {
var toSend = data.text || data.binary || data.buffer,
errcode,
message;
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (badBuffer[i - 2] === badBuffer[i + 2] &&
badBuffer[i + 2] === badBuffer[i - 1] &&
badBuffer[i - 1] === badBuffer[i + 1] &&
badBuffer[i - 1] * 3 === badBuffer[i] &&
// Background around the foreground pattern? Not part of the specs.
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ((frameBuffer[x + width * y] &&
frameBuffer[(x + 1) + width * y] &&
frameBuffer[x + width * (y + 1)] &&
frameBuffer[(x + 1) + width * (y + 1)]) ||
// All background colour.
- Create a ticketCreate a ticket
Function set
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
IndexedDBStorageProvider.prototype.set = function (key, value, continuation) {
//this.store.set(key, value).then(continuation);
if (this.handle.initializing) {
this.pushQueue("set", key, value, continuation);
return;
- Create a ticketCreate a ticket
Function loadLinks
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Module.prototype.loadLinks = function () {
var i, channels = ['default'], name, dep;
if (this.manifest.permissions) {
for (i = 0; i < this.manifest.permissions.length; i += 1) {
- Create a ticketCreate a ticket
Function onMessage
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
FileServer.prototype.onMessage = function (val) {
// Try parsing message
try {
val.msgStr = this.social.ab2str(val.data);
val.msg = JSON.parse(val.msgStr);
- Create a ticketCreate a ticket
Function _waitSend
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
WebRTCTransportProvider.prototype._waitSend = function(tag, buffers) {
var bufferBound = 0, // upper bound on the # of bytes buffered
sendBuffers, checkBufferedAmount;
sendBuffers = function() {
- Create a ticketCreate a ticket