Showing 156 of 291 total issues
Avoid too many return
statements within this function. Open
if (!req.body.jobID) { return sendMail(); }
Avoid too many return
statements within this function. Open
if (!exports.equals(x[p], y[p], datify)) { return false; }
Avoid too many return
statements within this function. Open
return sendError(util.format('The process seems to have ended prematurely, please see %s',
report.general['URL-Traces']));
Avoid too many return
statements within this function. Open
if (!reportFile) { return callback(); }
Avoid too many return
statements within this function. Open
return { valid: true };
Avoid too many return
statements within this function. Open
return {
valid: false,
reason: `Ignored HTTP status code: ${ec.status}`
};
Function clean
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.clean = function () {
const yargs = require('yargs')
.usage('Clean knowledge bases.' +
'\n Usage: $0 [-nvp] [DIR_TO_CLEAN]')
.boolean(['n', 'v'])
- 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 isQualified
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.isQualified = function (ec) {
let level = 0;
for (const field in qualifyingFactors) {
if (ec[field]) {
level += qualifyingFactors[field];
- 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 updateFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ReportManager.prototype.updateFile = function (callback, noWait) {
var self = this;
if (noWait) {
if (typeof callback === 'function') {
- 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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (req, res, job, next) {
job.logger?.verbose('Initializing charsets');
var reqCharset = req.header('request-charset') || 'utf-8';
var resCharset = req.header('response-charset') || 'utf-8';
- 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 compute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ReportManager.prototype.compute = function () {
var nbRejects = this.get('rejets', 'nb-lines-unknown-formats');
nbRejects += this.get('rejets', 'nb-lines-unknown-domains');
nbRejects += this.get('rejets', 'nb-lines-unqualified-ecs');
nbRejects += this.get('rejets', 'nb-lines-unknown-errors');
- 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 connectToMongo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function connectToMongo () {
try {
await mongo.connect(config.EZPAARSE_MONGO_URL);
} catch (err) {
logger.error(`Cannot connect to MongoDB at ${config.EZPAARSE_MONGO_URL}`);
- 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 resolve
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.resolve = function (host, job, cb) {
var r = {};
if (typeof job == 'function') { cb = job; job = null; }
if (!job) { job = {}; }
- 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 get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ReportManager.prototype.get = function (group, entry) {
if (arguments.length == 1) {
entry = group;
group = false;
}
- 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 checkMongodb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function checkMongodb() {
try {
await mongo.connect(config.EZPAARSE_MONGO_URL, { serverSelectionTimeoutMS: 5000 });
} catch (err) {
errorMessage(`Cannot connect to ${config.EZPAARSE_MONGO_URL}`);
- 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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.validate = function (file, callback) {
var titleIDs = {}; // List of title IDs
var titleIdColumn = false;
var syntaxError = false;
var currentLine = 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"