azukiapp/azk

View on GitHub

Showing 135 of 207 total issues

System has 62 functions (exceeds 20 allowed). Consider refactoring.
Open

export class System {
  constructor(manifest, name, image, options = {}) {
    this.manifest  = manifest;
    this.name      = name;

Severity: Major
Found in src/system/index.js - About 1 day to fix

    File en-US.js has 540 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    
    // jscs:disable maximumLineLength
    module.exports = {
      terms_of_use: {
        first_question: [
    Severity: Major
    Found in shared/locales/en-US.js - About 1 day to fix

      File index.js has 530 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { _, t, path, fs, utils, isBlank, lazy_require } from 'azk';
      import { version, config } from 'azk';
      import { net } from 'azk/utils';
      
      var lazy = lazy_require({
      Severity: Major
      Found in src/system/index.js - About 1 day to fix

        File vm.js has 466 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { _, path, config, log, isBlank, fsAsync } from 'azk';
        import { subscribe, publish } from 'azk/utils/postal';
        import { async, promisify, thenAll, promisifyModule } from 'azk/utils/promises';
        import Utils from 'azk/utils';
        import { Tools } from 'azk/agent/tools';
        Severity: Minor
        Found in src/agent/vm.js - About 7 hrs to fix

          Function subscribeTo has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
          Open

            subscribeTo(topic) {
              if (topic) {
                var subscribe_topic = topic;
                var subscribe = azk_channel.subscribe.bind(azk_channel);
                var log = require("azk/utils/log").log;
          Severity: Minor
          Found in src/utils/postal.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

          File configure.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { _, t, os, log, lazy_require, fsAsync } from 'azk';
          import { publish } from 'azk/utils/postal';
          import { async, promisify, thenAll, promiseResolve } from 'azk/utils/promises';
          import { config, set_config } from 'azk';
          import { UIProxy } from 'azk/cli/ui';
          Severity: Minor
          Found in src/agent/configure.js - About 5 hrs to fix

            File run.js has 376 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { _, t, lazy_require, isBlank } from 'azk';
            import { config, log, path } from 'azk';
            import { subscribe, publish } from 'azk/utils/postal';
            import { defer, async, asyncUnsubscribe, promiseResolve, thenAll } from 'azk/utils/promises';
            import { ImageNotAvailable, SystemRunError, RunCommandError, NotBeenImplementedError } from 'azk/utils/errors';
            Severity: Minor
            Found in src/system/run.js - About 5 hrs to fix

              Function run has 123 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function run(docker, Container, image, cmd, opts = { }) {
                var container = null;
              
                opts.stdout = opts.stdout  || process.stdout;
                opts.stderr = opts.stderr  || opts.stdout;
              Severity: Major
              Found in src/docker/run.js - About 4 hrs to fix

                Function _scale has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                Open

                  _scale(system, instances = {}, opts = undefined) {
                    var flags    = {};
                    var _subscription = subscribe('#.status', (event) => {
                      if (!event) { return; }
                      var type;
                Severity: Minor
                Found in src/cmds/scale.js - About 4 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

                File index.js has 334 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { path, fs, config, _, t, log, lazy_require, isBlank } from 'azk';
                import { System } from 'azk/system';
                import { Validate } from 'azk/manifest/validate';
                import { ManifestError, ManifestRequiredError, SystemNotFoundError } from 'azk/utils/errors';
                import Utils from 'azk/utils';
                Severity: Minor
                Found in src/manifest/index.js - About 4 hrs to fix

                  UI has 31 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  var UI = {
                    isUI: true,
                    t: t,
                    _interactive: true,
                  
                  
                  Severity: Minor
                  Found in src/cli/ui.js - About 3 hrs to fix

                    Function build has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function build(docker, options) {
                      return async(function* () {
                        var opts = _.extend({
                          cache: true
                        }, options);
                    Severity: Major
                    Found in src/docker/build.js - About 3 hrs to fix

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

                        constructor(opts) {
                          this.opts = _.merge({
                            namespace: config('configuration:namespace'),
                          }, opts);
                      
                      
                      Severity: Major
                      Found in src/configuration/index.js - About 3 hrs to fix

                        Manifest has 28 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        export class Manifest {
                          constructor(cwd, file = null, required = false) {
                            if (typeof file == "boolean") {
                              [required, file] = [file, null];
                            }
                        Severity: Minor
                        Found in src/manifest/index.js - About 3 hrs to fix

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

                            index() {
                              var { options } = this.normalized_params;
                              var args = this.normalized_params.arguments;
                          
                              var _subscription = subscribe('docker.pull.status', (data) => {
                          Severity: Major
                          Found in src/cmds/shell.js - About 3 hrs to fix

                            Function _validate_wait_option has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              static _validate_wait_option(manifest) {
                                return _.reduce(manifest.systems, (errors, system) => {
                            
                                  // ignore if it is not present or equal false
                                  if (typeof system.options.wait === 'undefined' || system.options.wait === false) {
                            Severity: Major
                            Found in src/manifest/validate.js - About 3 hrs to fix

                              File balancer.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { _, t, path, fsAsync, config, log } from 'azk';
                              import { async, defer, promisifyAll, thenAll, promiseResolve } from 'azk/utils/promises';
                              
                              import { lazy_require } from 'azk';
                              import { net } from 'azk/utils';
                              Severity: Minor
                              Found in src/agent/balancer.js - About 2 hrs to fix

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

                                  index() {
                                    return async(this, function* () {
                                      let args = this.normalized_params.arguments;
                                      let options = this.normalized_params.options;
                                
                                
                                Severity: Major
                                Found in src/cmds/info.js - About 2 hrs to fix

                                  Function subscribeTo has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    subscribeTo(topic) {
                                      if (topic) {
                                        var subscribe_topic = topic;
                                        var subscribe = azk_channel.subscribe.bind(azk_channel);
                                        var log = require("azk/utils/log").log;
                                  Severity: Major
                                  Found in src/utils/postal.js - About 2 hrs to fix

                                    File get_project.js has 285 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { path, lazy_require, config, log, fsAsync } from 'azk';
                                    import { async, promiseResolve, promiseReject } from 'azk/utils/promises';
                                    import { UIProxy } from 'azk/cli/ui';
                                    import { matchFirstRegex, matchAllRegex, fulltrim } from 'azk/utils/regex_helper';
                                    import { printOutput } from 'azk/utils/spawn_helper';
                                    Severity: Minor
                                    Found in src/manifest/get_project.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language