Showing 177 of 262 total issues
Function onMessage
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Manager.prototype.onMessage = function (flow, message) {
var reverseFlow = this.controlFlows[flow], origin;
if (!reverseFlow) {
this.debug.warn("Unknown message source: " + flow);
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 mapProxies
has 56 lines of code (exceeds 25 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) {
- Create a ticketCreate a ticket
Function onMessage
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Provider.prototype.onMessage = function (source, message) {
if (source === 'control' && message.reverse) {
this.channels[message.name] = message.channel;
this.emit(message.channel, {
type: 'channel announcement',
- Create a ticketCreate a ticket
Function onMessage
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Manager.prototype.onMessage = function (flow, message) {
var reverseFlow = this.controlFlows[flow], origin;
if (!reverseFlow) {
this.debug.warn("Unknown message source: " + flow);
return;
- Create a ticketCreate a ticket
Function onMessage
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
ModuleInternal.prototype.onMessage = function (flow, message) {
if (flow === 'control') {
if (!this.controlChannel && message.channel) {
this.controlChannel = message.channel;
util.mixin(this.config, message.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"
Further reading
Function checkBadness
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkBadness() {
var b, b1, bad, big, bw, count, h, x, y;
bad = bw = count = 0;
// Blocks of same colour.
- Create a ticketCreate a ticket
Function send
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
WS.prototype.send = function (data, continuation) {
var toSend = data.text || data.binary || data.buffer,
errcode,
message;
- 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 initialize
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initialize(fileDrop) {
FileRead.app = fileDrop;
fileDrop.on('serve-descriptor', function (val) {
var displayUrl = window.location + "#" + JSON.stringify(val);
- Create a ticketCreate a ticket
Function WS
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var WS = function (cap, dispatchEvent, url, protocols, socket) {
var WSImplementation = null,
error;
this.isNode = nodeStyle;
if (typeof socket !== 'undefined') {
- Create a ticketCreate a ticket
Function boot
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Chat.prototype.boot = function () {
this.social.login({
agent: 'chatdemo',
version: '0.1',
url: '',
- Create a ticketCreate a ticket
Function loadScripts
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
ModuleInternal.prototype.loadScripts = function (from, scripts) {
var importer = function (script, resolve, reject) {
try {
this.config.global.importScripts(script);
resolve(true);
- Create a ticketCreate a ticket
Function loadLinks
has a Cognitive Complexity of 14 (exceeds 5 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;
},
- 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 print
has a Cognitive Complexity of 14 (exceeds 5 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;
- 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 show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Core_View.prototype.show = function (name, continuation) {
if (this.id) {
return continuation(undefined, {
errcode: 'ALREADY_OPEN',
message: 'Cannot show multiple views through one instance.'
- Create a ticketCreate a ticket
Function HeightView
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
var HeightView = function () {
'use strict';
window.addEventListener('message', function (msg, source) {
if (this.frameWindow === source.source) {
this.postMessage(msg.data);
- Create a ticketCreate a ticket
Function getProxyInterface
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Provider.prototype.getProxyInterface = function () {
var func = function (p) {
return p.getInterface();
}.bind({}, this);
- Create a ticketCreate a ticket
Function onOpen
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
onOpen: function (id, name, page, resources, postMessage) {
var container = document.body,
root,
frame;
- Create a ticketCreate a ticket
Function onMessage
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
ModuleInternal.prototype.onMessage = function (flow, message) {
if (flow === 'control') {
if (!this.controlChannel && message.channel) {
this.controlChannel = message.channel;
util.mixin(this.config, message.config);
- Create a ticketCreate a ticket
Function createLink
has 40 lines of code (exceeds 25 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));
- Create a ticketCreate a ticket
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"