hybridgroup/cylon

View on GitHub

Showing 20 of 35 total issues

Function work has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  work: function(my) {
    my.keyboard.on("right", my.drone.rightFlip);
    my.keyboard.on("left", my.drone.leftFlip);
    my.keyboard.on("up", my.drone.frontFlip);
    my.keyboard.on("down", my.drone.backFlip);
Severity: Major
Found in examples/leap_ardrone/leap_ardrone.js - About 4 hrs to fix

    Function extend has a Cognitive Complexity of 14 (exceeds 5 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

    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 Robot has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Robot = module.exports = function Robot(opts) {
      Utils.classCallCheck(this, Robot);
    
      opts = opts || {};
    
    
    Severity: Minor
    Found in lib/robot.js - About 1 hr to fix

      Function Robot has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      var Robot = module.exports = function Robot(opts) {
        Utils.classCallCheck(this, Robot);
      
        opts = opts || {};
      
      
      Severity: Minor
      Found in lib/robot.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 work has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        work: function(my) {
          my.keyboard.on("right", my.drone.rightFlip);
          my.keyboard.on("left", my.drone.leftFlip);
          my.keyboard.on("up", my.drone.frontFlip);
          my.keyboard.on("down", my.drone.backFlip);
      Severity: Minor
      Found in examples/leap_ardrone/leap_ardrone.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 work has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        work: function(my) {
          var max = 0;
          var changingColor = false;
      
          my.sphero.setDataStreaming(["velocity"], { n: 40, m: 1, pcnt: 0 });
      Severity: Minor
      Found in examples/sphero_shakeometer/sphero_shakeometer.js - About 1 hr to fix

        Function install has 35 lines of code (exceeds 25 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 1 hr to fix

          Function Initializer has 33 lines of code (exceeds 25 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 1 hr to fix

            Function start has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Robot.prototype.start = function(callback) {
              if (this.running) {
                return this;
              }
            
            
            Severity: Minor
            Found in lib/robot.js - About 1 hr to fix

              Function create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              api.create = function create(Server, opts) {
                // if only passed options (or nothing), assume HTTP server
                if (Server == null || _.isObject(Server) && !_.isFunction(Server)) {
                  opts = Server;
                  Server = "http";
              Severity: Minor
              Found in lib/api.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 reduce has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              function reduce(collection, iteratee, accumulator, thisVal) {
                var isArray = H.isArray(collection);
              
                if (!isArray && !H.isObjectLoose(collection)) {
                  return null;
              Severity: Minor
              Found in lib/utils/helpers.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 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

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

                  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