ezpaarse-project/ezpaarse

View on GitHub

Showing 291 of 291 total issues

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.\\-:]+)*)'},
          '%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 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 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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            if (noWait) {
              if (typeof callback === 'function') {
                self.writeCallbacks.push(callback);
              }
              clearTimeout(self.writeTimeout);
          Severity: Major
          Found in lib/reportmanager.js and 1 other location - About 3 hrs to fix
          lib/reportmanager.js on lines 106..116

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 97.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            if (noWait) {
              if (typeof callback === 'function') {
                self.updateCallbacks.push(callback);
              }
              clearTimeout(self.updateTimeout);
          Severity: Major
          Found in lib/reportmanager.js and 1 other location - About 3 hrs to fix
          lib/reportmanager.js on lines 144..154

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 97.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

            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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                      describe('a basic log file with a user-field header group missing SRC', () => {
                        it('should have closed all the used file descriptors (@05)', (done) => {
                          const log = path.resolve(__dirname, '/dataset/user-multi-plus.log');
                          const headers = {
                            'Accept'                     : 'application/json',
                    Severity: Major
                    Found in test/lsof-test.js and 1 other location - About 2 hrs to fix
                    test/lsof-test.js on lines 56..67

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 88.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                      describe('a basic log file with a user-field header group missing SEP', () => {
                        it('should have closed all the used file descriptors (@06)', (done) => {
                          const log = path.resolve(__dirname, '/dataset/user-multi-plus.log');
                          const headers = {
                            'Accept'                     : 'application/json',
                    Severity: Major
                    Found in test/lsof-test.js and 1 other location - About 2 hrs to fix
                    test/lsof-test.js on lines 43..54

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 88.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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

                        Severity
                        Category
                        Status
                        Source
                        Language