Showing 49 of 59 total issues
Avoid too many return
statements within this function. Open
return callback(null, new Renderer(urlTemplate, subdomains, rendererOptions));
Avoid too many return
statements within this function. Open
return true;
Function getRenderer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getRenderer (mapConfig, format, options, callback) {
if (mapConfig.isVectorOnlyMapConfig() && format !== PgMvtFactory.MVT_FORMAT) {
const error = new Error(`Unsupported format: 'cartocss' option is missing for ${format}`);
error.http_status = 400;
error.type = 'tile';
- 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 getRenderer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getRenderer (mapConfig, format, options, callback) {
const layerNumber = options.layer;
const layer = mapConfig.getLayer(layerNumber);
const urlTemplate = layer.options.urlTemplate;
- 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 _finish_request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_finish_request: function (key) {
// Remove from requests in process
var pos = this._requests_in_process.indexOf(key);
if (pos >= 0) {
this._requests_in_process.splice(pos, 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
Function getSimplifyExtent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getSimplifyExtent (layers, vectorExtent) {
let undef = 0;
const extents = [...new Set(layers.map(layer => {
if (layer.options.vector_simplify_extent === undefined) {
undef++;
- 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 checkValidType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function checkValidType (e, type) {
if (['number', 'float'].indexOf(type) > -1) {
return typeof e.value === 'number';
} else if (type === 'string') {
return e.value !== 'undefined' && typeof e.value === 'string';
- 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 typeName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function typeName (cname) {
let tname = cname;
if (cname.match('bool')) {
tname = 'boolean';
- 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 getRenderer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getRenderer (mapConfig, format, options, callback) {
const layerNumber = options.layer;
const layer = mapConfig.getLayer(layerNumber);
if (layer.type !== this.getName()) {
- 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"