azukiapp/azk

View on GitHub

Showing 207 of 207 total issues

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

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                    var publisher = awspublish.create({
                      params: {
                        Bucket: bucket,
                      },
                      accessKeyId: process.env.AWS_ACCESS_KEY_ID,
                  Severity: Major
                  Found in docs/gulpfile.js and 1 other location - About 1 hr to fix
                  gulpfile.js on lines 67..74

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 57.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                    var publisher = awspublish.create({
                      params: {
                        Bucket: bucket,
                      },
                      accessKeyId: process.env.AWS_ACCESS_KEY_ID,
                  Severity: Major
                  Found in gulpfile.js and 1 other location - About 1 hr to fix
                  docs/gulpfile.js on lines 68..75

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 57.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

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

                                remove(vm_name) {
                                  return Tools.async_status("vm", this, function* (status_change) {
                                    var info = yield vm.info(vm_name);
                              
                                    if (info.name == vm_name) {
                              Severity: Minor
                              Found in src/agent/vm.js - About 1 hr to fix

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

                                  _checkAndSaveIp(nameserver, file, use_vm, services_ports) {
                                    return async(this, function* () {
                                      // Not exist or invalid content
                                      var dns_port = _.isObject(nameserver) ? nameserver.port : null;
                                      var unmatched_dns_port = dns_port !== services_ports.dns;
                                Severity: Minor
                                Found in src/agent/configure.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language