azukiapp/azk

View on GitHub

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

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

          getFile(origin, dest, wait = false) {
            return this.connect(wait, (client, done) => {
              log.debug("agent vm ssh scp: %s <= %s", origin, dest);
              publish("agent.ssh.getFile.status", { type: "ssh", context: "scp", dest: dest, origin: origin});
        
        
        Severity: Major
        Found in src/agent/ssh.js and 1 other location - About 1 day to fix
        src/agent/ssh.js on lines 63..84

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

        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

          putFile(origin, dest, wait = false) {
            return this.connect(wait, (client, done) => {
              log.debug("agent vm ssh scp: %s => %s", origin, dest);
              publish("agent.ssh.putFile.status", { type: "ssh", context: "scp", origin: origin, dest: dest});
        
        
        Severity: Major
        Found in src/agent/ssh.js and 1 other location - About 1 day to fix
        src/agent/ssh.js on lines 40..61

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

        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

              if (_.isObject(system.options.wait) && system.options.wait.retry) {
                if (_.isNumber(system.options.wait.retry) && system.options.wait.retry < 0) {
                  return errors.concat(
                    this._entry('fail', 'invalid_option_value', manifest, {
                      option: 'wait.retry',
        Severity: Major
        Found in src/manifest/validate.js and 1 other location - About 1 day to fix
        src/manifest/validate.js on lines 143..165

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

        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

              if (_.isObject(system.options.wait) && system.options.wait.timeout) {
                if (_.isNumber(system.options.wait.timeout) && system.options.wait.timeout < 0) {
                  return errors.concat(
                    this._entry('fail', 'invalid_option_value', manifest, {
                      option: 'wait.timeout',
        Severity: Major
        Found in src/manifest/validate.js and 1 other location - About 1 day to fix
        src/manifest/validate.js on lines 118..140

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

        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

        export class Suggestion extends DefaultSuggestion {
          constructor(...args) {
            super(...args);
        
            var name = `elixir`;
        Severity: Major
        Found in src/generator/suggestions/elixir-1.1.js and 1 other location - About 7 hrs to fix
        src/generator/suggestions/elixir-1.2.js on lines 3..21

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

        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

        export class Suggestion extends DefaultSuggestion {
          constructor(...args) {
            super(...args);
        
            var name = `elixir`;
        Severity: Major
        Found in src/generator/suggestions/elixir-1.2.js and 1 other location - About 7 hrs to fix
        src/generator/suggestions/elixir-1.1.js on lines 3..21

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

        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

        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

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

          export class Suggestion extends DefaultSuggestion {
            constructor(...args) {
              super(...args);
          
              var name    = 'ruby';
          Severity: Major
          Found in src/generator/suggestions/ruby-2.2.js and 6 other locations - About 7 hrs to fix
          src/generator/suggestions/jruby-1.7.js on lines 3..21
          src/generator/suggestions/node-0.10.js on lines 3..21
          src/generator/suggestions/node-0.12.js on lines 3..21
          src/generator/suggestions/ruby-1.9.js on lines 3..21
          src/generator/suggestions/ruby-2.0.js on lines 3..21
          src/generator/suggestions/ruby-2.1.js on lines 3..21

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

          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 7 locations. Consider refactoring.
          Open

          export class Suggestion extends DefaultSuggestion {
            constructor(...args) {
              super(...args);
          
              var name    = 'node';
          Severity: Major
          Found in src/generator/suggestions/node-0.12.js and 6 other locations - About 7 hrs to fix
          src/generator/suggestions/jruby-1.7.js on lines 3..21
          src/generator/suggestions/node-0.10.js on lines 3..21
          src/generator/suggestions/ruby-1.9.js on lines 3..21
          src/generator/suggestions/ruby-2.0.js on lines 3..21
          src/generator/suggestions/ruby-2.1.js on lines 3..21
          src/generator/suggestions/ruby-2.2.js on lines 3..21

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

          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 7 locations. Consider refactoring.
          Open

          export class Suggestion extends DefaultSuggestion {
            constructor(...args) {
              super(...args);
          
              var name    = 'ruby';
          Severity: Major
          Found in src/generator/suggestions/ruby-1.9.js and 6 other locations - About 7 hrs to fix
          src/generator/suggestions/jruby-1.7.js on lines 3..21
          src/generator/suggestions/node-0.10.js on lines 3..21
          src/generator/suggestions/node-0.12.js on lines 3..21
          src/generator/suggestions/ruby-2.0.js on lines 3..21
          src/generator/suggestions/ruby-2.1.js on lines 3..21
          src/generator/suggestions/ruby-2.2.js on lines 3..21

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

          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 7 locations. Consider refactoring.
          Open

          export class Suggestion extends DefaultSuggestion {
            constructor(...args) {
              super(...args);
          
              var name    = 'ruby';
          Severity: Major
          Found in src/generator/suggestions/ruby-2.1.js and 6 other locations - About 7 hrs to fix
          src/generator/suggestions/jruby-1.7.js on lines 3..21
          src/generator/suggestions/node-0.10.js on lines 3..21
          src/generator/suggestions/node-0.12.js on lines 3..21
          src/generator/suggestions/ruby-1.9.js on lines 3..21
          src/generator/suggestions/ruby-2.0.js on lines 3..21
          src/generator/suggestions/ruby-2.2.js on lines 3..21

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

          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 7 locations. Consider refactoring.
          Open

          export class Suggestion extends DefaultSuggestion {
            constructor(...args) {
              super(...args);
          
              var name    = 'node';
          Severity: Major
          Found in src/generator/suggestions/node-0.10.js and 6 other locations - About 7 hrs to fix
          src/generator/suggestions/jruby-1.7.js on lines 3..21
          src/generator/suggestions/node-0.12.js on lines 3..21
          src/generator/suggestions/ruby-1.9.js on lines 3..21
          src/generator/suggestions/ruby-2.0.js on lines 3..21
          src/generator/suggestions/ruby-2.1.js on lines 3..21
          src/generator/suggestions/ruby-2.2.js on lines 3..21

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

          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 7 locations. Consider refactoring.
          Open

          export class Suggestion extends DefaultSuggestion {
            constructor(...args) {
              super(...args);
          
              var name    = 'ruby';
          Severity: Major
          Found in src/generator/suggestions/ruby-2.0.js and 6 other locations - About 7 hrs to fix
          src/generator/suggestions/jruby-1.7.js on lines 3..21
          src/generator/suggestions/node-0.10.js on lines 3..21
          src/generator/suggestions/node-0.12.js on lines 3..21
          src/generator/suggestions/ruby-1.9.js on lines 3..21
          src/generator/suggestions/ruby-2.1.js on lines 3..21
          src/generator/suggestions/ruby-2.2.js on lines 3..21

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

          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 7 locations. Consider refactoring.
          Open

          export class Suggestion extends DefaultSuggestion {
            constructor(...args) {
              super(...args);
          
              var name    = 'jruby';
          Severity: Major
          Found in src/generator/suggestions/jruby-1.7.js and 6 other locations - About 7 hrs to fix
          src/generator/suggestions/node-0.10.js on lines 3..21
          src/generator/suggestions/node-0.12.js on lines 3..21
          src/generator/suggestions/ruby-1.9.js on lines 3..21
          src/generator/suggestions/ruby-2.0.js on lines 3..21
          src/generator/suggestions/ruby-2.1.js on lines 3..21
          src/generator/suggestions/ruby-2.2.js on lines 3..21

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

          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

          export class Suggestion extends DefaultSuggestion {
            constructor(...args) {
              super(...args);
          
              var name    = 'python';
          Severity: Major
          Found in src/generator/suggestions/python-2.7.js and 1 other location - About 6 hrs to fix
          src/generator/suggestions/python-3.4.js on lines 3..21

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

          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

          export class Suggestion extends DefaultSuggestion {
            constructor(...args) {
              super(...args);
          
              var name    = 'python';
          Severity: Major
          Found in src/generator/suggestions/python-3.4.js and 1 other location - About 6 hrs to fix
          src/generator/suggestions/python-2.7.js on lines 3..21

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

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

          Severity
          Category
          Status
          Source
          Language