pankod/superplate

View on GitHub

Showing 6 of 29 total issues

Function cli has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

const cli = async (): Promise<void> => {
    clear();
    const program = commander
        .name(packageData.name)
        .version(packageData.version)
Severity: Minor
Found in src/cli.ts - About 1 hr 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 data has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    data(sao) {
        /**
         * Package Manager
         */

Severity: Minor
Found in src/saofile.ts - About 1 hr to fix

    Function Badges has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Badges() {
      return (
        <div className={styles.topBadges}>
          <a href="https://www.producthunt.com/posts/superplate?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-superplate" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=293252&theme=light" alt="Superplate - The frontend boilerplate with superpowers | Product Hunt" style={{ width: 250, height: 54 }} width="250" height="54" /></a>
          <br />
    Severity: Minor
    Found in documentation/src/pages/index.js - About 1 hr to fix

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

          prompts(sao) {
              const {
                  appName,
                  extras: { paths, presetAnswers },
              } = sao.opts;
      Severity: Minor
      Found in src/saofile.ts - 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 { error: repoStatus.error };
      Severity: Major
      Found in src/Helper/source/index.ts - About 30 mins to fix

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

        const postInstall: PostInstallFn = ({ name, dir, pm }) => {
            console.log("");
        
            console.log(
                `${chalk.green.bold("Success!")} Created ${chalk.greenBright.bold(
        Severity: Minor
        Found in src/Helper/tips/index.ts - 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