hybridgroup/cylon-intel-iot-analytics

View on GitHub

Showing 7 of 31 total issues

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

  work: function(my) {
    var data = [
      {
        componentId: "arduino-uno-id1-dist.v1.0",
        on: Date.now() - 120,
Severity: Minor
Found in examples/data/intel-submit-data.js - About 1 hr to fix

    Function _rest has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    Adaptor.prototype._rest = function(verb, path, data, query, callback, token) {
    Severity: Minor
    Found in lib/adaptor.js - About 45 mins to fix

      Function addComponent has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      Adaptor.prototype.addComponent = function(aId, dId, dToken, com, callback) {
      Severity: Minor
      Found in lib/adaptor.js - About 35 mins to fix

        Function addComponent has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        Driver.prototype.addComponent = function(aId, dId, token, component, callback) {
        Severity: Minor
        Found in lib/driver.js - About 35 mins to fix

          Function submitData has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          Driver.prototype.submitData = function(aId, dId, token, data, callback) {
          Severity: Minor
          Found in lib/driver.js - About 35 mins to fix

            Function submitData has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            Adaptor.prototype.submitData = function(aId, dId, dToken, data, callback) {
            Severity: Minor
            Found in lib/adaptor.js - About 35 mins to fix

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

              Adaptor.prototype._defCb = function(callback) {
                return function(result) {
                  if (typeof callback === "function") {
                    if (result instanceof Error) {
                      return callback(result, null);
              Severity: Minor
              Found in lib/adaptor.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