Showing 156 of 291 total issues
Function logParser
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function logParser(options) {
options = options || {};
options.dateFormat = options.dateFormat || 'DD/MMM/YYYY:HH:mm:ss Z';
var parser = {};
- 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 init
has 295 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function* init(req, res, options) {
const self = this;
const jobID = this.jobID;
const logPath = path.resolve(tmpDir, jobID.charAt(0), jobID.charAt(1), jobID);
const predefKey = req.get('ezPAARSE-Predefined-Settings');
Function init
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function* init(req, res, options) {
const self = this;
const jobID = this.jobID;
const logPath = path.resolve(tmpDir, jobID.charAt(0), jobID.charAt(1), jobID);
const predefKey = req.get('ezPAARSE-Predefined-Settings');
- 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 Job
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
function Job(req, res, jobID, options) {
const self = ezJobs[jobID] = this;
req._jobID = jobID;
io().in('admin').emit('jobs', Object.keys(ezJobs));
- 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 214 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function () {
var currentCompletion;
var possibleFields = {};
var rl = readline.createInterface({
Function LinesProcessor
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
const LinesProcessor = function (job) {
let ecNumber = 0;
let nbBadLines = 0;
let firstLine = true;
const emit = this.emit.bind(this);
- 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 LinesProcessor
has 204 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LinesProcessor = function (job) {
let ecNumber = 0;
let nbBadLines = 0;
let firstLine = true;
const emit = this.emit.bind(this);
Function ridChecker
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
var ridChecker = function () {
var self = this;
var DoNotCheckPattern = new RegExp('^#');
var ISSNPattern = new RegExp('[0-9]{4}\\-[0-9]{3}([0-9Xx])?');
var ISBNPattern = new RegExp('((978[-– ])?[0-9][0-9-– ]{10}[-– ][0-9xX])|((978)?[0-9]{9}[0-9])');
- 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 Job
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Job(req, res, jobID, options) {
const self = ezJobs[jobID] = this;
req._jobID = jobID;
io().in('admin').emit('jobs', Object.keys(ezJobs));
Function EcBulkMaker
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.EcBulkMaker = function () {
var yargs = require('yargs')
.usage('Inject files to ezPAARSE (for batch purpose)' +
'\n Usage: $0 [-rflvH] SOURCE_DIR [RESULT_DIR]')
File info.js
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
// ##EZPAARSE
'use strict';
const fs = require('fs-extra');
Function read
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function* read(req, res) {
const self = this;
this.logger?.info('Starting response');
File admin.js
has 416 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const fs = require('fs');
const path = require('path');
const Boom = require('boom');
Function ridChecker
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ridChecker = function () {
var self = this;
var DoNotCheckPattern = new RegExp('^#');
var ISSNPattern = new RegExp('[0-9]{4}\\-[0-9]{3}([0-9Xx])?');
var ISBNPattern = new RegExp('((978[-– ])?[0-9][0-9-– ]{10}[-– ][0-9xX])|((978)?[0-9]{9}[0-9])');
Function validate
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.validate = function (file, callback) {
var titleIDs = {}; // List of title IDs
var titleIdColumn = false;
var syntaxError = false;
var currentLine = 1;
File job-logs-test.js
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint no-sync: 0 */
/* global describe, it */
'use strict';
var fs = require('fs');
Function logParser
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function logParser(options) {
options = options || {};
options.dateFormat = options.dateFormat || 'DD/MMM/YYYY:HH:mm:ss Z';
var parser = {};
Function exports
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (req, res, job, next) {
job.logger?.verbose('Initializing EC writer');
var acceptEncoding = req.header('response-encoding');
var zip;
Function pkbValidator
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.pkbValidator = function () {
var yargs = require('yargs')
.usage('Check a platform knowledge base file.' +
'\n Usage: $0 [-csvw] pkb_file1.txt [pkb_file2.txt]')
.boolean(['c', 's', 'v', 'w'])
Function pkbValidator
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
exports.pkbValidator = function () {
var yargs = require('yargs')
.usage('Check a platform knowledge base file.' +
'\n Usage: $0 [-csvw] pkb_file1.txt [pkb_file2.txt]')
.boolean(['c', 's', 'v', 'w'])
- 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"