Showing 181 of 353 total issues
Function createParams
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function createParams(model, docs, paths, options, lean) {
Function getEntityQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getEntityQuery(model, req) {
logger.silly('Getting Entity Query');
if (req.query.id) {
return queryId(model, req.query.id);
} else if (req.query.team) {
- 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 fillBeendeteSpieleWithEmpty
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function fillBeendeteSpieleWithEmpty(beendeteSpiele) {
const maxNr = _.maxBy(beendeteSpiele, 'nummer');
if (maxNr && maxNr.nummer !== beendeteSpiele.length) {
const arr = [];
for (let i = 1; i <= maxNr.nummer; i++) {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function () {
const logger = require('winston').loggers.get('api');
function send(obj, res) {
let level = 'warn';
if (obj.STATUSCODE < 400) {
- 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 spiel.teamA || spiel.teamB || spiel.fromA || spiel.fromB;
Avoid too many return
statements within this function. Open
return event;
Avoid too many return
statements within this function. Open
return game['team' + teamStr + 'Label'];
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return routeconfig.split(' ');
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return queryIdentifier(model, req.query.identifier);
Avoid too many return
statements within this function. Open
return {
dailyStartTime: dailyStartTime,
dailyEndTime: dailyEndTime,
spielePerDay: spielePerDay,
offsetDays: offsetDays,
Avoid too many return
statements within this function. Open
return querySlug(model, req.query.slug);
Avoid too many return
statements within this function. Open
return {
searchById: false,
query: model.find({})
}
Avoid too many return
statements within this function. Open
return routeconfig;
Avoid too many return
statements within this function. Open
return queryDate(model, req.query.date);
Function calcSortForHalbFinale
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function calcSortForHalbFinale(a, b) {
if (a.label === spielLabels.HALBFINALE && a.label !== b.label) {
return b.rankA >= 3 ? 1 : -1;
} else if (b.label === spielLabels.HALBFINALE && a.label !== b.label) {
return a.rankA >= 3 ? -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
Function sortEndrundeSpiele
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function sortEndrundeSpiele(a, b) {
if (a.label === spielLabels.ZWISCHENRUNDENSPIEL || b.label === spielLabels.ZWISCHENRUNDENSPIEL) {
return calcSortForZwischenrunde(a, b);
}
if (a.label === spielLabels.FINALE || b.label === spielLabels.FINALE) {
- 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"