webpack/webpack

View on GitHub

Showing 2,430 of 2,430 total issues

Function visitModules has a Cognitive Complexity of 542 (exceeds 5 allowed). Consider refactoring.
Open

const visitModules = (
    logger,
    compilation,
    inputEntrypointsAndModules,
    chunkGroupInfoMap,
Severity: Minor
Found in lib/buildChunkGraph.js - About 1 wk 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

File JavascriptParser.js has 2975 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
    MIT License http://www.opensource.org/licenses/mit-license.php
    Author Tobias Koppers @sokra
*/

Severity: Major
Found in lib/javascript/JavascriptParser.js - About 1 wk to fix

    File Compilation.js has 2445 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
        MIT License http://www.opensource.org/licenses/mit-license.php
        Author Tobias Koppers @sokra
    */
    
    
    Severity: Major
    Found in lib/Compilation.js - About 6 days to fix

      Function exports has a Cognitive Complexity of 327 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function () {
          var currentUpdateChunks;
          var currentUpdate;
          var currentUpdateRemovedChunks;
          var currentUpdateRuntime;
      Severity: Minor
      Found in lib/hmr/JavascriptHotModuleReplacement.runtime.js - About 6 days 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

      File FileSystemInfo.js has 2221 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
          MIT License http://www.opensource.org/licenses/mit-license.php
          Author Tobias Koppers @sokra
      */
      
      
      Severity: Major
      Found in lib/FileSystemInfo.js - About 6 days to fix

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

        class StackedMap {
            /**
             * @param {Map<K, InternalCell<V>>[]=} parentStack an optional parent
             */
            constructor(parentStack) {
        Severity: Major
        Found in lib/util/StackedSetMap.js and 1 other location - About 5 days to fix
        lib/util/StackedMap.js on lines 41..164

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

        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

        class StackedMap {
            /**
             * @param {Map<K, InternalCell<V>>[]=} parentStack an optional parent
             */
            constructor(parentStack) {
        Severity: Major
        Found in lib/util/StackedMap.js and 1 other location - About 5 days to fix
        lib/util/StackedSetMap.js on lines 41..164

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

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

            _initializeEvaluating() {
                this.hooks.evaluate.for("Literal").tap("JavascriptParser", _expr => {
                    const expr = /** @type {LiteralNode} */ (_expr);
        
                    switch (typeof expr.value) {
        Severity: Major
        Found in lib/javascript/JavascriptParser.js - About 4 days to fix

          File DefaultStatsFactoryPlugin.js has 1654 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
              MIT License http://www.opensource.org/licenses/mit-license.php
              Author Tobias Koppers @sokra
          */
          
          
          Severity: Major
          Found in lib/stats/DefaultStatsFactoryPlugin.js - About 4 days to fix

            Function codeGeneration has a Cognitive Complexity of 204 (exceeds 5 allowed). Consider refactoring.
            Open

                codeGeneration({
                    dependencyTemplates,
                    runtimeTemplate,
                    moduleGraph,
                    chunkGraph,
            Severity: Minor
            Found in lib/optimize/ConcatenatedModule.js - About 4 days 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

            File ConcatenatedModule.js has 1506 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
                MIT License http://www.opensource.org/licenses/mit-license.php
                Author Tobias Koppers @sokra
            */
            
            
            Severity: Major
            Found in lib/optimize/ConcatenatedModule.js - About 4 days to fix

              Function _checkSnapshotValidNoCache has a Cognitive Complexity of 179 (exceeds 5 allowed). Consider refactoring.
              Open

                  _checkSnapshotValidNoCache(snapshot, callback) {
                      /** @type {number | undefined} */
                      let startTime = undefined;
                      if (snapshot.hasStartTime()) {
                          startTime = snapshot.startTime;
              Severity: Minor
              Found in lib/FileSystemInfo.js - About 3 days 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 visitModules has 707 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const visitModules = (
                  logger,
                  compilation,
                  inputEntrypointsAndModules,
                  chunkGroupInfoMap,
              Severity: Major
              Found in lib/buildChunkGraph.js - About 3 days to fix

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

                        if (files) {
                            const capturedFiles = captureNonManaged(files, managedFiles);
                            switch (mode) {
                                case 3:
                                    unsharedFileTshs = this._fileTshsOptimization.optimize(
                Severity: Major
                Found in lib/FileSystemInfo.js and 1 other location - About 3 days to fix
                lib/FileSystemInfo.js on lines 1674..1767

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

                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

                        if (directories) {
                            const capturedDirectories = captureNonManaged(
                                directories,
                                managedContexts
                            );
                Severity: Major
                Found in lib/FileSystemInfo.js and 1 other location - About 3 days to fix
                lib/FileSystemInfo.js on lines 1583..1673

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

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

                    apply(compiler) {
                        const cachedContextify = contextify.bindContextCache(
                            compiler.context,
                            compiler.root
                        );
                Severity: Major
                Found in lib/optimize/SplitChunksPlugin.js - About 3 days to fix

                  Function createSnapshot has a Cognitive Complexity of 144 (exceeds 5 allowed). Consider refactoring.
                  Open

                      createSnapshot(startTime, files, directories, missing, options, callback) {
                          /** @type {Map<string, FileSystemInfoEntry>} */
                          const fileTimestamps = new Map();
                          /** @type {Map<string, string>} */
                          const fileHashes = new Map();
                  Severity: Minor
                  Found in lib/FileSystemInfo.js - About 2 days 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

                  SIMPLE_PRINTERS has 141 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  const SIMPLE_PRINTERS = {
                      "compilation.summary!": (
                          _,
                          {
                              type,
                  Severity: Major
                  Found in lib/stats/DefaultStatsPrinterPlugin.js - About 2 days to fix

                    File SplitChunksPlugin.js has 1071 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*
                        MIT License http://www.opensource.org/licenses/mit-license.php
                        Author Tobias Koppers @sokra
                    */
                    
                    
                    Severity: Major
                    Found in lib/optimize/SplitChunksPlugin.js - About 2 days to fix

                      File DefaultStatsPrinterPlugin.js has 1058 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*
                          MIT License http://www.opensource.org/licenses/mit-license.php
                          Author Tobias Koppers @sokra
                      */
                      
                      
                      Severity: Major
                      Found in lib/stats/DefaultStatsPrinterPlugin.js - About 2 days to fix
                        Severity
                        Category
                        Status
                        Source
                        Language