File linker.js
has 746 lines of code (exceeds 250 allowed). Consider refactoring. Open
var _ = require('underscore');
var sourcemap = require('source-map');
var buildmessage = require('../utils/buildmessage.js');
var watch = require('../fs/watch');
var Profile = require('../tool-env/profile').Profile;
Function getPrelinkedFiles
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPrelinkedFiles: Profile("linker Module#getPrelinkedFiles", function () {
var self = this;
const haveMeteorInstallOptions =
self.files.some(file => file.meteorInstallOptions);
Function getPrelinkedOutputCached
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function (file, options) {
var width = options.sourceWidth || 70;
var bannerWidth = width + 3;
var preserveLineNumbers = options.preserveLineNumbers;
- Read upRead up
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 getPrelinkedOutputCached
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function (file, options) {
var width = options.sourceWidth || 70;
var bannerWidth = width + 3;
var preserveLineNumbers = options.preserveLineNumbers;
Function _buildModuleTrees
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
_buildModuleTrees(results, sourceWidth) {
// Map from meteorInstallOptions objects to trees of File objects for
// all non-dynamic modules.
const trees = new Map;
Function _chunkifyModuleTrees
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_chunkifyModuleTrees(trees, chunks, sourceWidth) {
const self = this;
assert.ok(_.isArray(chunks));
assert.ok(_.isNumber(sourceWidth));
Function computeAssignedVariables
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
computeAssignedVariables: Profile("linker File#computeAssignedVariables", function () {
var self = this;
if (self.absModuleId) {
const parts = self.absModuleId.split("/");
Function computeAssignedVariables
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
computeAssignedVariables: Profile("linker File#computeAssignedVariables", function () {
var self = this;
if (self.absModuleId) {
const parts = self.absModuleId.split("/");
- Read upRead up
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 _chunkifyEagerRequires
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_chunkifyEagerRequires(chunks, moduleCount, sourceWidth) {
assert.ok(_.isArray(chunks));
assert.ok(_.isNumber(moduleCount));
assert.ok(_.isNumber(sourceWidth));
Function walk
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function walk(t) {
if (Array.isArray(t)) {
++moduleCount;
chunks.push(JSON.stringify(t, null, 2));
Function _chunkifyModuleTrees
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_chunkifyModuleTrees(trees, chunks, sourceWidth) {
const self = this;
assert.ok(_.isArray(chunks));
assert.ok(_.isNumber(sourceWidth));
- Read upRead up
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 fullLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export var fullLink = Profile("linker.fullLink", function (inputFiles, {
// True if we're linking the application (as opposed to a
// package). Among other consequences, this makes the top level
// namespace be the same as the global namespace, so that symbols are
// accessible from the console, and avoids actually combining files into
- Read upRead up
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 _getClosureHeader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_getClosureHeader() {
if (this.meteorInstallOptions) {
const headerParts = ["function module("];
if (this.source.match(/\b__dirname\b/)) {
- Read upRead up
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 getFooter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var getFooter = function ({
name,
exported,
exportsName,
}) {
- Read upRead up
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"