Showing 301 of 580 total issues
Function stroke
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function(display, data) {
var segment = data;
if (!segment.focused) return notFocusedColor;
if (segment.type === 'TRANSIT') {
if (segment.patterns) {
- 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 messages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function messages (ns, msgs) {
msgs = msgs || DEFAULT_MESSAGES
ns = ns ? ns.split(':') : []
/**
- 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 calculateWorldLengthAndMidpoint
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Edge.prototype.calculateWorldLengthAndMidpoint = function() {
var allPoints = [this.fromVertex.point].concat(this.pointArray, [this.toVertex
.point
]);
this.worldLength = 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 ccw
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports.ccw = function(ax, ay, bx, by, cx, cy) {
Function resampleArc
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function resampleArc(startPt, endPt, r, theta, ccw, spacing) {
Function exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function() {
var size = [960, 500],
scale = 256,
translate = [size[0] / 2, size[1] / 2],
zoomDelta = 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
Avoid deeply nested control flow statements. Open
if (err) {
return callback(err)
} else {
location.coordinate(res)
changes[name] = locationData
Function ccwRaw
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports.ccwRaw = function(ax, ay, bx, by, cx, cy) {
Function bind
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Reactive.prototype.bind = function(name, fn) {
if ('object' == typeof name) {
for (var key in name) {
this.bind(key, name[key]);
}
- 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 Label
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var Label = augment(Object, function() {
this.constructor = function(parent) {
this.parent = parent;
this.sortableType = 'LABEL';
- 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 dispatch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
page.dispatch = function(ctx) {
var prev = prevContext,
i = 0,
j = 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
Consider simplifying this complex logical expression. Open
if ((p) && (p[0] >= minX) && (p[0] < maxX) && (p[1] >= minY) && (p[
1] < maxY) && label.intersects(p[2])) {
matchItems.push(p[2]);
}
Consider simplifying this complex logical expression. Open
if (!called) {
called = true
debug('<-- %s > %s', name, err || res.error || res.status)
callback(err || res.error, res)
} else {
Function applyRules
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Styler.prototype.applyRules = function(display, elements, name, rules, fn) {
Function bbox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
SphericalMercator.prototype.bbox = function(x, y, zoom, tms_style, srs) {
Function equalVectors
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function equalVectors(x1, y1, x2, y2, tol) {
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function haversine(lat1, lon1, lat2, lon2, miles) {
Function getDomains
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getDomains(display, height, width, bounds, options) {
Function createGraphEdge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Network.prototype.createGraphEdge = function(segment, fromVertex, toVertex, internalPoints, geomCoords) {
Function constructJourneySegment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function constructJourneySegment (streetEdgeMap, mode, from, to, edges) {