Showing 301 of 580 total issues
Function rankRoutes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function rankRoutes (routes, primary, secondary) {
var primaryDomain = [d3.min(routes, primary), d3.max(routes, primary)]
var secondaryDomain = [d3.min(routes, secondary), d3.max(routes, secondary)]
var primaryScale = d3.scale.linear()
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (ctx, next) {
log('render')
var cls = ctx.location.commuterLocations = ctx.commuterLocations
Function handleSparkEvents
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.handleSparkEvents = function handleSparkEvents (events, callback) {
var batch = new Batch()
events.forEach(function (evnt) {
batch.push(function (done) {
Function createRenderedEdge
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Network.prototype.createRenderedEdge = function(pathSegment, gEdge, forward, patterns) {
var rEdge;
// construct the edge key, disregarding mode qualifiers (e.g. "_RENT")
var type = pathSegment.getType().split('_')[0];
Function rayIntersection
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports.rayIntersection = function(ax, ay, avx, avy, bx, by, bvx, bvy) {
Function pointAlongArc
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports.pointAlongArc = function(x1, y1, x2, y2, r, theta, ccw, t) {
Function lineIntersection
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports.lineIntersection = function(x1, y1, x2, y2, x3, y3, x4, y4) {
Consider simplifying this complex logical expression. Open
if ((p) && (p[0] >= minX) && (p[0] < maxX) && (p[1] >= minY) && (p[
1] < maxY) && (p[2].parent) && (label.parent.patternIds === p[2]
.parent.patternIds)) {
matchItems.push(p[2]);
}
Function load
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
session.load = function (ctx, next) {
session.settings(store('session') || DEFAULT_SETTINGS)
loadUser(function (err) {
if (err) return next(err)
- 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 coordAlongEdge
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Edge.prototype.coordAlongEdge = function(t, coords, display) {
if (!this.baseRenderCoords) this.calculateBaseRenderCoords(display);
if (coords.length === 2 && this.baseRenderCoords.length === 4) {
- 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 DefaultRenderer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var DefaultRenderer = augment(Renderer, function(base) {
this.constructor = function(transitive) {
base.constructor.call(this, transitive);
};
- 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 renderRoute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Modal.prototype.renderRoute = function (data) {
data.calories = data.calories ? parseInt(data.calories, 10).toLocaleString() + ' cals' : 'None'
data.cost = data.cost ? '$' + data.cost.toFixed(2) : 'Free'
data.emissions = data.emissions ? parseInt(data.emissions, 10) : 'None'
data.walkDistance = data.walkDistance ? data.walkDistance + ' mi' : 'None'
- 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 decode
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports.decode = function(polyline) {
var currentPosition = 0;
var currentLat = 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 mergeVertices
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
NetworkGraph.prototype.mergeVertices = function(vertexArray) {
var xTotal = 0,
yTotal = 0;
var vertexGroups = {
- 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 page
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function page(path, fn) {
// <callback>
if ('function' === typeof path) {
return page('*', path);
}
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (schema, options) {
/**
* Add address and coordinate fields
*/
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
var View = module.exports = view(require('./template.html'), function (view, plan) {
plan.on('change', function (name) {
view.resetIcons()
if (name === 'from') view.find('#from-location').value = plan.from()
- 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 getDomains
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getDomains(display, height, width, bounds, options) {
var xmin = bounds[0][0],
xmax = bounds[1][0];
var ymin = bounds[0][1],
ymax = bounds[1][1];
- 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
Avoid deeply nested control flow statements. Open
if (el.type === 'date') {
val += '-' + date;
}
Function angleFromThreePoints
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports.angleFromThreePoints = function(ax, ay, bx, by, cx, cy) {