gerard2p/koaton-cli

View on GitHub

Showing 56 of 56 total issues

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

        switch (mode) {
            case writemodes.update:
                label = 'update'.cyan + ':';
                break;
            case writemodes.create:
Severity: Minor
Found in src/utils/write.js and 1 other location - About 40 mins to fix
src/utils/render.js on lines 11..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 62.

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

    switch (mode) {
        case writemodes.update:
            label = 'update'.cyan + ':';
            break;
        case writemodes.create:
Severity: Minor
Found in src/utils/render.js and 1 other location - About 40 mins to fix
src/utils/write.js on lines 17..27

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

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 buildCSS has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

export async function buildCSS (target, bundle, development, onlypaths, logger) {
Severity: Minor
Found in src/functions/builder.js - About 35 mins to fix

    Function buildJS has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export async function buildJS (target, bundle, development, onlypaths, logger) {
    Severity: Minor
    Found in src/functions/builder.js - About 35 mins to fix

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

              Object.keys(this).forEach((key) => {
                  definition.push(`${key}:{type:schema.${datatypes[this[key]].caminte}}`);
              });
      Severity: Minor
      Found in src/support/ORMModel.js and 1 other location - About 35 mins to fix
      src/support/ORMModel.js on lines 90..92

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

      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

              Object.keys(this).forEach((key) => {
                  definition.push(`${key}:attr('${datatypes[this[key]].ember}')`);
              });
      Severity: Minor
      Found in src/support/ORMModel.js and 1 other location - About 35 mins to fix
      src/support/ORMModel.js on lines 74..76

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

      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 has has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          has (mutableItem) {
              for (const nameditem in this.target) {
                  const item = this.target[nameditem];
                  if (mutableItem instanceof this.Mutable) {
                      if (item.equals(mutableItem)) {
      Severity: Minor
      Found in src/support/MutableArray.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

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

          pipe (msg) {
              if (msg !== undefined && msg !== null) {
                  switch (msg.action) {
                      case 'text':
                          this.text = msg.msg;
      Severity: Minor
      Found in src/spinner.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

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

      Object.defineProperty(avaliablengines, 'isOrDef', {
          enumerable: false,
          configurable: false,
          value: function (adpt) {
              return this[adpt] === undefined ? this.handlebars : this[adpt];
      Severity: Minor
      Found in src/support/Engines.js and 1 other location - About 35 mins to fix
      src/support/Adapters.js on lines 23..29

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

      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

      Object.defineProperty(adapters, 'isOrDef', {
          enumerable: false,
          configurable: false,
          value: function (adpt) {
              return this[adpt] === undefined ? this.mongo : this[adpt];
      Severity: Minor
      Found in src/support/Adapters.js and 1 other location - About 35 mins to fix
      src/support/Engines.js on lines 11..17

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

      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 UpdateModulesAssetsLinks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      const UpdateModulesAssetsLinks = function UpdateModulesAssetsLinks (hbs, ext, regex) {
          let found,
              res = hbs;
          while ((found = regex.exec(hbs)) !== null) {
              let target = scfg.bundles[`${found[1]}.${ext}`];
      Severity: Minor
      Found in src/commands/modulify.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 getnginxpath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      export async function getnginxpath () {
          if (nginxpath === undefined) {
              let cmd = 'nginx -t';
              /* istanbul ignore next */
              if (process.env.TRAVIS) {
      Severity: Minor
      Found in src/functions/nginx.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

      TODO found
      Open

              ok = await prompt(`${message} [y/n]: `); // TODO: I don't know how to write in the stdin while running the tests ...
      Severity: Minor
      Found in src/utils/challenge.js by fixme

      TODO found
      Open

      // TODO: please check when the proccess failed.
      Severity: Minor
      Found in src/support/EmberBuilder.js by fixme

      TODO found
      Open

                      // TODO: console.log(`Deprecated: Please use only lower strings for the models datatypes (${capitalize(datatype)})`.yellow);
      Severity: Minor
      Found in src/support/ExtendedStrings.js by fixme

      TODO found
      Open

          // TODO: I just don't know why this get reset, but this is a temporal fix.
      Severity: Minor
      Found in src/support/CopyStatic.js by fixme
      Severity
      Category
      Status
      Source
      Language