webpack/webpack

View on GitHub

Showing 1,316 of 2,044 total issues

File JavascriptParser.js has 2748 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

    Function visitModules has a Cognitive Complexity of 356 (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

    Function exports has a Cognitive Complexity of 336 (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

    Function createSnapshot has a Cognitive Complexity of 330 (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 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 Compilation.js has 2082 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 5 days to fix

      Function codeGeneration has a Cognitive Complexity of 197 (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 1486 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 3 days to fix

        Function initializeEvaluating has 777 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 3 days to fix

          File FileSystemInfo.js has 1421 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 3 days to fix

            Function apply has 630 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 _checkSnapshotValidNoCache has a Cognitive Complexity of 150 (exceeds 5 allowed). Consider refactoring.
              Open

                  _checkSnapshotValidNoCache(snapshot, callback) {
                      let callbacks;
                      const {
                          startTime,
                          fileTimestamps,
              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

              File DefaultStatsFactoryPlugin.js has 1159 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 2 days to fix

                File DefaultStatsPrinterPlugin.js has 1074 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

                  Function process has 537 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      process(options, compiler) {
                          compiler.outputPath = options.output.path;
                          compiler.recordsInputPath = options.recordsInputPath || null;
                          compiler.recordsOutputPath = options.recordsOutputPath || null;
                          compiler.name = options.name;
                  Severity: Major
                  Found in lib/WebpackOptionsApply.js - About 2 days to fix

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

                    const SIMPLE_PRINTERS = {
                        "compilation.hash": (hash, { bold, type }) =>
                            type === "compilation.hash" ? `Hash: ${bold(hash)}` : undefined,
                        "compilation.version": (version, { bold, type }) =>
                            type === "compilation.version"
                    Severity: Major
                    Found in lib/stats/DefaultStatsPrinterPlugin.js - About 2 days to fix

                      Function visitModules has 495 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

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

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

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

                            File SplitChunksPlugin.js has 905 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

                              Function getArguments has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const getArguments = (schema = webpackSchema) => {
                                  /** @type {Record<string, Argument>} */
                                  const flags = {};
                              
                                  const pathToArgumentName = input => {
                              Severity: Minor
                              Found in lib/cli.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

                              Severity
                              Category
                              Status
                              Source
                              Language