adamrenklint/asimov.js

View on GitHub

Showing 6 of 6 total issues

Function runSequence has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  'runSequence': function (namespace, data) {

    var self = this;
    var deferred = self.deferred();
    var type = namespace + 's';
Severity: Minor
Found in lib/Sequencer.js - About 1 hr 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 start has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  'start': function (next) {

    var self = this;

    if (self.running) return;
Severity: Minor
Found in lib/Worker.js - About 1 hr to fix

    Function launchCommand has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      'launchCommand': function (command) {
    
        var self = this;
        var paths = [
          process.cwd() + '/lib',
    Severity: Minor
    Found in lib/CommandLineInterface.js - About 1 hr to fix

      Function onMessage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        'onMessage': function (data) {
      
          var self = this;
      
          if (data.event === 'app:started') {
      Severity: Minor
      Found in lib/Master.js - About 1 hr 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 runSequence has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        'runSequence': function (namespace, data) {
      
          var self = this;
          var deferred = self.deferred();
          var type = namespace + 's';
      Severity: Minor
      Found in lib/Sequencer.js - About 1 hr to fix

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

          'config': function (attribute, value) {
        
            var self = this;
            if (!self._config) self._config = {};
        
        
        Severity: Minor
        Found in lib/mixins/Configurable.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

        Severity
        Category
        Status
        Source
        Language