ezpaarse-project/ezpaarse

View on GitHub

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

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

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

        `` has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

          actions: {
            SET_DRAWER ({ commit }, value) {
              commit('SET_DRAWER', value);
            },
            REGISTER (ctx, credentials) {
        Severity: Minor
        Found in client/store/index.js - About 2 hrs to fix

          Function processFiles has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function processFiles(callback) {
                var file = files.shift();
          
                if (!file) { return callback(); }
          
          
          Severity: Major
          Found in lib/bin/ecbulkmaker.js - About 2 hrs to fix

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

              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);
                }
              Severity: Minor
              Found in test/helpers.js - About 2 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 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;
              Severity: Minor
              Found in lib/ecmake.js - About 2 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 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;
              Severity: Major
              Found in lib/bin/ecmaker.js - About 2 hrs to fix

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

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

                    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 () {
                    Severity: Minor
                    Found in lib/outputformats/csv.js - About 2 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 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; }
                    Severity: Minor
                    Found in client/store/settings.js - About 2 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 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');
                    Severity: Major
                    Found in lib/bin/logextractor.js - About 2 hrs to fix

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

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

                          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;
                          Severity: Minor
                          Found in lib/ecfilter.js - About 2 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 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 = {
                          Severity: Major
                          Found in lib/rid-syntax-checker.js - About 2 hrs to fix

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

                              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' +
                              Severity: Major
                              Found in lib/bin/csvtotalizer.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language