korczis/microcrawler

View on GitHub

Showing 20 of 62 total issues

Function Collector has 116 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Collector = function () {
  function Collector() {
    _classCallCheck(this, Collector);

    this._couchbase = new _couchbase2.default();
Severity: Major
Found in lib/collector/collector.js - About 4 hrs to fix

    Function Couchbase has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Couchbase = function () {
      function Couchbase() {
        _classCallCheck(this, Couchbase);
    
        this._client = null;
    Severity: Major
    Found in lib/couchbase/couchbase.js - About 3 hrs to fix

      Function Worker has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Worker = function () {
        function Worker() {
          _classCallCheck(this, Worker);
      
          this.processors = {};
      Severity: Major
      Found in lib/worker/worker.js - About 3 hrs to fix

        Function App has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var App = function () {
          function App() {
            _classCallCheck(this, App);
          }
        
        
        Severity: Minor
        Found in lib/app/app.js - About 1 hr to fix

          Function Config has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var Config = function () {
            function Config() {
              _classCallCheck(this, Config);
            }
          
          
          Severity: Minor
          Found in lib/config/config.js - About 1 hr to fix

            Function loadProcessors has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function loadProcessors() {
              return new Promise(function (resolve, reject) {
                var dir = _path2.default.join(__dirname, '..', '..', 'node_modules');
                _fs2.default.readdir(dir, function (err, items) {
                  if (err) {
            Severity: Minor
            Found in lib/helper/index.js - About 1 hr to fix

              Function loadProcessors has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function loadProcessors() {
                return new Promise((resolve, reject) => {
                  const dir = path.join(__dirname, '..', '..', 'node_modules');
                  fs.readdir(dir, (err, items) => {
                    if (err) {
              Severity: Minor
              Found in src/helper/index.js - About 1 hr to fix

                Function requestSuperagent has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function requestSuperagent(url, retryNo = 0) {
                  return new Promise((resolve, reject) => {
                    let req = superagent
                      .get(url)
                      .timeout(config.timeout)
                Severity: Minor
                Found in src/helper/request.js - About 1 hr to fix

                  Function requestSuperagent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function requestSuperagent(url) {
                    var retryNo = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
                  
                    return new Promise(function (resolve, reject) {
                      var req = _superagentUse2.default.get(url).timeout(_config.config.timeout).retry(_config.config.retry.count).redirects(5);
                  Severity: Minor
                  Found in lib/helper/request.js - About 1 hr to fix

                    Function crawl has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      crawl(args = process.argv) {
                        program
                          .version(pkg.version)
                          .parse(args);
                    
                    
                    Severity: Minor
                    Found in src/app/app.js - About 1 hr to fix

                      Function crawl has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          value: function crawl() {
                            var args = arguments.length <= 0 || arguments[0] === undefined ? process.argv : arguments[0];
                      
                            _commander2.default.version(_package2.default.version).parse(args);
                      
                      
                      Severity: Minor
                      Found in lib/app/app.js - About 1 hr to fix

                        Function run has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            value: function run(channel) {
                              var _this3 = this;
                        
                              channel.assertQueue(_config.config.amqp.queues.collector, {
                                durable: true
                        Severity: Minor
                        Found in lib/collector/collector.js - About 1 hr to fix

                          Function Config has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var Config = function () {
                            function Config() {
                              _classCallCheck(this, Config);
                            }
                          
                          
                          Severity: Minor
                          Found in lib/config/config.js - About 35 mins 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 _createClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Copyright, 2013-2016, by Tomas Korcak. <korczis@gmail.com>
                          Severity: Minor
                          Found in lib/exporter/exporter.js - About 25 mins 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 _createClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Copyright, 2013-2016, by Tomas Korcak. <korczis@gmail.com>
                          Severity: Minor
                          Found in lib/app/app.js - About 25 mins 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 _createClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Copyright, 2013-2016, by Tomas Korcak. <korczis@gmail.com>
                          Severity: Minor
                          Found in lib/config/config.js - About 25 mins 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 _createClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Copyright, 2013-2016, by Tomas Korcak. <korczis@gmail.com>
                          Severity: Minor
                          Found in lib/collector/collector.js - About 25 mins 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 _createClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Copyright, 2013-2016, by Tomas Korcak. <korczis@gmail.com>
                          Severity: Minor
                          Found in lib/couchbase/couchbase.js - About 25 mins 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 _createClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Copyright, 2013-2016, by Tomas Korcak. <korczis@gmail.com>
                          Severity: Minor
                          Found in lib/elasticsearch/elasticsearch.js - About 25 mins 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 _createClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Copyright, 2013-2016, by Tomas Korcak. <korczis@gmail.com>
                          Severity: Minor
                          Found in lib/worker/worker.js - About 25 mins 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