azukiapp/azk

View on GitHub

Showing 207 of 207 total issues

Function callAgent has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  callAgent(opts) {
    var params = {
      action: _.head(this.route.actions) || opts.action
    };
    // Create a progress output
Severity: Major
Found in src/cmds/agent.js - About 2 hrs to fix

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

      constructor(ui) {
        super(ui);
        this.type      = 'framework';
        this.name      = 'elixir_phoenix';
        this.rule_name = 'elixir_phoenix';
    Severity: Major
    Found in src/generator/rules/elixir_phoenix.js and 1 other location - About 2 hrs to fix
    src/generator/rules/ruby_on_rails.js on lines 4..11

    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 75.

    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

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

      constructor(ui) {
        super(ui);
        this.type      = 'framework';
        this.name      = "ruby_on_rails";
        this.rule_name = "ruby_on_rails";
    Severity: Major
    Found in src/generator/rules/ruby_on_rails.js and 1 other location - About 2 hrs to fix
    src/generator/rules/elixir_phoenix.js on lines 6..13

    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 75.

    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 parseCommandOptions has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      static parseCommandOptions(opts) {
        var is_start      = opts.start;
        var system_name   = opts.system;
        var git_repo      = opts['git-repo'];
        var git_ref       = opts['git-ref'];
    Severity: Minor
    Found in src/manifest/get_project.js - About 1 hr to fix

      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

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

                        if (instances.length > 0) {
                          name   = cli.ui.c.green(`${system.name}`);
                          status = cli.ui.c.green(`↑`);
                        } else if (!system.auto_start) {
                          name   = cli.ui.c.yellow(`${system.name}`);
                Severity: Major
                Found in src/cmds/status.js and 1 other location - About 1 hr to fix
                src/cmds/status.js on lines 53..59

                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 68.

                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

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

                        } else if (!system.auto_start) {
                          name   = cli.ui.c.yellow(`${system.name}`);
                          status = cli.ui.c.yellow(`−`);
                        } else {
                          name   = cli.ui.c.red(`${system.name}`);
                Severity: Major
                Found in src/cmds/status.js and 1 other location - About 1 hr to fix
                src/cmds/status.js on lines 50..59

                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 68.

                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 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

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

                          constructor(ui) {
                            super(ui);
                            this.type      = "database";
                            this.name      = "mysql";
                            this.rule_name = "mysql";
                        Severity: Major
                        Found in src/generator/rules/mysql.js and 1 other location - About 1 hr to fix
                        src/generator/rules/postgres.js on lines 4..14

                        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 67.

                        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

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

                          constructor(ui) {
                            super(ui);
                            this.type      = "database";
                            this.name      = "postgres";
                            this.rule_name = "postgres";
                        Severity: Major
                        Found in src/generator/rules/postgres.js and 1 other location - About 1 hr to fix
                        src/generator/rules/mysql.js on lines 5..15

                        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 67.

                        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 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
                          Severity
                          Category
                          Status
                          Source
                          Language