Showing 13 of 23 total issues
Function exports
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (grunt) => {
grunt.file.setBase('..');
// eslint-disable-next-line import/no-extraneous-dependencies
require('load-grunt-tasks')(grunt);
Function exports
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (() => {
const loadAPI = (app, path, pathApi) => {
const routesFiles = fs.readdirSync(path);
let existIndexRouter = false;
Function filterImgData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
static filterImgData(data, {
w, h, z, startYear, endYear
}) {
const components = 4;
const exp = z < 11 ? 0.3 + ((z - 3) / 20) : 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 loadAPI
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const loadAPI = (app, path, pathApi) => {
const routesFiles = fs.readdirSync(path);
let existIndexRouter = false;
routesFiles.forEach((file) => {
const newPath = path ? (`${path}/${file}`) : file;
Function deleteLayer
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async deleteLayer(ctx) {
const { layerId } = ctx.params;
logger.info(`Delete layer with id ${layerId}`);
let layer = null;
try {
Function patchLayer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async patchLayer(ctx) {
logger.info('Patch layer by id');
const { layerId } = ctx.params;
const { body } = ctx.request;
let layer = null;
Function createTeamLayer
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async createTeamLayer(ctx) {
logger.info('Create team layer');
const owner = { type: LayerService.type.TEAM, id: ctx.params.teamId };
let team = null;
try {
Function getCanvasTile
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getCanvasTile({
z, x, y, startYear, endYear
}) {
'use asm';
Function getAll
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async getAll(ctx) {
logger.info('Get all layers');
const userId = ctx.request.body.user.id;
const enabled = typeof ctx.request.query.enabled !== 'undefined'
? { enabled: ctx.request.query.enabled }
Function deleteLayer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static async deleteLayer(ctx) {
const { layerId } = ctx.params;
logger.info(`Delete layer with id ${layerId}`);
let layer = null;
try {
- 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 = (() => {
const loadAPI = (app, path, pathApi) => {
const routesFiles = fs.readdirSync(path);
let existIndexRouter = false;
- 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 createTeamLayer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static async createTeamLayer(ctx) {
logger.info('Create team layer');
const owner = { type: LayerService.type.TEAM, id: ctx.params.teamId };
let team = null;
try {
- 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 patchLayer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static async patchLayer(ctx) {
logger.info('Patch layer by id');
const { layerId } = ctx.params;
const { body } = ctx.request;
let layer = null;
- 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"