Showing 56 of 100 total issues
Avoid deeply nested control flow statements. Open
for (var k = coordinateSetSet.length - 1; k >= 0; k--) {
bounds.minX = Math.min(bounds.minX, coordinateSetSet[k][0]);
bounds.maxX = Math.max(bounds.maxX, coordinateSetSet[k][0]);
bounds.minY = Math.min(bounds.minY, coordinateSetSet[k][1]);
bounds.maxY = Math.max(bounds.maxY, coordinateSetSet[k][1]);
Function _screenLine
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_screenLine: function(dashArray, start, end, realLength, angle, offset) {
Avoid deeply nested control flow statements. Open
for (var j = 0, jLen = fullText.length; j < jLen; j++) {
// GO BACKWARDS FOR FLIPPED TEXT
if (flippedText) {
if (segmentOffset + segmentDistance + textPixels > segmentLength && (i < len - 1 || closedShape)) {
Function getShapes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
getShapes: function(minX, minY, maxX, maxY, mapProjection, callback) {
Avoid deeply nested control flow statements. Open
if (instanceStyle["text-halo-radius"]) {
ctx.lineWidth = instanceStyle["text-halo-radius"].value * 2;
}
Function getShapes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
getShapes: function(minX, minY, maxX, maxY, mapProjection, callback) {
Avoid deeply nested control flow statements. Open
for (var k = coordinateSetSet.length - 1; k >= 0; k--) {
bounds.minX = Math.min(bounds.minX, coordinateSetSet[k][0]);
bounds.maxX = Math.max(bounds.maxX, coordinateSetSet[k][0]);
bounds.minY = Math.min(bounds.minY, coordinateSetSet[k][1]);
bounds.maxY = Math.max(bounds.maxY, coordinateSetSet[k][1]);
Consider simplifying this complex logical expression. Open
if (shouldFill || shouldStroke || shouldMark || shouldPoint || shouldText) {
ctx.beginPath();
var shape = feature.geometry || feature;
var coordinates = shape.coordinates;
renderPath[shape.type].call(ctx, coordinates, scale);
Function _filterByExtent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_filterByExtent: function(dataset, minX, minY, maxX, maxY) {
Function _filterByExtent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_filterByExtent: function(dataset, minX, minY, maxX, maxY) {
Function cartoGridRenderer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var cartoGridRenderer = function (ctx, scale, layers, styles, zoom) {
Function tileJson
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports.tileJson = function tileJson(options) {
var options = options || {},
path = options.path;
if (!options.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 utfGrid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports.utfGrid = function utfGrid(options){
var options = options || {},
map = options.map,
format;
- 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 too many return
statements within this function. Open
return true;
Function getShapes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getShapes: function(minX, minY, maxX, maxY, mapProjection, callback) {
if (this._projectedData[mapProjection]){
var data = this._filterByExtent(this._projectedData[mapProjection], minX, minY, maxX, maxY);
callback(null, 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 getShapes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getShapes: function(minX, minY, maxX, maxY, mapProjection, callback) {
if (this._projectedData[mapProjection]){
var data = this._filterByExtent(this._projectedData[mapProjection], minX, minY, maxX, maxY);
callback(null, 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"