hybridgroup/cylon-nest

View on GitHub
lib/utils.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function setupCommands has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  setupCommands: function(commands, source, target) {
    var self = this;
    commands.forEach(function(command) {

      target[command] = function(val, structureId) {
Severity: Minor
Found in lib/utils.js - About 1 hr to fix

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

          target[command] = function(val, structureId) {
            if (command === "structures") {
              return source;
            }
            var specialCmds = ["structureName", "deviceName"];
    Severity: Minor
    Found in lib/utils.js - About 1 hr to fix

      Avoid too many return statements within this function.
      Open

                    return target.write(self.toSnakeCase(command), val);
      Severity: Major
      Found in lib/utils.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return res;
        Severity: Major
        Found in lib/utils.js - About 30 mins to fix

          There are no issues that match your filters.

          Category
          Status