Showing 22 of 26 total issues
Function exports
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(targetPath, exports) {
var modules = [];
var builder;
var exportsIds = {};
exports = exports || [];
- 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 exports
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(targetPath, exports) {
var modules = [];
var builder;
var exportsIds = {};
exports = exports || [];
Function astRequireFinder
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function astRequireFinder (options){
return function (node) {
//jshint validthis:true
var file = this;
Function end
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, function end() {
var stream = this;
if (cachedTemplate) {
applyTemplate(cachedTemplate);
Function repipeRequirement
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function repipeRequirement(adapter) {
var builder;
return through2.obj(function loadRequired(file, enc, next) {
if (!file.requires) {
this.push(file);
Function createBundle
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createBundle(output, sourceFileGlob) {
var outputPath = path.resolve(process.cwd(), output);
winston.info('Reading source files ', sourceFileGlob);
winston.info('Writing result to ', outputPath);
Function loadRequired
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
return through2.obj(function loadRequired(file, enc, next) {
if (!file.requires) {
this.push(file);
return next();
}
Function astVisitor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function astVisitor(visitors) {
if (typeof visitors === 'function') {
visitors = [visitors];
}
return through2.obj(function visit(file, enc, next) {
Function repipeRequirement
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function repipeRequirement(adapter) {
var builder;
return through2.obj(function loadRequired(file, enc, next) {
if (!file.requires) {
this.push(file);
- 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 astParser
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function astParser(options) {
options = options || {loc:true};
options.loc = 'loc' in options ? options.loc : true;
options.parsers = options.parsers || {
js: parseJs,
- 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 applyTemplate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyTemplate(template) {
try {
var file = new File({
path: targetPath
});
Function runProgram
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runProgram(er, data) {
if (er) {
winston.error('There was an error reading the file ' + packagePath + '\n\n' + er.stack);
return;
}
Function astParser
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function astParser(options) {
options = options || {loc:true};
options.loc = 'loc' in options ? options.loc : true;
options.parsers = options.parsers || {
js: parseJs,
Function astVisitor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function astVisitor(visitors) {
if (typeof visitors === 'function') {
visitors = [visitors];
}
return through2.obj(function visit(file, enc, next) {
- 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 visit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
return through2.obj(function visit(file, enc, next) {
var _this = this;
winston.verbose('astVisitor -> ', file && file.path);
if (file.isNull()) {
_this.push(file); // pass along
Function assignModuleId
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function assignModuleId() {
var id = 0;
var allFiles = [];
return through(function write(file) {
Function modulesBuilder
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modulesBuilder() {
var builder = {
rootModules:{},
modules:{},
resolved:{},
Function visit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
.pipe(through2.obj(function visit(file, enc, next) {
if (file.isNull()) {
this.push(file); // pass along
return next();
}
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function() {
return through2.obj(function visit(file, enc, next) {
var stream = this;
if (file.isNull()) {
- 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 astRequiresReplacer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function astRequiresReplacer(node) {
//jshint validthis:true
var file = this;
if (!file.requires) {
file.requires = {
- 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"