webpack/webpack-cli

View on GitHub

Showing 38 of 79 total issues

Function default has 205 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default async function (plop: NodePlopAPI) {
  // dependencies to be installed
  const devDependencies: Array<string> = [
    "webpack",
    "webpack-cli",
Severity: Major
Found in packages/create-webpack-app/src/generators/init/vue.ts - About 1 day to fix

    Function default has 203 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default async function (plop: NodePlopAPI) {
      // dependencies to be installed
      const devDependencies: Array<string> = [
        "webpack",
        "webpack-cli",
    Severity: Major
    Found in packages/create-webpack-app/src/generators/init/react.ts - About 1 day to fix

      Function default has 185 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default async function (plop: NodePlopAPI) {
        // dependencies to be installed
        const devDependencies: Array<string> = [
          "webpack",
          "webpack-cli",
      Severity: Major
      Found in packages/create-webpack-app/src/generators/init/svelte.ts - About 7 hrs to fix

        Function default has 177 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default async function (plop: NodePlopAPI) {
          // dependencies to be installed
          const devDependencies: Array<string> = ["webpack", "webpack-cli"];
        
          await plop.load("../../utils/pkgInstallAction.js", {}, true);
        Severity: Major
        Found in packages/create-webpack-app/src/generators/init/default.ts - About 7 hrs to fix

          Function default has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          export default async function (plop: NodePlopAPI) {
            // dependencies to be installed
            const devDependencies: Array<string> = [
              "webpack",
              "webpack-cli",
          Severity: Minor
          Found in packages/create-webpack-app/src/generators/init/vue.ts - About 5 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

          Function apply has 123 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async apply(cli: IWebpackCLI): Promise<void> {
              await cli.makeCommand(
                {
                  name: "init [generation-path]",
                  alias: ["create", "new", "c", "n"],
          Severity: Major
          Found in packages/generators/src/index.ts - About 4 hrs to fix

            Function actions has 114 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                actions: function (answers: Answers) {
                  // setting some default values based on the answers
                  const actions: ActionType[] = [];
                  answers.htmlWebpackPlugin = true;
                  answers.devServer = true;
            Severity: Major
            Found in packages/create-webpack-app/src/generators/init/vue.ts - About 4 hrs to fix

              Function actions has 112 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  actions: function (answers: Answers) {
                    // setting some default values based on the answers
                    const actions: ActionType[] = [];
                    answers.htmlWebpackPlugin = true;
                    answers.devServer = true;
              Severity: Major
              Found in packages/create-webpack-app/src/generators/init/react.ts - About 4 hrs to fix

                Function checkAndPrepareContent has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                Open

                async function checkAndPrepareContent(config: AddConfig, isTemplate: boolean): Promise<Result> {
                  const fileExists = await doesFileExists(config.path);
                  let existingFileContent: Content = "";
                  let newContent: Content = "";
                
                
                Severity: Minor
                Found in packages/create-webpack-app/src/utils/fileGenerator.ts - About 4 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

                Function default has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                Open

                export default async function (plop: NodePlopAPI) {
                  // dependencies to be installed
                  const devDependencies: Array<string> = ["webpack", "webpack-cli"];
                
                  await plop.load("../../utils/pkgInstallAction.js", {}, true);
                Severity: Minor
                Found in packages/create-webpack-app/src/generators/init/default.ts - About 4 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

                Function default has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                export default async function (plop: NodePlopAPI) {
                  // dependencies to be installed
                  const devDependencies: Array<string> = [
                    "webpack",
                    "webpack-cli",
                Severity: Minor
                Found in packages/create-webpack-app/src/generators/init/svelte.ts - About 4 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

                Function actions has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    actions: function (answers: Answers) {
                      // setting some default values based on the answers
                      const actions: ActionType[] = [];
                      answers.htmlWebpackPlugin = true;
                      answers.devServer = true;
                Severity: Major
                Found in packages/create-webpack-app/src/generators/init/svelte.ts - About 4 hrs to fix

                  Function checkAndPrepareContent has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  async function checkAndPrepareContent(config: AddConfig, isTemplate: boolean): Promise<Result> {
                    const fileExists = await doesFileExists(config.path);
                    let existingFileContent: Content = "";
                    let newContent: Content = "";
                  
                  
                  Severity: Major
                  Found in packages/create-webpack-app/src/utils/fileGenerator.ts - About 3 hrs to fix

                    Function default has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default async function (plop: NodePlopAPI) {
                      // dependencies to be installed
                      const devDependencies: Array<string> = [
                        "webpack",
                        "webpack-cli",
                    Severity: Minor
                    Found in packages/create-webpack-app/src/generators/init/react.ts - About 3 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

                    Function actions has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        actions: function (answers: Answers) {
                          const actions: ActionType[] = [];
                    
                          switch (answers.langType) {
                            case "ES6":
                    Severity: Major
                    Found in packages/create-webpack-app/src/generators/init/default.ts - About 3 hrs to fix

                      Function default has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default async function (plop: NodePlopAPI) {
                        // dependencies to be installed
                        const devDependencies: Array<string> = ["webpack-defaults"];
                      
                        await plop.load("../../utils/pkgInstallAction.js", {}, true);
                      Severity: Major
                      Found in packages/create-webpack-app/src/generators/loader/default.ts - About 3 hrs to fix

                        Function addonGenerator has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const addonGenerator = <
                          T extends BaseCustomGeneratorOptions = BaseCustomGeneratorOptions,
                          Z extends CustomGeneratorOptions<T> = CustomGeneratorOptions<T>,
                        >(
                          prompts: Generator.Questions,
                        Severity: Major
                        Found in packages/generators/src/addon-generator.ts - About 2 hrs to fix

                          Function default has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default async function (plop: NodePlopAPI) {
                            // dependencies to be installed
                            const devDependencies: Array<string> = ["webpack-defaults"];
                          
                            await plop.load("../../utils/pkgInstallAction.js", {}, true);
                          Severity: Major
                          Found in packages/create-webpack-app/src/generators/plugin/default.ts - About 2 hrs to fix

                            Function questions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export async function questions(
                              self: CustomGenerator,
                              Question: typeof QuestionAPI,
                              config: Record<string, { skip?: boolean; required?: boolean }> = {
                                langType: {},
                            Severity: Minor
                            Found in packages/generators/src/handlers/default.ts - About 2 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

                            Function default has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default async function (plop: NodePlopAPI) {
                              plop.setPlopfilePath(resolve(__dirname, "../plopfile.js"));
                              plop.setDefaultInclude({ actions: true });
                              plop.setActionType("pkgInstall", (answers, config) => {
                                const options: SpawnOptionsWithStdioTuple<
                            Severity: Minor
                            Found in packages/create-webpack-app/src/utils/pkgInstallAction.ts - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language