azukiapp/azk

View on GitHub

Showing 135 of 207 total issues

Function parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  parse() {
    var content  = fs.readFileSync(this.file);
    let err_file = path.relative(this.cwd_search, this.file);
    var err  = check(content.toString(), this.file);
    if (err) {
Severity: Minor
Found in src/manifest/index.js - About 35 mins 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

Avoid too many return statements within this function.
Open

      return errors;
Severity: Major
Found in src/manifest/validate.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

              return errors.concat(
                this._entry('fail', 'invalid_option_value', manifest, {
                  option: 'wait.timeout',
                  value: system.options.wait.timeout,
                  system_name: system.name,
    Severity: Major
    Found in src/manifest/validate.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                return errors.concat(
                  this._entry('fail', 'invalid_option_type', manifest, {
                    option: 'wait.retry',
                    value: system.options.wait.retry,
                    system_name: system.name,
      Severity: Major
      Found in src/manifest/validate.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                  return errors.concat(
                    this._entry('fail', 'invalid_option_type', manifest, {
                      option: 'wait.timeout',
                      value: system.options.wait.timeout,
                      system_name: system.name,
        Severity: Major
        Found in src/manifest/validate.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return errors.concat(
                    this._deprecate((system.image || {}), manifest, system.name, 'wait', 'wait')
                  );
          Severity: Major
          Found in src/manifest/validate.js - About 30 mins to fix

            Function stop has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              stop() {
                if (this.server || this.api_ws) {
                  log.debug("[api] stopping server api");
                  return thenAll([
                    (this.api_ws) ? this.api_ws.stop() : promiseResolve(),
            Severity: Minor
            Found in src/agent/api/index.js - About 25 mins 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 getFrameworkVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              getFrameworkVersion(content) {
                var parsedJson, version;
                try {
                  parsedJson = JSON.parse(content);
                } catch (err) {
            Severity: Minor
            Found in src/generator/rules/php_cakephp.js - About 25 mins 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 _configure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              _configure(opts) {
                opts = _.merge({}, opts, (this.normalized_params && this.normalized_params.options));
            
                // Set verbose level
                if (opts.verbose) {
            Severity: Minor
            Found in src/cli/cli_controller.js - About 25 mins 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 parseError has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              parseError(error) {
                if (error.statusCode) {
                  if (error.statusCode === 404 && error.reason === "no such container") {
                    this.ui.fail("commands.shell.ended.removed");
                    return { code: 127 };
            Severity: Minor
            Found in src/cmds/shell.js - About 25 mins 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 set has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export function set(key, value) {
              if (key == "env") {
                set_env(value);
              } else {
                var keys   = [env(), ...key.split(':')];
            Severity: Minor
            Found in src/config.js - About 25 mins 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 run has a Cognitive Complexity of 6 (exceeds 5 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: Minor
            Found in src/docker/run.js - About 25 mins 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 waitService has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              waitService(uri, opts = {}) {
                opts = _.defaults(opts, {
                  timeout: 10000,      // maximum timeout - this may be override
                  retry_if: () => { return promiseResolve(true); },
                  publish_retry: true,
            Severity: Minor
            Found in src/utils/net.js - About 25 mins 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 start has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              start() {
                log.debug("[api] starting server api");
                if (config('agent:dev:hotswap_code')) {
                  try {
                    lazy.hotswap.on('swap', () => {
            Severity: Minor
            Found in src/agent/api/index.js - About 25 mins 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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export function get(key) {
              if (key == "env") {
                return env();
              }
            
            
            Severity: Minor
            Found in src/config.js - About 25 mins 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