pankod/superplate

View on GitHub
src/saofile.ts

Summary

Maintainability
A
3 hrs
Test Coverage

Function actions has 196 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

    async actions(sao) {
        const answers = {
            ...sao.opts.extras.presetAnswers,
            ...sao.answers,
        };
Severity: Major
Found in src/saofile.ts - About 7 hrs to fix

    File saofile.ts has 352 lines of code (exceeds 250 allowed). Consider refactoring.
    Wontfix

    import {
        concatExtend,
        extendBase,
        getPluginsArray,
        get_potential_package_managers,
    Severity: Minor
    Found in src/saofile.ts - About 4 hrs to fix

      Function data has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          data(sao) {
              /**
               * Package Manager
               */
              const answers = {
      Severity: Minor
      Found in src/saofile.ts - About 1 hr to fix

        Function prompts has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Wontfix

            prompts(sao) {
                const { apiMode } = sao.opts.extras;
        
                if (apiMode) return [];
        
        
        Severity: Minor
        Found in src/saofile.ts - About 1 hr to fix

          Function completed has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Wontfix

              async completed(saoInstance) {
                  const { debug, apiMode } = saoInstance.opts.extras;
          
                  /**
                   * Format generated project
          Severity: Minor
          Found in src/saofile.ts - About 1 hr to fix

            Function actions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                async actions(sao) {
                    const answers = {
                        ...sao.opts.extras.presetAnswers,
                        ...sao.answers,
                    };
            Severity: Minor
            Found in src/saofile.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 completed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                async completed(saoInstance) {
                    const { debug, apiMode } = saoInstance.opts.extras;
            
                    /**
                     * Format generated project
            Severity: Minor
            Found in src/saofile.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

            There are no issues that match your filters.

            Category
            Status