Showing 206 of 270 total issues
Function exports
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(ss,client,options){
var bundler = ss.bundler.create({
define: define,
asset: asset
Function connect
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
connect: function(){
var sock = new eio.Socket(config);
sock.on('message', function(e) {
var i, x, msg = e;
Function reindentCode
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
service.reindentCode = function() {
return function (text, spaces) {
if (!text) return text;
var lines = text.split(/\r?\n/);
var prefix = ' '.substr(0, spaces || 0);
- Read upRead up
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 exports
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(ss, router, options, orchestrator) {
return function(plan) {
plan = plan || {};
- Read upRead up
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 encodePayloadAsArrayBuffer
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.encodePayloadAsArrayBuffer = function(packets, callback) {
if (!packets.length) {
return callback(new ArrayBuffer(0));
}
Function websocket
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
websocket: function(msg, meta, send) {
var handleError, msgLogName, req;
// RPC responder uses JSON both ways
msg = JSON.parse(msg);
Function decodeSymbol
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function decodeSymbol(strict) {
var byte1;
var byte2;
var byte3;
var byte4;
Function jsFiddle
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
directive.jsFiddle = function(getEmbeddedTemplate, escape, script) {
return {
terminal: true,
link: function(scope, element, attr) {
var name = '',
Function createDebug
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createDebug(namespace) {
var prevTime;
function debug() {
Function exports
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(ss, clients, options) {
// Append the 'serveClient' method to the HTTP Response object
res.serveClient = function(name) {
var self = this;
- Read upRead up
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 exports
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(ss,options) {
var mods = [];
return {
/**
* @ngdoc method
- Read upRead up
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 UniqueSet
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.UniqueSet = (function() {
function UniqueSet() {
this.data = {};
}
Consider simplifying this complex logical expression. Open
if ((typeof Buffer === 'function' && Buffer.isBuffer && Buffer.isBuffer(obj)) ||
(typeof ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||
(withNativeBlob && obj instanceof Blob) ||
(withNativeFile && obj instanceof File)
) {
Function link
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element, attr) {
var name = '',
stylesheet = '<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">\n',
fields = {
html: '',
Function syntax
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
directive.syntax = function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
function makeLink(type, text, link, icon) {
Function openPlunkr
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
docsApp.serviceFactory.openPlunkr = function(templateMerge, formPostData, loadedUrls) {
return function(content) {
var allFiles = [].concat(content.js, content.css, content.html);
var indexHtmlContent = '<!doctype html>\n' +
'<html ng-app="{{module}}">\n' +
Function extractSourceSpans
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function extractSourceSpans(node, isPreformatted) {
var nocode = /(?:^|\s)nocode(?:\s|$)/;
var chunks = [];
var length = 0;
Function addPane
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.addPane = function(element, attr) {
var li = angular.element('<li><a href></a></li>'),
a = li.find('a'),
tab = {
paneElement: element,
Function exports
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(session, socketId) {
return {
// Lists all the channels the client is currently subscribed to
list: function() {
- Read upRead up
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 decodePayload
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.decodePayload = function (data, binaryType, callback) {
if (typeof data !== 'string') {
return exports.decodePayloadAsBinary(data, binaryType, callback);
}