Showing 177 of 262 total issues
Function generateEnv
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
ModuleInternal.prototype.generateEnv = function (manifest, items) {
return this.binder.bindDefault(this.port, this.api, manifest, true).then(
function (binding) {
var i = 0;
binding.port.api = binding.external.api;
- 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 9 (exceeds 5 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);
- 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 flushQueue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
IndexedDBStorageProvider.prototype.flushQueue = function () {
var i, elt;
for (i = 0; i < this.queue.length; i += 1) {
elt = this.queue[i];
if (elt.cmd === "keys") {
- 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 _flushQueue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
IsolatedStorageProvider.prototype._flushQueue = function() {
var i, elt;
for (i = 0; i < this.queue.length; i += 1) {
elt = this.queue[i];
if (elt.cmd === "keys") {
- 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
Avoid deeply nested control flow statements. Open
if (this.dependantChannels.indexOf(key) < 0) {
return true;
}
- Create a ticketCreate a ticket
Function onMessage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Debug.prototype.onMessage = function (source, message) {
if (source === 'control' && message.channel && !this.emitChannel) {
this.emitChannel = message.channel;
this.config = message.config;
if (!this.config.global.console) {
- 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 bindDefault
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ProxyBinder.prototype.bindDefault = function (port, api, manifest, internal) {
'use strict';
var metadata = {
name: manifest.name,
icon: manifest.icon,
- 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 createLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Manager.prototype.createLink = function (port, name, destination, destName,
toDest) {
if (!this.config.global) {
this.once('config',
this.createLink.bind(this, port, name, destination, destName));
- 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 start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function start(LogClient) {
var logClient = new LogClient(),
input = document.getElementById('msg-input');
input.focus();
- 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
Avoid deeply nested control flow statements. Open
if (k) {
if (y !== 0) {
y--;
} else {
x -= 2;
- Create a ticketCreate a ticket
Function record
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var record = function (level, source, message) {
'use strict';
var formatted = '<span style="';
if (level === 'debug') {
formatted += "color:#888;";
- 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 WS
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var WS = function (cap, dispatchEvent, url, protocols, socket) {
- Create a ticketCreate a ticket
Function open
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
XhrProvider.prototype.open = function(method, url, async, user, password) {
- Create a ticketCreate a ticket
Function onOpen
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
onOpen: function (id, name, page, resources, postMessage) {
- Create a ticketCreate a ticket
Function PeerConnection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function PeerConnection(portModule, dispatchEvent,
RTCPeerConnection, RTCSessionDescription,
RTCIceCandidate) {
- Create a ticketCreate a ticket
Function conform
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Consumer.conform = function (template, from, externals, separate, debug) {
- Create a ticketCreate a ticket
Function onOpen
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
this.onOpen = function (id, name, page, resources, postMessage) {
- Create a ticketCreate a ticket
Function setup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PeerConnection.prototype.setup = function (signallingChannelId, peerName,
stunServers, initiateConnection,
continuation) {
- Create a ticketCreate a ticket
Function createLink
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Manager.prototype.createLink = function (port, name, destination, destName,
toDest) {
- Create a ticketCreate a ticket
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (grunt) {
'use strict';
/**
* GRUNT CONFIG
**/
- 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"