webpack/webpack

View on GitHub

Showing 1,592 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

        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

                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

                        JavascriptParser has 129 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class JavascriptParser extends Parser {
                            /**
                             * @param {"module" | "script" | "auto"} sourceType default source type
                             */
                            constructor(sourceType = "auto") {
                        Severity: Major
                        Found in lib/javascript/JavascriptParser.js - About 2 days to fix

                          File ExportsInfo.js has 986 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/ExportsInfo.js - About 2 days to fix

                            Function optimize has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring.
                            Open

                                optimize(capturedFiles, startTime, children) {
                                    /** @type {Set<string>} */
                                    const unsetOptimizationEntries = new Set();
                                    /** @type {Set<SnapshotOptimizationEntry>} */
                                    const checkedOptimizationEntries = new Set();
                            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

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

                                apply(compiler) {
                                    const runtimeRequirements = [RuntimeGlobals.module];
                            
                                    const createAcceptHandler = (parser, ParamDependency) => {
                                        const {
                            Severity: Major
                            Found in lib/HotModuleReplacementPlugin.js - About 2 days to fix
                              Severity
                              Category
                              Status
                              Source
                              Language