Showing 59 of 92 total issues
Avoid deeply nested control flow statements. Open
if (el[name]) {
target[currentSelectElement.alias] = el[name];
}
Avoid deeply nested control flow statements. Open
if (exists) {
node.value = exists.value;
}
Avoid deeply nested control flow statements. Open
if (mapping[node.value] && mapping[node.value].type === 'text') {
node.value = `${node.value}.keyword`;
}
Avoid deeply nested control flow statements. Open
if (el[name]) {
target[currentSelectElement.alias] = el[name];
}
Avoid deeply nested control flow statements. Open
for (let j = 0; j < node.arguments.length; j += 1) {
if (node.arguments[j].type === 'literal' && mapping[node.arguments[j].value] && mapping[node.arguments[j].value].type === 'text') {
node.arguments[j].value = `${node.arguments[j].value}.keyword`;
}
}
Avoid deeply nested control flow statements. Open
if (node.arguments[j].type === 'literal' && mapping[node.arguments[j].value] && mapping[node.arguments[j].value].type === 'text') {
node.arguments[j].value = `${node.arguments[j].value}.keyword`;
}
Avoid deeply nested control flow statements. Open
if (buckets[i][keys[j]].value) {
obj[keys[j]] = buckets[i][keys[j]].value;
}
Consider simplifying this complex logical expression. Open
if (this.resultScroll.aggregations) {
const data = Scroll.serialize(this.resultScroll, this.parsed, this.format);
this.stream.write(this.convertDataToDownload(data, this.format, true, false, this.cloneUrl), 'binary');
} else {
this.first = true;
Function query
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static async query(ctx) {
logger.info('Do Query with dataset', ctx.request.body);
logger.debug('Checking if is delete or select');
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 containApps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const containApps = (apps1, apps2) => {
if (!apps1 || !apps2) {
return false;
}
for (let i = 0, { length } = apps1; i < length; i += 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 containApps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const containApps = (apps1, apps2) => {
if (!apps1 || !apps2) {
return false;
}
for (let i = 0, { length } = apps1; i < length; i += 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
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return right;
Avoid too many return
statements within this function. Open
return {
data: data.hits.hits.map((el) => {
// eslint-disable-next-line no-underscore-dangle
const formatted = CSVSerializer.formatAlias(Object.assign(el._source, {
_id: el._id
Avoid too many return
statements within this function. Open
return {
data: data.hits.hits.map((el) => {
// eslint-disable-next-line no-underscore-dangle
const formatted = JSONSerializer.formatAlias(Object.assign(el._source, {
_id: el._id
Avoid too many return
statements within this function. Open
return left;
Function sendMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async sendMessage(msg, retryOnChannelClosed = true) {
logger.info(`Sending message to ${this.q}`, msg);
try {
// Sending to queue
await this.isInit;
- 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"