Showing 48 of 77 total issues
Function parseBaseURL
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function parseBaseURL (_url, options = {}) {
let host = _url.replace(/\/+$/, '')
const hostParts = host.split('/')
let index
const indexParts = (options.index || '').split('/').filter(Boolean)
- 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 log
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
log (type, message) {
if (type === 'debug') {
if (this.options.debug === true) {
message = `${new Date().toUTCString()} [debug] | ${message}`
console.log(message)
- 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 initAws
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const initAws = (options) => {
AWS.config.update({
accessKeyId: options.s3AccessKeyId,
secretAccessKey: options.s3SecretAccessKey,
sslEnabled: options.s3SSLEnabled,
- 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 callback(err, hits)
Avoid too many return
statements within this function. Open
return scrollResultSet(self, callback)
Function anonymize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function anonymize (thing, options = {}) {
if (
thing === null ||
thing instanceof Date
) {
- 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 _reviver
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const _reviver = (bigIntFields = {}) => (key, value) => {
if (!_.isEmpty(bigIntFields) && !bigIntFields[key]) {
return value
}
if (value && value.isLosslessNumber) {
- 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 _replacer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const _replacer = (bigIntFields = {}) => (key, value) => {
if (!_.isEmpty(bigIntFields) && !bigIntFields[key]) {
return value
}
- 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"