Showing 177 of 262 total issues
Function get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Policy.prototype.get = function(lineage, id) {
// Make sure that a module isn't getting located twice at the same time.
// This is resolved by delaying if it until we see it in a 'moduleAdd' event.
if (this.pending[id]) {
- Create a ticketCreate a ticket
Function send
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
WebRTCTransportProvider.prototype.send = function(tag, data, continuation) {
// console.log("TransportProvider.send." + this.name);
if(!this._setup) {
continuation(undefined, {
"errcode": "NOTREADY",
- Create a ticketCreate a ticket
Function format
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Debug.prototype.format = function (severity, source, args) {
var i, alist = [], argarr;
if (typeof args === "string" && source) {
try {
argarr = JSON.parse(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 register
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Api.prototype.register = function(name, constructor, style, flags) {
var i,
args;
this.providers[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 checkWin
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Board.prototype.checkWin = function () {
'use strict';
var sets = ["012", "345", "678", "036", "147", "258", "048", "246"],
s,
set,
- 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 changeRoster
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
WSSocialProvider.prototype.changeRoster = function(id, stat) {
var newStatus, result = {
userId: id,
clientId: id,
lastUpdated: (this.clients.hasOwnProperty(id)) ? this.clients[id].lastUpdated: (new Date()).getTime(),
- Create a ticketCreate a ticket
Function removeLink
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Manager.prototype.removeLink = function (port, name) {
var reverse = this.hub.getDestination(name),
rflow = this.reverseFlowMap[name],
i;
- Create a ticketCreate a ticket
Function onNegotiationNeeded
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
SimpleDataPeer.prototype.onNegotiationNeeded = function (e) {
//console.log(this.peerName + ": " + "onNegotiationNeeded",
// JSON.stringify(this._pc), e);
if (this.pcState !== SimpleDataPeerState.DISCONNECTED) {
// Negotiation messages are falsely requested for new data channels.
- Create a ticketCreate a ticket
Function httpResolver
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Resource.prototype.httpResolver = function (manifest, url, resolve, reject) {
var protocols = ["http", "https", "chrome", "chrome-extension", "resource",
"app", "gopher"],
dirname,
protocolIdx,
- Create a ticketCreate a ticket
Function negotiateState
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
var negotiateState = function (text, button, channel) {
var state = {at: 0, text: text, button: button, channel: channel};
button.innerText = 'CreateOffer';
channel.on('ice', function (ice) {
state.text.value += '\n' + ice;
- Create a ticketCreate a ticket
Function start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start(LogClient) {
var logClient = new LogClient(),
input = document.getElementById('msg-input');
input.focus();
- Create a ticketCreate a ticket
Function deregisterFlow
has 30 lines of code (exceeds 25 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.
- Create a ticketCreate a ticket
Function layout
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
User.prototype.layout = function () {
if (this.phase !== 'entered') {
return this.el;
}
var idx = uqueue.indexOf(this),
- Create a ticketCreate a ticket
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
'use strict';
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
- Create a ticketCreate a ticket
Function _handleData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
WebRTCTransportProvider.prototype._handleData = function(tag, buffer) {
var currentTag;
if (tag in this._chunks) {
currentTag = this._chunks[tag];
currentTag.buffers.push(buffer);
- Create a ticketCreate a ticket
Function remove
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
IndexedDBStorageProvider.prototype.remove = function (key, continuation) {
if (this.handle.initializing) {
this.pushQueue("remove", key, null, continuation);
return;
} else if (this.handle.db === null) {
- Create a ticketCreate a ticket
Function add
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Policy.prototype.add = function(port, policy) {
var runtime = {
manager: port,
modules: []
};
- Create a ticketCreate a ticket
Function getCore
has 29 lines of code (exceeds 25 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 = {};
- Create a ticketCreate a ticket
Function checkWin
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Board.prototype.checkWin = function () {
'use strict';
var sets = ["012", "345", "678", "036", "147", "258", "048", "246"],
s,
set,
- Create a ticketCreate a ticket
Function sendMessage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialTransport.prototype.sendMessage = function (to, tag, msg) {
if (!this.clients.hasOwnProperty(to)) {
return this.createReject('SEND_INVALIDDESTINATION');
} else if (this.clients[to].status === this.STATUS.OFFLINE) {
return this.createReject('OFFLINE');
- Create a ticketCreate a ticket