hybridgroup/cylon

View on GitHub

Showing 35 of 35 total issues

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

  register: function(module) {
    if (this.data[module]) {
      return this.data[module].module;
    }

Severity: Minor
Found in lib/registry.js - About 1 hr to fix

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

    function extend(base, source) {
      var isArray = Array.isArray(source);
    
      if (base == null) {
        base = isArray ? [] : {};
    Severity: Minor
    Found in lib/utils/helpers.js - About 1 hr to fix

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

        var starters = _.map(this.connections, function(conn) {
          return function(cb) {
            return this.startConnection(conn, cb);
          }.bind(this);
        }, this);
      Severity: Major
      Found in lib/robot.js and 1 other location - About 1 hr to fix
      lib/robot.js on lines 337..341

      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 56.

      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

        var starters = _.map(this.devices, function(device) {
          return function(cb) {
            return this.startDevice(device, cb);
          }.bind(this);
        }, this);
      Severity: Major
      Found in lib/robot.js and 1 other location - About 1 hr to fix
      lib/robot.js on lines 288..292

      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 56.

      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 parallel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      function parallel(functions, done) {
        var total = functions.length,
            completed = 0,
            results = [],
            error;
      Severity: Minor
      Found in lib/utils/helpers.js - About 55 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 register has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        register: function(module) {
          if (this.data[module]) {
            return this.data[module].module;
          }
      
      
      Severity: Minor
      Found in lib/registry.js - About 45 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 install has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports.install = function() {
        /**
         * Multiplies a number by 60000 to convert minutes
         * to milliseconds
         *
      Severity: Minor
      Found in lib/utils/monkey-patches.js - About 45 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

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

      Adaptor.prototype.disconnect = function() {
        var message = formatErrorMessage(
          this.name,
          "Adaptor#disconnect method must be overwritten by descendant classes."
        );
      Severity: Major
      Found in lib/adaptor.js and 3 other locations - About 35 mins to fix
      lib/adaptor.js on lines 54..61
      lib/driver.js on lines 58..65
      lib/driver.js on lines 73..80

      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 47.

      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 4 locations. Consider refactoring.
      Open

      Driver.prototype.halt = function() {
        var message = formatErrorMessage(
          this.name,
          "Driver#halt method must be overwritten by descendant classes."
        );
      Severity: Major
      Found in lib/driver.js and 3 other locations - About 35 mins to fix
      lib/adaptor.js on lines 54..61
      lib/adaptor.js on lines 69..76
      lib/driver.js on lines 58..65

      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 47.

      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 4 locations. Consider refactoring.
      Open

      Adaptor.prototype.connect = function() {
        var message = formatErrorMessage(
          this.name,
          "Adaptor#connect method must be overwritten by descendant classes."
        );
      Severity: Major
      Found in lib/adaptor.js and 3 other locations - About 35 mins to fix
      lib/adaptor.js on lines 69..76
      lib/driver.js on lines 58..65
      lib/driver.js on lines 73..80

      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 47.

      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 4 locations. Consider refactoring.
      Open

      Driver.prototype.start = function() {
        var message = formatErrorMessage(
          this.name,
          "Driver#start method must be overwritten by descendant classes."
        );
      Severity: Major
      Found in lib/driver.js and 3 other locations - About 35 mins to fix
      lib/adaptor.js on lines 54..61
      lib/adaptor.js on lines 69..76
      lib/driver.js on lines 73..80

      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 47.

      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 device has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      Robot.prototype.device = function(name, device) {
        var str;
      
        device.robot = this;
        device.name = name;
      Severity: Minor
      Found in lib/robot.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 search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        search: function(entry, value) {
          for (var name in this.data) {
            if (this.data.hasOwnProperty(name)) {
              var repo = this.data[name];
      
      
      Severity: Minor
      Found in lib/registry.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 series has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function series(functions, done) {
        var results = [],
            error;
      
        if (typeof done !== "function") { done = function() {}; }
      Severity: Minor
      Found in lib/utils/helpers.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 Initializer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function Initializer(type, opts) {
        var mod;
      
        mod = Registry.findBy(type, opts[type]);
      
      
      Severity: Minor
      Found in lib/initializer.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