ezpaarse-project/ezpaarse

View on GitHub

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) {
Severity: Major
Found in lib/lineprocessor.js - About 4 hrs to fix

    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]+)'},
    Severity: Minor
    Found in lib/proxyformats/squid.js - About 3 hrs to fix

    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) {
    Severity: Major
    Found in lib/pkb-cleaner.js - About 3 hrs to fix

      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');
      Severity: Major
      Found in lib/bin/loganonymizer.js - About 3 hrs to fix

        Function pkbManager has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function pkbManager() {
          var knowledge = {};
        
          return {
            /**
        Severity: Major
        Found in lib/pkbmanager.js - About 3 hrs to fix

          Function logFaker has 91 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.logFaker = function (params, callback) {
          
            if (!params) { params = {}; }
          
            var platforms = [];
          Severity: Major
          Found in lib/logfaker.js - About 3 hrs to fix

            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 () {
            Severity: Minor
            Found in lib/outputformats/tsv.js - About 3 hrs to fix

            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;
            
            
            Severity: Minor
            Found in routes/info.js - About 3 hrs to fix

            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));
            
            
            Severity: Major
            Found in client/store/settings.js - About 3 hrs to fix

              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');
              Severity: Minor
              Found in lib/job/init.js - About 3 hrs to fix

                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;
                Severity: Major
                Found in lib/ecmake.js - About 3 hrs to fix

                  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;
                  Severity: Minor
                  Found in lib/init/init-writer.js - About 3 hrs to fix

                  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] ...')
                  Severity: Major
                  Found in lib/bin/scrape.js - About 3 hrs to fix

                    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];
                    
                    
                    Severity: Major
                    Found in lib/pkbmanager.js - About 3 hrs to fix

                      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@.\\-_%,=]+)'},
                      Severity: Minor
                      Found in lib/proxyformats/ezproxy.js - About 3 hrs to fix

                      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\\-]+)'},
                      Severity: Minor
                      Found in lib/proxyformats/apache.js - About 3 hrs to fix

                      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]+)'},
                      Severity: Major
                      Found in lib/proxyformats/squid.js - About 3 hrs to fix

                        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'])
                        Severity: Major
                        Found in lib/bin/pkb-cleaner.js - About 3 hrs to fix

                          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));
                          
                          
                          Severity: Minor
                          Found in client/store/settings.js - About 3 hrs to fix

                          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';
                          
                          
                          Severity: Minor
                          Found in client/store/settings.js - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language