Showing 623 of 1,229 total issues
Function populateSessionWithUser
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function populateSessionWithUser(cb) {
return function(err, body, headers) {
if (err) { return cb(err); }
getUserName(body.name, headers['set-cookie'], function(err, name) {
Function exposeCallback
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function exposeCallback(rpcInstance) {
var chnlName = 'MR-' + modelName; //prefix MR stands for Moonridge
rpcInstance.expose(chnlName, channel, opts.authFn);
var chnlSocket = rpcInstance.channels[chnlName]._socket;
Function keydown
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, keydown: function (e) {
var $this
, $items
, $active
, $parent
Function setupClipboard
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setupClipboard(element, opts) {
if (!FileReaderJS.enabled) {
return;
}
Function _resolve
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _resolve(tree, forest) {
// console.log(forest);
tree.deps.every(function(dep) {
Function splitSquare
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
splitSquare: function(b) {
return [
[
{x: b.x, y: b.y},
{x: b.x + b.width / 2, y: b.y},
Function _executeFirstJob
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _executeFirstJob() {
var i,
l,
test,
kill,
Function resize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sigma.renderers.canvas.prototype.resize = function(w, h) {
var k,
oldWidth = this.width,
oldHeight = this.height,
pixelRatio = 1;
Function updateMassAndGeometry
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
forceatlas2.Region.prototype.updateMassAndGeometry = function() {
if (this.nodes.length > 1) {
// Compute Mass
var mass = 0;
var massSumX = 0;
Function area
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
quad.prototype.area = function(rect) {
var serialized = JSON.stringify(rect),
collisionFunc,
rectData;
Function enter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
enter: function(n, c) {
// TODO this is bad design
var _c = {id: ""};
map(n.callee, _getId(_c));
Function bench
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bench(ITERATION) {
// LOOP
start = time.now();
for(var i=0; i < ITERATION; i++){
loop();
Consider simplifying this complex logical expression. Open
Open
if (ids.length === 2 &&
( this.postTriggers.indexOf(ids[0]) > -1 && expressRoutes.indexOf(ids[1]) > -1
|| this.postTriggers.indexOf(ids[0]) > -1 && fsMethods.indexOf(ids[1]) > -1)
|| ids.length === 1 &&
( this.postTriggers.indexOf(ids[0]) > -1)) {
Consider simplifying this complex logical expression. Open
Open
if (ids.length === 2 &&
( this.startTriggers.indexOf(ids[0]) > -1 && expressRoutes.indexOf(ids[1]) > -1
|| this.startTriggers.indexOf(ids[0]) > -1 && fsMethods.indexOf(ids[1]) > -1)
|| ids.length === 1 &&
( this.startTriggers.indexOf(ids[0]) > -1)) {
Function insert
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function insert(n, d, x, y, x1, y1, x2, y2) {
Function insertChild
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function insertChild(n, d, x, y, x1, y1, x2, y2) {
Consider simplifying this complex logical expression. Open
Open
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
Consider simplifying this complex logical expression. Open
Open
if ( unit !== "px" && start ) {
// Iteratively approximate from a nonzero starting point
// Prefer the current property, because this process will be trivial if it uses the same units
// Fallback to end or a simple constant
start = jQuery.css( tween.elem, prop, true ) || end || 1;
Function callback
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
, callback: function(name) {
return function(vals, cb) {
if (vals.length > 1) {
cb(new Error("The parameter can only be specified once"))
} else {
- 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 iteratorFactory
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function iteratorFactory(typesWalker) {
return function iterator(context) {
function handlerFactory(visitorEvent) {
return function handler(node, parent) {
if (!node.type)
- 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"