Showing 156 of 291 total issues
Function processLine
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.push = function processLine(line) {
let isObjectSource = (typeof line === 'object');
let ec;
if (isObjectSource) {
Function exports
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (logFormat, laxist) {
var usedProperties = [];
var parameters = {
'ts': {property: 'timestamp', regexp: '([0-9]+)'},
'tu': {property: 'subsecond', regexp: '([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 exports
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (options) {
options = options || {};
let dir;
if (options.platform) {
Function logAnonymizer
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.logAnonymizer = function () {
var Lazy = require('lazy');
var faker = require('@faker-js/faker').faker;
var fs = require('fs-extra');
Function pkbManager
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pkbManager() {
var knowledge = {};
return {
/**
Function logFaker
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.logFaker = function (params, callback) {
if (!params) { params = {}; }
var platforms = [];
Function Writer
has a Cognitive Complexity of 25 (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 getMiddlewaresData
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
async function getMiddlewaresData() {
const middlewaresFolder = path.resolve(__dirname, '../middlewares');
const result = await dbConfig.getConfig('middlewares');
const savedMiddlewares = result && result.data;
- 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 parseSettings
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseSettings (predefined) {
if (!predefined || !predefined.headers) { return null; }
const settings = JSON.parse(JSON.stringify(defaultSettings));
File init.js
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const fs = require('fs-extra');
const path = require('path');
const winston = require('winston');
Function ecmaker
has 87 lines of code (exceeds 25 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;
Function exports
has a Cognitive Complexity of 24 (exceeds 5 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;
- 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 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function () {
var yargs = require('yargs')
.usage('Execute the scrapers of one or more platforms' +
'\nUsage: $0 [-alvfc] [Platform] [Platform] ...')
Function pkbRequestQueue
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
pkbRequestQueue: async.queue(function (task, queueCallback) {
var platform = task.platform;
var callback = task.callback;
var pkb = knowledge[platform];
Function exports
has a Cognitive Complexity of 23 (exceeds 5 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@.\\-_%,=]+)'},
- 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 23 (exceeds 5 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\\-]+)'},
- 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 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (logFormat, laxist) {
var usedProperties = [];
var parameters = {
'ts': {property: 'timestamp', regexp: '([0-9]+)'},
'tu': {property: 'subsecond', regexp: '([0-9]+)'},
Function clean
has 80 lines of code (exceeds 25 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'])
Function parseSettings
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function parseSettings (predefined) {
if (!predefined || !predefined.headers) { return null; }
const settings = JSON.parse(JSON.stringify(defaultSettings));
- 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
File settings.js
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
// eslint-disable-next-line import/no-extraneous-dependencies
import Vue from 'vue';
import { isEqual } from 'lodash';
import api from './api';