Showing 156 of 291 total issues
Function readInputStream
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function readInputStream(source) {
const headers = source.headers || {};
const filename = source.filename || '';
const contentType = headers['content-type'] || source.mimeType || '';
const contentEncoding = headers['content-encoding'] || '';
Function process
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
maker.process = function (callback) {
if (typeof callback !== 'function') { callback = function () {}; }
if (!requestOptions.uri) { requestOptions.uri = uri; }
var sendError = function (message) {
Function extractFrom
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function extractFrom(sourceList, fields, recordList, callback, options) {
if (!Array.isArray(sourceList)) { sourceList = [sourceList]; }
var source = sourceList.pop();
if (!source) {
`` has 24 functions (exceeds 20 allowed). Consider refactoring. Open
actions: {
SET_DRAWER ({ commit }, value) {
commit('SET_DRAWER', value);
},
REGISTER (ctx, credentials) {
Function processFiles
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processFiles(callback) {
var file = files.shift();
if (!file) { return callback(); }
Function logInjector
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.logInjector = function () {
var fs = require('fs-extra');
var request = require('request');
var config = require('../config.js');
Function equals
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
exports.equals = function (x, y, datify) {
if (datify) {
x = exports.datify(x);
y = exports.datify(y);
}
- 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 ecmaker
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function ecmaker() {
var maker = {};
var uri = 'http://127.0.0.1:' + config.EZPAARSE_NODEJS_PORT;
var requestOptions = {};
var resultFile;
- 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 EcMaker
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.EcMaker = function () {
var fs = require('fs-extra');
var path = require('path');
var ecmaker = require('../../lib/ecmake.js');
var outpath;
Function exports
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (logFormat, laxist) {
var usedProperties = [];
var parameters = {
'%h': {property: 'host', regexp: '([a-zA-Z0-9.\\-:]+(?:, ?[a-zA-Z0-9.\\-:]+)*)'},
'%u': {property: 'login', regexp: '([a-zA-Z0-9@.\\-_%,=]+)'},
Function exports
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (logFormat, laxist) {
var usedProperties = [];
var parameters = {
'%h': {property: 'host', regexp: '([a-zA-Z0-9.\\-:]+(?:, ?[a-zA-Z0-9.\\-:]+)*)'},
'%l': {property: 'identd', regexp: '([a-zA-Z0-9\\-]+)'},
Function Writer
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
var Writer = function (outputStream, outputFields) {
var self = this;
outputFields = outputFields || [];
outputStream.on('drain', 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 getHeaders
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function getHeaders (settings) {
if (!settings) { return {}; }
const headers = {};
if (settings.outputFormat) { headers['Accept'] = settings.outputFormat; }
- 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 logExtractor
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.logExtractor = function () {
var Lazy = require('lazy');
var fs = require('fs-extra');
var parser = require('../logparser.js');
Function csvExtractor
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.csvExtractor = function () {
var csvextractor = require('../../lib/csvextractor.js');
var yargs = require('yargs')
.usage('Parse a csv source into json.' +
'\n Usage: $0 [-sc] [-f string | -d string | -k string] [--no-header]')
Function nextPlatform
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function nextPlatform() {
var item = items.shift();
if (!item) { return console.log('\nDone, %d scrapers executed', executed); }
fs.stat(path.join(platformsDir, item), function (err, stat) {
Function isValid
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
exports.isValid = function (ec, job) {
const validCodes = new Set(['200', '304']);
const deniedCodes = new Set(['401', '403']);
const filterRedirs = job.hasOwnProperty('filterRedirs') ? job.filterRedirs : true;
const filterStatus = job.hasOwnProperty('filterStatus') ? job.filterStatus : 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 getISBN
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.getISBN = function (rid) {
var product, rest, calculatedKey;
var isbn = rid.replace(blocSep, '');
var result = {
Function hostLocalize
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.hostLocalize = function () {
var csvextractor = require('../../lib/csvextractor.js');
var hostlocalize = require('../../lib/hostlocalize.js');
require('sugar'); // add more methods to Objects (like merge)
var yargs = require('yargs')
Function csvTotalizer
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.csvTotalizer = function () {
// get the command line argument
// platform
var yargs = require('yargs')
.usage('Totalize fields from a CSV stream\n' +