webpack/webpack-cli

View on GitHub

Showing 79 of 79 total issues

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

            const existingRow = `| ${"Existing File".padEnd(15)} | ${existingStats.size
              .toString()
              .padEnd(15)} | ${existingStats.mtime.toISOString().padEnd(25)} |`;
Severity: Major
Found in packages/create-webpack-app/src/utils/fileGenerator.ts and 1 other location - About 1 hr to fix
packages/create-webpack-app/src/utils/fileGenerator.ts on lines 208..210

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

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 newRow = `| ${"New File".padEnd(15)} | ${newStats.size
              .toString()
              .padEnd(15)} | ${newStats.mtime.toISOString().padEnd(25)} |`;
Severity: Major
Found in packages/create-webpack-app/src/utils/fileGenerator.ts and 1 other location - About 1 hr to fix
packages/create-webpack-app/src/utils/fileGenerator.ts on lines 205..207

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

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

const runTestWithHelp = (pkg, cliArgs = [], logMessage, isSubPackage = false) => {
  // Simulate package missing
  swapPkgName(pkg, isSubPackage);

  const proc = execa(CLI_ENTRY_PATH, cliArgs, {
Severity: Minor
Found in smoketests/helpers.js - About 1 hr to fix

    Function runTest has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const runTest = (pkg, cliArgs = [], logMessage, isSubPackage = false) => {
      // Simulate package missing
      swapPkgName(pkg, isSubPackage);
    
      const proc = execa(CLI_ENTRY_PATH, cliArgs, {
    Severity: Minor
    Found in smoketests/helpers.js - About 1 hr to fix

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

          actions: function (answers: Answers) {
            const actions: ActionType[] = [];
            answers.projectPath = join(answers.projectPath, answers.name);
      
            logger.error(`
      Severity: Minor
      Found in packages/create-webpack-app/src/generators/plugin/default.ts - About 1 hr to fix

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

            actions: function (answers: Answers) {
              const actions: ActionType[] = [];
              answers.projectPath = join(answers.projectPath, answers.name);
        
              logger.error(`
        Severity: Minor
        Found in packages/create-webpack-app/src/generators/loader/default.ts - About 1 hr to fix

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

                  if (answers.langType === "Typescript") {
                    files.push({ filePath: "./src/store/index.ts", fileType: "text" });
                  } else {
                    files.push({ filePath: "./src/store/index.js", fileType: "text" });
                  }
          Severity: Major
          Found in packages/create-webpack-app/src/generators/init/vue.ts and 2 other locations - About 1 hr to fix
          packages/create-webpack-app/src/generators/init/svelte.ts on lines 168..172
          packages/create-webpack-app/src/generators/init/vue.ts on lines 181..185

          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

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

                if (answers.langType === "Typescript") {
                  files.push({ filePath: "./src/store/index.ts", fileType: "text" });
                } else {
                  files.push({ filePath: "./src/store/index.js", fileType: "text" });
                }
          Severity: Major
          Found in packages/create-webpack-app/src/generators/init/svelte.ts and 2 other locations - About 1 hr to fix
          packages/create-webpack-app/src/generators/init/vue.ts on lines 181..185
          packages/create-webpack-app/src/generators/init/vue.ts on lines 188..192

          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

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

                if (answers.langType === "Typescript") {
                  files.push({ filePath: "./src/router/index.ts", fileType: "text" });
                } else {
                  files.push({ filePath: "./src/router/index.js", fileType: "text" });
                }
          Severity: Major
          Found in packages/create-webpack-app/src/generators/init/vue.ts and 2 other locations - About 1 hr to fix
          packages/create-webpack-app/src/generators/init/svelte.ts on lines 168..172
          packages/create-webpack-app/src/generators/init/vue.ts on lines 188..192

          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

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

              proc.stderr.on("data", (chunk) => {
                const data = stripAnsi(chunk.toString());
                console.log(`  stderr: ${data}`);
              });
          Severity: Major
          Found in smoketests/helpers.js and 1 other location - About 1 hr to fix
          smoketests/helpers.js on lines 114..117

          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

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

              proc.stderr.on("data", (chunk) => {
                const data = stripAnsi(chunk.toString());
                console.log(`  stderr: ${data}`);
              });
          Severity: Major
          Found in smoketests/helpers.js and 1 other location - About 1 hr to fix
          smoketests/helpers.js on lines 173..176

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

          function getDiff(filePath: string, tempFilePath: string): Promise<void> {
            return new Promise((resolve, reject) => {
              const platform = process.platform;
              let editor = "";
          
          
          Severity: Minor
          Found in packages/create-webpack-app/src/utils/fileGenerator.ts - About 1 hr to fix

            Function writing has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public writing(): void {
                  const name = (this.props as Generator.Question).name as string;
                  const resolvedTemplatePath = this.resolvedTemplatePath as string;
                  const packageJsonTemplatePath = "../addon-template/package.json.js";
            
            
            Severity: Minor
            Found in packages/generators/src/addon-generator.ts - About 1 hr to fix

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

              const helpCommand = () => {
                const packageName = "webpack";
                const args = ["help"];
                const logMessage = "The build tool for modern web applications.";
              
              
              Severity: Major
              Found in smoketests/missing-packages/webpack.test.js and 2 other locations - About 1 hr to fix
              smoketests/missing-packages/webpack.test.js on lines 37..43
              smoketests/missing-packages/webpack.test.js on lines 53..59

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

              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 3 locations. Consider refactoring.
              Open

              const versionCommand = () => {
                const packageName = "webpack";
                const args = ["version"];
                const logMessage = "System:";
              
              
              Severity: Major
              Found in smoketests/missing-packages/webpack.test.js and 2 other locations - About 1 hr to fix
              smoketests/missing-packages/webpack.test.js on lines 45..51
              smoketests/missing-packages/webpack.test.js on lines 53..59

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

              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 3 locations. Consider refactoring.
              Open

                      case "Typescript":
                        answers.entryPoint = "./src/index.ts";
                        files.push(
                          { filePath: "tsconfig.json", fileType: "text" },
                          { filePath: answers.entryPoint as string, fileType: "text" },
              Severity: Major
              Found in packages/create-webpack-app/src/generators/init/default.ts and 2 other locations - About 1 hr to fix
              packages/create-webpack-app/src/generators/init/default.ts on lines 165..171
              packages/create-webpack-app/src/generators/init/vue.ts on lines 168..174

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

              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 3 locations. Consider refactoring.
              Open

              const infoCommand = () => {
                const packageName = "webpack";
                const args = ["info"];
                const logMessage = "System:";
              
              
              Severity: Major
              Found in smoketests/missing-packages/webpack.test.js and 2 other locations - About 1 hr to fix
              smoketests/missing-packages/webpack.test.js on lines 37..43
              smoketests/missing-packages/webpack.test.js on lines 45..51

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

              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 3 locations. Consider refactoring.
              Open

                      case "ES6":
                        answers.entryPoint = "./src/index.js";
                        files.push(
                          { filePath: "babel.config.json", fileType: "text" },
                          { filePath: answers.entryPoint as string, fileType: "text" },
              Severity: Major
              Found in packages/create-webpack-app/src/generators/init/default.ts and 2 other locations - About 1 hr to fix
              packages/create-webpack-app/src/generators/init/default.ts on lines 158..164
              packages/create-webpack-app/src/generators/init/vue.ts on lines 168..174

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

              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 3 locations. Consider refactoring.
              Open

                      case "Typescript":
                        answers.entry = "./src/main.ts";
                        files.push(
                          { filePath: "tsconfig.json", fileType: "text" },
                          { filePath: answers.entry as string, fileType: "text" },
              Severity: Major
              Found in packages/create-webpack-app/src/generators/init/vue.ts and 2 other locations - About 1 hr to fix
              packages/create-webpack-app/src/generators/init/default.ts on lines 158..164
              packages/create-webpack-app/src/generators/init/default.ts on lines 165..171

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

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

              export function generate(self: CustomGenerator): void {
                const files = ["./index.html", "./src/assets/webpack.png", "webpack.config.js", "package.json"];
              
                switch (self.answers.langType) {
                  case "Typescript":
              Severity: Minor
              Found in packages/generators/src/handlers/react.ts - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language