Showing 6 of 6 total issues
Function query_set
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
query_set:(options) => {
return new Promise(async (resolve,reject)=>{
try{
if(options.concurrent && options.concurrent === 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
Function _concurrentQuery
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const _concurrentQuery = (options) =>{
return new Promise( async (resolve,reject) =>{
try{
const keyAndQueryMaps = _parseQueries(options);
- 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 query_set
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
query_set:(options) => {
return new Promise(async (resolve,reject)=>{
try{
if(options.concurrent && options.concurrent === true){
Avoid too many return
statements within this function. Open
return reject(finalError);
Function _optionalHeaders
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const _optionalHeaders = (obj, headersHash) =>{
if(obj.exclude_null === true){
headersHash['prefer'] = 'exclude-null-properties';
}
- 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 _fileCheckAndConvert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const _fileCheckAndConvert = async function(filePath){
return new Promise((resolve,reject)=>{
try {
fs.readFile(filePath,(err,data) => {
if(err){
- 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"