jeremydenoun/iprofilesync

View on GitHub

Showing 17 of 24 total issues

Function exports has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function (options) {

    this.name = function(elt, host) {
        var keys, name, n;

Severity: Minor
Found in src/indexer/iterm2.js - About 6 hrs 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 exports has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (options) {

    this.name = function(elt, host) {
        var keys, name, n;

Severity: Major
Found in src/indexer/iterm2.js - About 4 hrs to fix

    Function check has 109 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            SshCheck.prototype.check = function(host, data, callback) {
                data = _.extend(this.options, data);
    
                var errored, f, k, key, port, ports, ran, succeeded, user, users, _i, _j, _len, _len1, _ref, _users, _results;
                if (data.hasOwnProperty('checker_private_key') && data.checker_private_key) {
    Severity: Major
    Found in src/checker/ssh.js - About 4 hrs to fix

      Function override_adapter_list has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      var override_adapter_list = function(rows, options) {
          var i, len, keys, idx;
          // manual list union
          if (options.adapter_manual) {
              rows = _.union(rows, options.adapter_manual);
      Severity: Minor
      Found in src/lib/function.js - About 2 hrs 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 check_nodes has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              SshCheck.prototype.check_nodes = function(hash, callback) {
                  var done, key, _results, data;
      
                  if (hash instanceof Array) {
                      data = hash;
      Severity: Major
      Found in src/checker/ssh.js - About 2 hrs to fix

        Function exports has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (options) {
            this.list = function (callback) {
                shell.config.silent = true;
        
                try {
        Severity: Minor
        Found in src/adapter/aws.js - About 2 hrs to fix

          Function list has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.list = function (callback) {
                  shell.config.silent = true;
          
                  try {
                      AWS.config.update({accessKeyId: options.adapter_aws_access_key_id, secretAccessKey: options.adapter_aws_secret_access_key});
          Severity: Minor
          Found in src/adapter/aws.js - About 1 hr to fix

            Function override_adapter_list has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var override_adapter_list = function(rows, options) {
                var i, len, keys, idx;
                // manual list union
                if (options.adapter_manual) {
                    rows = _.union(rows, options.adapter_manual);
            Severity: Minor
            Found in src/lib/function.js - About 1 hr to fix

              Function guid has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  this.guid = function(elt, host) {
                      var keys, name;
                      var sum = crypto.createHash('sha1');
                      var hex_high_10 = { // set the highest bit and clear the next highest
                          '0': '8',
              Severity: Minor
              Found in src/indexer/iterm2.js - About 1 hr to fix

                Function export_data has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var export_data = function(format, data, target, display_changeset) {
                    var actual;
                
                    if (typeof display_changeset != "undefined" && display_changeset && Fs.existsSync(expandHomedir(target))) {
                        switch (format) {
                Severity: Minor
                Found in src/lib/function.js - About 1 hr to fix

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

                  module.exports = function (options) {
                      this.list = function (callback) {
                          shell.config.silent = true;
                          try {
                              /* Override cmd */
                  Severity: Minor
                  Found in src/adapter/chef_knife.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

                  Avoid deeply nested control flow statements.
                  Open

                                                          if (!sent) {
                                                              callback(err);
                                                          }
                  Severity: Major
                  Found in src/checker/ssh.js - About 45 mins to fix

                    Function exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = function (options) {
                        this.list = function (callback) {
                            shell.config.silent = true;
                    
                            try {
                    Severity: Minor
                    Found in src/adapter/aws.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

                    Avoid deeply nested control flow statements.
                    Open

                                                            if (!sent) {
                                                                callback(new Error("No tentative succeeded"));
                                                            }
                    Severity: Major
                    Found in src/checker/ssh.js - About 45 mins to fix

                      Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function (options) {
                          this.list = function (callback) {
                              shell.config.silent = true;
                      
                              try {
                      Severity: Minor
                      Found in src/adapter/chef.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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function (options) {
                          this.export = function (data, callback) {
                              if (typeof global.config.exporter_format != "undefined")
                                  tools.export_data(global.config.exporter_format, data, expandHomedir(global.config.exporter_path), global.config.exporter_print_diff);
                              if (typeof global.config.exporter_path != "undefined")
                      Severity: Minor
                      Found in src/exporter/default.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 export_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      var export_data = function(format, data, target, display_changeset) {
                          var actual;
                      
                          if (typeof display_changeset != "undefined" && display_changeset && Fs.existsSync(expandHomedir(target))) {
                              switch (format) {
                      Severity: Minor
                      Found in src/lib/function.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