Showing 6 of 6 total issues
Function query
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
async query(query) {
const config = { ...this.config };
let initiateQueryInAthena = true;
- 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
File helpers.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
//helpers.js
const readline = require("readline"),
csv = require("csvtojson");
Function getQueryResultsFromS3
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async function getQueryResultsFromS3(params) {
const s3Params = {
Bucket: params.s3Output.split("/")[2],
Key: params.s3Output.split("/").slice(3).join("/"),
};
- 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 addDataType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function addDataType(input, dataTypes) {
let updatedObjectWithDataType = {};
for (const key in input) {
if (!input[key]) {
- 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 { items: await getRawResultsFromS3(input) };
Function cleanUpPaginatedDML
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function cleanUpPaginatedDML(queryResults, paginationFactor) {
const dataTypes = await getDataTypes();
const columnNames = Object.keys(dataTypes).reverse();
let rowObject = {};
let unformattedS3RowArray = 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"