Function _buildDataPoints
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private static _buildDataPoints(results, timeIndex, metricIndex, valueIndexes) {
const data = [];
let targetName = '';
let metricName = '';
let 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 _handleRecordFields
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private static _handleRecordFields(results, res) {
for (const fl of results) {
if (fl.type === 'RECORD') {
for (const f of fl.fields) {
if (f.type !== 'RECORD') {
- 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 transformAnnotationResponse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public transformAnnotationResponse(options, data) {
const table = data.data;
let timeColumnIndex = -1;
let textColumnIndex = -1;
let tagsColumnIndex = -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 parseTableFields
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static parseTableFields(results, filter): IResultFormat[] {
const fields: IResultFormat[] = [];
if (!results || results.length === 0) {
return fields;
}
- 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 deeply nested control flow statements. Open
for (const ff of f.fields) {
ff.name = fl.name + '.' + f.name + '.' + ff.name;
}
Function _toTimeSeries
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static _toTimeSeries(results) {
let timeIndex = -1;
let metricIndex = -1;
const valueIndexes = [];
for (let i = 0; i < results.schema.fields.length; 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 parseData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static parseData(results, text, value): IResultFormat[] {
const data: IResultFormat[] = [];
if (!results || results.length === 0) {
return 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 _handelWildCardTables
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private _handelWildCardTables(tables) {
let sorted = new Map();
let newTables = [];
for (const t of tables) {
const partitioned = t.text.indexOf('__partitioned');
- 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"