azukiapp/azk

View on GitHub

Showing 135 of 207 total issues

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

  watch(origin, destination, opts = {}) {
    this.unwatch();
    this.status = WATCH_INIT;

    return async(this, function* () {
Severity: Minor
Found in src/sync/worker.js - About 1 hr to fix

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

      stop(system, instances, options = {}) {
        options = _.defaults(options, {
          kill: false,
          remove: true,
        });
    Severity: Minor
    Found in src/system/run.js - About 1 hr to fix

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

        runDaemon(system, options = {}) {
          return async(this, function* () {
            // TODO: add instances and dependencies options
            // Prepare options
            var image = yield this._check_image(system, options);
      Severity: Minor
      Found in src/system/run.js - About 1 hr to fix

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

          constructor(...args) {
            super(...args);
        
            var name    = 'ruby';
            // Readable name for this suggestion
        Severity: Minor
        Found in src/generator/suggestions/ruby.js - About 1 hr to fix

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

            constructor(...args) {
              super(...args);
          
              var name    = 'php_composer';
              var version = '5.6';
          Severity: Minor
          Found in src/generator/suggestions/php_composer.js - About 1 hr to fix

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

            export function cli(args, cwd, ui = UI) {
              var result, azk_cli;
              try {
                args = args.slice(2);
                [azk_cli, result] = run(args, cwd, ui = UI);
            Severity: Minor
            Found in src/cli/index.js - About 1 hr to fix

              Function result has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    var result = defer((resolver, reject) => {
                      var escape = (key, container, next) => {
                        if (key === ".") {
                          process.nextTick(() => {
                            lazy.docker.getContainer(container).stop({ t: 5000 }).catch(reject);
              Severity: Minor
              Found in src/cmds/shell.js - About 1 hr to fix

                Function _activeDockerMonitor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _activeDockerMonitor(retry = 3) {
                    var docker_host = config("docker:host");
                    log.debug(t("docker.monitor.start", { docker_host, retry }));
                
                    var stop = () => {
                Severity: Minor
                Found in src/agent/server.js - About 1 hr to fix

                  Function require has 28 lines of code (exceeds 25 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

                    Function pull has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function pull(docker, repository, tag) {
                      var image   = `${repository}:${tag}`;
                      var promise = docker.createImage({
                        fromImage: repository,
                        tag: tag,
                    Severity: Minor
                    Found in src/docker/pull.js - About 1 hr to fix

                      Function index has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        index(params) {
                          return async(this, function* () {
                            if (params.filename) {
                              this.showFilename();
                              return 0;
                      Severity: Minor
                      Found in src/cmds/init.js - About 1 hr to fix

                        Function systems_data has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              let systems_data = _.reduce(systems, (data, system) => {
                                var obj = {};
                                obj[system.image.provider] = system.image.name;
                                var system_data = {
                                  depends : system.options.depends,
                        Severity: Minor
                        Found in src/cmds/info.js - About 1 hr to fix

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

                          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 constructor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                            constructor(options) {
                              this.system = options.system || { image_name_suggest: null };
                          
                              // Extract provider information
                              // 2. i.e.: { docker: 'azukiapp/azktcl:0.0.2' }
                          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

                          Function full has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            full(opts) {
                              return async(this, function* () {
                                // Get agent status
                                var agent = yield lazy.Client.status();
                                var require_vm = config("agent:requires_vm");
                          Severity: Minor
                          Found in src/cmds/version.js - About 1 hr to fix

                            Function connect has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              connect(wait, callback) {
                                var execute = () => {
                                  return defer((done) => {
                                    var client    = new ssh2();
                                    var options   = {
                            Severity: Minor
                            Found in src/agent/ssh.js - About 1 hr to fix

                              Function stop has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                stop(vm_name, force = false, timeout = 30) {
                                  log.debug("[vm] call to stop vm %s", vm_name);
                              
                                  return Tools.async_status("vm", this, function* (status_change) {
                                    var info = yield vm.info(vm_name);
                              Severity: Minor
                              Found in src/agent/vm.js - About 1 hr to fix

                                Function nameServers has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  nameServers(custom_dns_servers, options={}) {
                                    var dns_servers;
                                    var nameservers     = config(cache_key);
                                    var env_dns_servers = envDefaultArray('AZK_DNS_SERVERS', []);
                                
                                
                                Severity: Minor
                                Found in src/utils/net.js - About 1 hr to fix

                                  Function linux has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    linux() {
                                      if (config('agent:requires_vm')) {
                                        return this._checksForRequiresVm();
                                      } else {
                                        var socket = config('docker:socket');
                                  Severity: Minor
                                  Found in src/agent/configure.js - About 1 hr to fix

                                    Function _getNetworkIp has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      _getNetworkIp(suggestion) {
                                        var question = {
                                          name    : 'ip',
                                          message : 'configure.ip_question',
                                          // default : config('agent:vm:ip'),
                                    Severity: Minor
                                    Found in src/agent/configure.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language