meteor/meteor

View on GitHub
tools/isobuild/bundler.js

Summary

Maintainability
F
2 wks
Test Coverage

File bundler.js has 2127 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// == Site Archive (*.star) file layout (subject to rapid change) ==
//
// /star.json
//
//  - format: "site-archive-pre1" for this version
Severity: Major
Found in tools/isobuild/bundler.js - About 5 days to fix

    Function load has 169 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      load(bindings) {
        var self = this;
        var ret = new PackageRegistry();
    
        // XXX This is mostly duplicated from
    Severity: Major
    Found in tools/isobuild/bundler.js - About 6 hrs to fix

      Function _emitResources has 161 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _emitResources(sourceBatches, onJsOutputFiles = () => {}) {
          buildmessage.assertInJob();
      
          const isWeb = archinfo.matches(this.arch, 'web');
          const isOs = archinfo.matches(this.arch, 'os');
      Severity: Major
      Found in tools/isobuild/bundler.js - About 6 hrs to fix

        Function write has 132 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          write(builder, {
            buildMode,
            // falsy or 'symlink', documented on exports.bundle
            includeNodeModules,
          } = {}) {
        Severity: Major
        Found in tools/isobuild/bundler.js - About 5 hrs to fix

          Function write has 122 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            write(builder, {minifyMode, buildMode}) {
              builder.reserve("program.json");
          
              // Helper to iterate over all resources that we serve over HTTP.
              const eachResource = function (f) {
          Severity: Major
          Found in tools/isobuild/bundler.js - About 4 hrs to fix

            Function getProdPackagePredicate has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

              getProdPackagePredicate() {
                if (this._prodPackagePredicate) {
                  return this._prodPackagePredicate;
                }
            
            
            Severity: Minor
            Found in tools/isobuild/bundler.js - 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 minifyJs has 91 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              minifyJs(minifierDef, minifyMode) {
                const staticFiles = [];
                const dynamicFiles = [];
                const { arch } = this;
                const inputHashesByJsFile = new Map;
            Severity: Major
            Found in tools/isobuild/bundler.js - About 3 hrs to fix

              Function _determineLoadOrder has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _determineLoadOrder({packages}) {
                  buildmessage.assertInCapture();
              
                  const isopackCache = this.isopackCache;
              
              
              Severity: Major
              Found in tools/isobuild/bundler.js - About 3 hrs to fix

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

                  write(builder, {
                    buildMode,
                    // falsy or 'symlink', documented in exports.bundle
                    includeNodeModules,
                  }) {
                Severity: Major
                Found in tools/isobuild/bundler.js - About 2 hrs to fix

                  Function _makeNpmRequire has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                    _makeNpmRequire(nodeModulesDirsByPackageName) {
                      function npmRequire(id) {
                        return require(npmResolve(id));
                      }
                  
                  
                  Severity: Minor
                  Found in tools/isobuild/bundler.js - 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 getProdPackagePredicate has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    getProdPackagePredicate() {
                      if (this._prodPackagePredicate) {
                        return this._prodPackagePredicate;
                      }
                  
                  
                  Severity: Major
                  Found in tools/isobuild/bundler.js - About 2 hrs to fix

                    Function getPreferredBundlePath has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                      getPreferredBundlePath(kind) {
                        assert.ok(kind === "bundle" ||
                                  kind === "isopack",
                                  kind);
                    
                    
                    Severity: Minor
                    Found in tools/isobuild/bundler.js - 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 handle has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function handle(source, dynamic) {
                          // Allows minifiers to be compatible with HMR without being
                          // updated to support it.
                          // In development most minifiers add the file to itself with no
                          // modifications, and we can safely assume that the file
                    Severity: Major
                    Found in tools/isobuild/bundler.js - About 2 hrs to fix

                      Function readDirsFromJSON has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        static readDirsFromJSON(node_modules, {
                          rebuildBinaries = false,
                          // Options consumed by readDirsFromJSON are listed above. Any other
                          // options will be passed on to NodeModulesDirectory constructor via
                          // this callerInfo object:
                      Severity: Major
                      Found in tools/isobuild/bundler.js - About 2 hrs to fix

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

                          static readDirsFromJSON(node_modules, {
                            rebuildBinaries = false,
                            // Options consumed by readDirsFromJSON are listed above. Any other
                            // options will be passed on to NodeModulesDirectory constructor via
                            // this callerInfo object:
                        Severity: Minor
                        Found in tools/isobuild/bundler.js - 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 load has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                          load(bindings) {
                            var self = this;
                            var ret = new PackageRegistry();
                        
                            // XXX This is mostly duplicated from
                        Severity: Minor
                        Found in tools/isobuild/bundler.js - 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 _runCompilerPlugins has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          _runCompilerPlugins({
                            minifiers = [],
                            minifyMode = "development",
                          }) {
                            buildmessage.assertInJob();
                        Severity: Minor
                        Found in tools/isobuild/bundler.js - About 2 hrs to fix

                          Function _makeNpmRequire has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            _makeNpmRequire(nodeModulesDirsByPackageName) {
                              function npmRequire(id) {
                                return require(npmResolve(id));
                              }
                          
                          
                          Severity: Minor
                          Found in tools/isobuild/bundler.js - About 1 hr to fix

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

                              make({packages, minifyMode, addCacheBusters, minifiers, onJsOutputFiles = () => {}}) {
                                buildmessage.assertInCapture();
                            
                                buildmessage.enterJob("building for " + this.arch, () => {
                                  // Populate the list of unibuilds to load
                            Severity: Minor
                            Found in tools/isobuild/bundler.js - About 1 hr to fix

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

                                static readFromDisk (controlFilePath) {
                                  var ret = new JsImage;
                                  var json = JSON.parse(files.readFile(controlFilePath));
                                  var dir = files.pathDirname(controlFilePath);
                              
                              
                              Severity: Minor
                              Found in tools/isobuild/bundler.js - About 1 hr to fix

                                Function npmResolve has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function npmResolve(id) {
                                      if (id in resolveCache) {
                                        return resolveCache[id];
                                      }
                                
                                
                                Severity: Minor
                                Found in tools/isobuild/bundler.js - About 1 hr to fix

                                  Function add has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function add(moreInfo, path) {
                                        const info = {
                                          ...callerInfo,
                                          ...moreInfo,
                                        };
                                  Severity: Minor
                                  Found in tools/isobuild/bundler.js - About 1 hr to fix

                                    Function _addCordovaDependency has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      _addCordovaDependency(name, version, override) {
                                        if (! this.cordovaDependencies) {
                                          return;
                                        }
                                        const scoped = name[0] === '@';
                                    Severity: Minor
                                    Found in tools/isobuild/bundler.js - About 1 hr 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 getPreferredBundlePath has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      getPreferredBundlePath(kind) {
                                        assert.ok(kind === "bundle" ||
                                                  kind === "isopack",
                                                  kind);
                                    
                                    
                                    Severity: Minor
                                    Found in tools/isobuild/bundler.js - About 1 hr to fix

                                      Function isWithinProdPackage has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          return this._prodPackagePredicate = function isWithinProdPackage(path) {
                                            const parts = files.pathRelative(sourcePath, path)
                                              .split(files.pathSep);
                                      
                                            // Normalize away trailing files.pathSep characters.
                                      Severity: Minor
                                      Found in tools/isobuild/bundler.js - About 1 hr to fix

                                        Function buildJsImage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        exports.buildJsImage = Profile("bundler.buildJsImage", function (options) {
                                          buildmessage.assertInCapture();
                                          if (options.npmDependencies && ! options.npmDir) {
                                            throw new Error("Must indicate .npm directory to use");
                                          }
                                        Severity: Minor
                                        Found in tools/isobuild/bundler.js - About 1 hr to fix

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

                                            constructor (options) {
                                              if (options.data && ! (options.data instanceof Buffer)) {
                                                throw new Error('File contents must be provided as a Buffer');
                                              }
                                              if (! options.sourcePath && ! options.data) {
                                          Severity: Minor
                                          Found in tools/isobuild/bundler.js - About 1 hr to fix

                                            Function add has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                  const add = function (unibuild) {
                                                    // If this has already been added, there's nothing to do.
                                                    if (!_.has(needed, unibuild.id)) {
                                                      return;
                                                    }
                                            Severity: Minor
                                            Found in tools/isobuild/bundler.js - About 1 hr to fix

                                              Function bundle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              function bundle({
                                                projectContext,
                                                outputPath,
                                                includeNodeModules,
                                                buildOptions,
                                              Severity: Minor
                                              Found in tools/isobuild/bundler.js - About 55 mins 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 rewriteSourceMaps has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                rewriteSourceMaps() {
                                                  const rewriteSourceMap = function (sm) {
                                                    sm.sources = sm.sources.map(function (path) {
                                                      const prefix = SOURCE_URL_PREFIX;
                                                      if (path.slice(0, prefix.length) === prefix) {
                                              Severity: Minor
                                              Found in tools/isobuild/bundler.js - About 45 mins 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 constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                constructor (options) {
                                                  if (options.data && ! (options.data instanceof Buffer)) {
                                                    throw new Error('File contents must be provided as a Buffer');
                                                  }
                                                  if (! options.sourcePath && ! options.data) {
                                              Severity: Minor
                                              Found in tools/isobuild/bundler.js - About 35 mins 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

                                              Avoid too many return statements within this function.
                                              Open

                                                    return true;
                                              Severity: Major
                                              Found in tools/isobuild/bundler.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                          return false;
                                                Severity: Major
                                                Found in tools/isobuild/bundler.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                            return;
                                                  Severity: Major
                                                  Found in tools/isobuild/bundler.js - About 30 mins to fix

                                                    Function _runCompilerPlugins has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                      _runCompilerPlugins({
                                                        minifiers = [],
                                                        minifyMode = "development",
                                                      }) {
                                                        buildmessage.assertInJob();
                                                    Severity: Minor
                                                    Found in tools/isobuild/bundler.js - About 25 mins 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 writeFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                    var writeFile = Profile("bundler writeFile", function (file, builder, options) {
                                                      if (! file.targetPath) {
                                                        throw new Error("No targetPath?");
                                                      }
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in tools/isobuild/bundler.js - About 25 mins 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

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

                                                        if (this.js) {
                                                          this.js.forEach(function (js) {
                                                            if (js.sourceMap) {
                                                              js.sourceMap = rewriteSourceMap(js.sourceMap);
                                                            }
                                                    Severity: Major
                                                    Found in tools/isobuild/bundler.js and 1 other location - About 1 hr to fix
                                                    tools/isobuild/bundler.js on lines 1552..1558

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

                                                    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 (this.css) {
                                                          this.css.forEach(function (css) {
                                                            if (css.sourceMap) {
                                                              css.sourceMap = rewriteSourceMap(css.sourceMap);
                                                            }
                                                    Severity: Major
                                                    Found in tools/isobuild/bundler.js and 1 other location - About 1 hr to fix
                                                    tools/isobuild/bundler.js on lines 1544..1550

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

                                                    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

                                                    [
                                                      'load',
                                                      'write'
                                                    ].forEach((method) => {
                                                      JsImage.prototype[method] = Profile(`JsImage#${method}`, JsImage.prototype[method]);
                                                    Severity: Major
                                                    Found in tools/isobuild/bundler.js and 1 other location - About 1 hr to fix
                                                    tools/isobuild/bundler.js on lines 1965..1970

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

                                                    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

                                                    [
                                                      'minifyCss',
                                                      'write'
                                                    ].forEach((method) => {
                                                      ClientTarget.prototype[method] = Profile(`ClientTarget#${method}`, ClientTarget.prototype[method]);
                                                    Severity: Major
                                                    Found in tools/isobuild/bundler.js and 1 other location - About 1 hr to fix
                                                    tools/isobuild/bundler.js on lines 2656..2661

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

                                                    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

                                                              if (resource.data && resource.sourceRoot && resource.sourcePath) {
                                                                sourcePath = files.pathJoin(resource.sourceRoot, resource.sourcePath);
                                                              }
                                                    Severity: Minor
                                                    Found in tools/isobuild/bundler.js and 1 other location - About 50 mins to fix
                                                    tools/isobuild/bundler.js on lines 1128..1130

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

                                                    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

                                                            if (resource.data && resource.sourceRoot && resource.sourcePath) {
                                                              sourcePath = files.pathJoin(resource.sourceRoot, resource.sourcePath);
                                                            }
                                                    Severity: Minor
                                                    Found in tools/isobuild/bundler.js and 1 other location - About 50 mins to fix
                                                    tools/isobuild/bundler.js on lines 1287..1289

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

                                                    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

                                                      buildmessage.enterJob('minifying app stylesheet', function () {
                                                        try {
                                                          Promise.await(markedMinifier(sources, { minifyMode }));
                                                        } catch (e) {
                                                          buildmessage.exception(e);
                                                    Severity: Minor
                                                    Found in tools/isobuild/bundler.js and 1 other location - About 50 mins to fix
                                                    tools/isobuild/compiler.js on lines 849..857

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

                                                    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

                                                    There are no issues that match your filters.

                                                    Category
                                                    Status