azukiapp/azk

View on GitHub

Showing 135 of 207 total issues

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

  _wait_available(system, port_data, container, timeout, options, image_conf) {
    return async(this, function* () {
      var host;
      if (config('agent:requires_vm')) {
        host = config('agent:vm:ip');
Severity: Minor
Found in src/system/run.js - About 1 hr to fix

    Function list has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      list(cli) {
        let key_param  = cli['config-key'];
        let configList = this.configuration.listAll();
    
        if (key_param) {
    Severity: Minor
    Found in src/cmds/config.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 handler has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function handler(error, options = {}) {
      return async(this, function* () {
        let isError = error instanceof Error || error instanceof AzkError;
        if (!isError) {
          // no error type
    Severity: Minor
    Found in src/cli/error_handler.js - About 1 hr to fix

      Function constructor has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        constructor(opts) {
          this.opts = _.merge({
            namespace: config('configuration:namespace'),
          }, opts);
      
      
      Severity: Minor
      Found in src/configuration/index.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 sync has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        static sync(origin, destination, opts = {}) {
          return stat(origin).then((stats) => {
            let args = ['-az'];
            let include = [], exclude = [];
            let DIR_SEP = '';
      Severity: Minor
      Found in src/sync/index.js - About 1 hr to fix

        Function startProject has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          startProject(command_parse_result) {
            return async(this, function* () {
              var force_azk_start_url_endpoint = config('urls:force:endpoints:start');
              this._sendForceAzkStart(command_parse_result, force_azk_start_url_endpoint);
        
        
        Severity: Minor
        Found in src/manifest/get_project.js - About 1 hr to fix

          Function config_disks has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function config_disks(name, boot, data) {
            var use_link = true;
          
            var storage_opts = [
              "storagectl"   , name  ,
          Severity: Minor
          Found in src/agent/vm.js - About 1 hr to fix

            Function init has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              init(opts = {}) {
                opts = _.defaults(opts, {
                  dhcp: false,
                });
            
            
            Severity: Minor
            Found in src/agent/vm.js - About 1 hr to fix

              Function _investigate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _investigate(dir) {
                  return async(this, function* () {
                    var evidences = [],
                        filesToSearch = [],
                        relevantFiles = [],
              Severity: Minor
              Found in src/generator/court.js - About 1 hr to fix

                Function _checkAzkVersion has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _checkAzkVersion() {
                    return async(this, function* () {
                      try {
                        // check connectivity
                        var currentOnline = yield net.isOnlineCheck();
                Severity: Minor
                Found in src/agent/configure.js - About 1 hr to fix

                  Function _mounts_to_volumes has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _mounts_to_volumes(mounts, daemon = true) {
                      var volumes = {};
                  
                      // persistent folder
                      var persist_base = config('paths:persistent_folders');
                  Severity: Minor
                  Found in src/system/index.js - About 1 hr to fix

                    Function scale has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      scale(system, instances = {}, options = {}) {
                        // Default instances
                        if (_.isObject(instances)) {
                          options   = _.merge(instances, options);
                          instances = system.scalable.default;
                    Severity: Minor
                    Found in src/system/scale.js - About 1 hr to fix

                      Function runProvision has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        runProvision(system, options = {}) {
                          return async(this, function* () {
                            var steps = system.provision_steps;
                      
                            options = _.clone(options);
                      Severity: Minor
                      Found in src/system/run.js - About 1 hr to fix

                        Function _clean_sync_folder has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          _clean_sync_folder(system, syncs) {
                            return async(this, function* () {
                              var local_user = config('agent:vm:user');
                              var uid, gid;
                              if (config('agent:requires_vm')) {
                        Severity: Minor
                        Found in src/system/run.js - About 1 hr to fix

                          Function init has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            init() {
                              return defer((resolve, reject) => {
                                if (this._status === 'connecting' || this._status === 'connected') {
                                  return resolve();
                                }
                          Severity: Minor
                          Found in src/agent/client.js - About 1 hr to fix

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

                              start(manifest, systems, opts) {
                                return async(this, function* () {
                                  var result = yield this._scale(systems, 'start', opts);
                            
                                  // if flag --open
                            Severity: Minor
                            Found in src/cmds/start.js - About 1 hr to fix

                              Function installVM has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                installVM(start = false) {
                                  var vm_name = config("agent:vm:name");
                                  return async(this, function* () {
                                    var installed  = yield VM.isInstalled(vm_name);
                                    var running    = (installed) ? yield VM.isRunnig(vm_name) : false;
                              Severity: Minor
                              Found in src/agent/server.js - About 1 hr to fix

                                Function _checkGitError has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  _checkGitError(git_repo, git_branch_tag_commit, git_destination_path) {
                                    return function (err) {
                                      var original_error = err.message;
                                      var stack_trace = err.stack || '';
                                      var error_type;
                                Severity: Minor
                                Found in src/manifest/get_project.js - About 1 hr to fix

                                  Function require has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  Module.prototype.require = function(file, ...args) {
                                    var result, require = () => {
                                      return original.apply(this, [file, ...args]);
                                    };
                                  
                                  
                                  Severity: Minor
                                  Found in src/utils/require_debug.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 _findDockerfile has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    _findDockerfile(dockerfile_path) {
                                      var msg;
                                  
                                      if (this.system.hasOwnProperty('manifest') && this.system.manifest.cwd) {
                                        var dockerfile_cwd = path.resolve(this.system.manifest.cwd, dockerfile_path);
                                  Severity: Minor
                                  Found in src/images/index.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language