Showing 301 of 580 total issues
Function modelRouter
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modelRouter (opts, fn) {
var router = express.Router()
var middleware = opts.middleware || []
var Model = opts.model
var name = opts.name || Model.modelName
Function end
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Batch.prototype.end = function(cb){
var self = this
, total = this.fns.length
, pending = total
, results = []
- 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 MemoryStats
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
var MemoryStats = function () {
var msMin = 100
var msMax = 0
var performance = window.performance
Function exports
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (commuter, plan) {
var welcome = new Welcome(commuter)
var locations = new Locations({
'locations-view': new LocationsView(plan),
plan: plan,
Function getBBox
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.getBBox = function() {
if (this.orientation === 'E') {
return {
x: this.labelAnchor.x,
Function tally
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
ProfileScore.prototype.tally = function (o) {
// Defaults
o.bikeCalories = 0
o.calories = 0
o.cost = 0
Function exports
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (opts, fn) {
if (opts.closable && !opts.logo) opts.template = closableHtml + opts.template
if (!opts.noPadding) opts.template = '<div class="content">' + opts.template + '</div>'
// Wrap with a logo nav
- 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 populate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function populate(els, data) {
for (var i = 0, el; el = els[i]; i++) {
var val = data[el.getAttribute('name')];
if (val !== undefined) {
- 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 calculateGeometry
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Edge.prototype.calculateGeometry = function(cellSize, angleConstraint) {
//if(!this.hasTransit()) angleConstraint = 5;
angleConstraint = angleConstraint || 45;
this.angleConstraintR = angleConstraint * Math.PI / 180;
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (obj, iterator, context) {
if (obj == null) return;
if (nativeForEach && obj.forEach === nativeForEach) {
obj.forEach(iterator, context);
} else if (obj.length === +obj.length) {
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (Model) {
Model
.attr('coordinate')
.attr('address')
.attr('original_address')
- 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 onclick
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function onclick(e) {
if (1 !== which(e)) return;
if (e.metaKey || e.ctrlKey || e.shiftKey) return;
- 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 continue
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Modal.prototype.continue = function (e) {
e.preventDefault()
var selections = {
commuterId: this.find('.commuter-id-select').value,
email: this.find('.email-select').value,
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (r5) {
const routeIdxToId = {}
r5.patterns.forEach((pattern) => {
routeIdxToId[pattern.routeIdx] = pattern.routeId
})
- 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 TileLayer
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function TileLayer(opts) {
debug('creating the tile layer');
var el = opts.el;
var display = opts.display;
Function exports
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (opts, fn) {
if (opts.closable && !opts.logo) opts.template = closableHtml + opts.template
if (!opts.noPadding) opts.template = '<div class="content">' + opts.template + '</div>'
// Wrap with a logo nav
Function Display
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Display(transitive) {
this.transitive = transitive;
var el = this.el = transitive.el;
this.width = el.clientWidth;
this.height = el.clientHeight;
File model.js
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
const mongoosePaginate = require('mongoose-paginate')
const {getAccount} = require('../auth0')
const Email = require('../email/model')
const Commuter = require('../commuter/model')
Function makeAuthResponseHandler
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeAuthResponseHandler (alertIfFailed, callback) {
return (authErr, authResult) => {
const idToken = authResult ? authResult.idToken : null
if (authErr || !idToken) {
store('auth0IdToken', null)
Function save
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
SignUpModal.prototype.save = function (e) {
e.preventDefault()
log('submit')
var alerts = this.find('.alerts')