r37r0m0d3l/consono

View on GitHub

Showing 41 of 41 total issues

Function deReCycle has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  return (function deReCycle(value, path) {
    let index;
    let name;
    let newIterable;
    if (
Severity: Minor
Found in src/utils/objectDeCycle.js - About 1 hr to fix

    Function consonoOut has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function consonoOut(variable, options, sortKeys = true) {
      let out;
      if (variable === undefined) {
        out = undefined;
      } else {
    Severity: Minor
    Found in src/helpers/node/consonoOut.js - About 1 hr to fix

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

          } else {
            if (out === undefined) {
              process.stdout.write(undefined);
            } else {
              process.stdout.write(out);
      Severity: Major
      Found in src/helpers/node/consonoOut.js and 1 other location - About 1 hr to fix
      src/helpers/node/consonoOut.js on lines 32..39

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

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

      export default function consonoOut(variable, options, sortKeys = true) {
        let out;
        if (variable === undefined) {
          out = undefined;
        } else {
      Severity: Minor
      Found in src/helpers/browser/consonoOut.js - About 1 hr to fix

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

              setTimeout(() => {
                if (out === undefined) {
                  process.stdout.write(undefined);
                } else {
                  process.stdout.write(out);
        Severity: Major
        Found in src/helpers/node/consonoOut.js and 1 other location - About 1 hr to fix
        src/helpers/node/consonoOut.js on lines 40..47

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

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

        export default function consonoJSON(variable, options, sortKeys = true) {
          let out;
          if (variable === undefined) {
            out = undefined;
          } else {
        Severity: Minor
        Found in src/helpers/node/consonoJSON.js - About 1 hr to fix

          Function consonoJSON has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function consonoJSON(variable, options, sortKeys = true) {
            let out;
            if (variable === undefined) {
              out = undefined;
            } else {
          Severity: Minor
          Found in src/helpers/browser/consonoJSON.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if (
                  typeof value === "object" &&
                  value !== null &&
                  !(value instanceof Boolean) &&
                  !(value instanceof Date) &&
            Severity: Major
            Found in src/utils/objectDeCycle.js - About 1 hr to fix

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

              const THEME_DARK = {
                argument: FgRed,
                boolean: FgMagenta,
                comment: FgWhite,
                keyword: FgBlue,
              Severity: Minor
              Found in src/core/browser/theme.js and 1 other location - About 55 mins to fix
              src/core/browser/theme.js on lines 14..24

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

              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

              const THEME_LIGHT = {
                argument: FgRed,
                boolean: FgMagenta,
                comment: FgBlack,
                keyword: FgBlue,
              Severity: Minor
              Found in src/core/browser/theme.js and 1 other location - About 55 mins to fix
              src/core/browser/theme.js on lines 26..36

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

              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

              export { Consono, THEME_DARK, THEME_LIGHT, consono, consonoExit, consonoJSON, consonoOut, consonoPlain, consonoReturn, options };
              Severity: Minor
              Found in src/index.browser.js and 1 other location - About 50 mins to fix
              src/index.node.js on lines 12..12

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

              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

              export { Consono, THEME_DARK, THEME_LIGHT, consono, consonoExit, consonoJSON, consonoOut, consonoPlain, consonoReturn, options };
              Severity: Minor
              Found in src/index.node.js and 1 other location - About 50 mins to fix
              src/index.browser.js on lines 12..12

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

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

              export default function consono(variable, options = true, theme = THEME_DEFAULT) {
                const createdOptions = Consono.createOptions(options);
                const instance = new Consono(createdOptions, theme);
                if (createdOptions.console) {
                  if (createdOptions.clear) {
              Severity: Minor
              Found in src/helpers/node/consono.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 consonoReturn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function consonoReturn(variable, options = true, theme = THEME_DEFAULT) {
                const createdOptions = Consono.createOptions({ ...options, console: false, returns: true });
                const instance = new Consono(createdOptions, theme);
                if (createdOptions.console) {
                  if (createdOptions.clear) {
              Severity: Minor
              Found in src/helpers/browser/consonoReturn.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 consonoPlain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function consonoPlain(variable, options = true) {
                const createdOptions = Consono.createOptions({ ...options, colorize: false });
                const instance = new Consono(createdOptions);
                if (createdOptions.console) {
                  if (createdOptions.clear) {
              Severity: Minor
              Found in src/helpers/browser/consonoPlain.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 consonoExit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function consonoExit(variable, options = true, theme = "light", exitCode = 0) {
                const createdOptions = Consono.createOptions({ ...options, exit: exitCode });
                const instance = new Consono(createdOptions, theme);
                if (createdOptions.console) {
                  if (createdOptions.clear) {
              Severity: Minor
              Found in src/helpers/browser/consonoExit.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 consonoReturn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function consonoReturn(variable, options = true, theme = THEME_DEFAULT) {
                const createdOptions = Consono.createOptions({ ...options, console: false, returns: true });
                const instance = new Consono(createdOptions, theme);
                if (createdOptions.console) {
                  if (createdOptions.clear) {
              Severity: Minor
              Found in src/helpers/node/consonoReturn.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 consonoExit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function consonoExit(variable, options = true, theme = THEME_DEFAULT, exitCode = 0) {
                const createdOptions = Consono.createOptions({ ...options, exit: exitCode });
                const instance = new Consono(createdOptions, theme);
                if (createdOptions.console) {
                  if (createdOptions.clear) {
              Severity: Minor
              Found in src/helpers/node/consonoExit.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 consono has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function consono(variable, options = true, theme = THEME_DEFAULT) {
                const createdOptions = Consono.createOptions(options);
                const instance = new Consono(createdOptions, theme);
                if (createdOptions.console) {
                  if (createdOptions.clear) {
              Severity: Minor
              Found in src/helpers/browser/consono.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 consonoPlain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function consonoPlain(variable, options = true) {
                const createdOptions = Consono.createOptions({ ...options, colorize: false });
                const instance = new Consono(createdOptions);
                if (createdOptions.console) {
                  if (createdOptions.clear) {
              Severity: Minor
              Found in src/helpers/node/consonoPlain.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

              Severity
              Category
              Status
              Source
              Language