Showing 206 of 270 total issues
Function caseFoldCharset
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function caseFoldCharset(charSet) {
var charsetParts = charSet.substring(1, charSet.length - 1).match(
new RegExp(
'\\\\u[0-9A-Fa-f]{4}'
+ '|\\\\x[0-9A-Fa-f]{2}'
Function ngEmbedApp
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function($templateCache, $browser, docsRootScope, $location, $sniffer, $animate, $exceptionHandler) {
return {
terminal: true,
link: function(scope, element, attrs) {
var modules = ['ngAnimate'],
Function exports
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(serverStatus, message, config){
if (JSON.stringify(config) === '{}') {
config = {
secure : document.location.protocol === "https:"
Function doWrite
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
JSONPPolling.prototype.doWrite = function (data, fn) {
var self = this;
if (!this.form) {
var form = document.createElement('form');
Function api
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
api: function(transport) {
var methods = {
/**
* @ngdoc function
Function exports
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(ss, options) {
//set default timings
if (!options.onChange) {options.onChange = {};} // dubious side effect here
if (!options.onChange.delayTime) {options.onChange.delayTime = 100;}
File angular-bootstrap-prettify.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
var directive = {};
var service = { value: {} };
Function serveStatic
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function serveStatic (prefix,root, options) {
if (!root) {
throw new TypeError('root path required')
}
Function UniqueSet
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.UniqueSet = (function() {
function UniqueSet() {
this.data = {};
}
- 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 link
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, element, attrs) {
var modules = ['ngAnimate'],
embedRootScope,
deregisterEmbedRootScope;
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(ss) {
var middleware, responderCount, responders, useDefaults;
middleware = require('./middleware')(ss);
responderCount = 0;
responders = {};
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(ss,options) {
var mods = [];
return {
/**
* @ngdoc method
Function off
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
EventEmitter.prototype.off = function(type, listener) {
if (typeof listener !== 'function') {
throw new Error('removeListener only takes instances of Function');
}
Function find
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.find = function(sessionId, socketId, cb) {
return sessionStore.load(sessionId, function(err, session) {
// Create a new session if we don't have this sessionId in memory
// Note: in production you should be using Redis or another
// persistent store so this should rarely happen
- 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 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(session, socketId) {
return {
// Lists all the channels the client is currently subscribed to
list: function() {
Function load
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
load: function(staticPath, assetsPath, sessionStore, sessionOptions) {
if (!app) {
// if ss.http.middleware isn't used before server start, no need to load it
return;
}
Function exports
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(ss, router, options) {
function serve(processor) {
return function(request, response) {
var path = utils.parseUrl(request.url);
Function parse
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
Function exports
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(ss,client,options){
var bundler = ss.bundler.create({
define: define,
asset: asset
Function exports
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (ss, router/*, options*/) {
ss.bundler.forEach(function(bundler) {
router.on(bundler.dests.urls.css + '?*', serveCSS);