Showing 31 of 39 total issues
Function buildHelper
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function buildHelper(particleName, options) {
var opts = _.merge({
wrapLogicalId: true
},options);
- 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 condense
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Condensation.prototype.condense = function condense() {
var self = this;
var options = this.options;
var gulp = this.gulp;
Function buildHelper
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function buildHelper(particleName, options) {
var opts = _.merge({
wrapLogicalId: true
},options);
Function exports
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(s3opts,distPath,awsS3) {
var self = this;
var templateData = {};
var urlString = [awsS3.endpoint.href,path.posix.join(s3opts.aws.bucket,s3opts.prefix)].join('');
Function helper
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
var helper = function(cModule,pPath,hArgs,hOpts,cOpts) {
var engine = cOpts.handlebars;
var data = cOpts.handlebars.createFrame(hOpts.data || {});
Function loadParticle
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
ParticleLoader.prototype.loadParticle = function(type,cModule,pPath,options) {
var loadError = new VError("particle load error");
var opts = _.merge({
parentFile: null,
- 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 stream
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
var stream = es.readable(function(esCount,streamCb) {
var readable = this;
var totalCount = 0;
var lastTotalCount = 0;
Function loadParticle
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
ParticleLoader.prototype.loadParticle = function(type,cModule,pPath,options) {
var loadError = new VError("particle load error");
var opts = _.merge({
parentFile: null,
Function processTemplate
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
var processTemplate = function(conf) {
var engine = conf.cOpts.handlebars;
var templateContent = '';
Function runStreams
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
var runStreams = function(globs,options) {
var s = gulp.src(globs,options)
.pipe(cache(self.options.projectName+distPath))
.pipe(through.obj(function(file,enc,cb) {
file._templateFormat = cUtil.detectFormat({
Function loadHelper
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
var loadHelper = function(helperDefinition,options) {
var cOpts = _.merge({
handlebars: Handlebars,
projectDir: process.cwd(),
particleLoader: null,
- 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 layout
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var helper = function layout(cModule,pPath,hArgs,hOpts,cOpts) {
var engine = cOpts.handlebars;
var data = engine.createFrame(hOpts.data || {});
data._isLayout = true;
Function exports
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(options) {
var helpers = {
arrayify: require('../template-helpers/arrayify'),
assetPath: loadTemplateHelper(require('../template-helpers/assetPath'),options),
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(s3opts,distPath,awsS3) {
var self = this;
var templateData = {};
var urlString = [awsS3.endpoint.href,path.posix.join(s3opts.aws.bucket,s3opts.prefix)].join('');
- 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 validator
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validator(opts) {
var cloudformation = new AWS.CloudFormation(opts);
// creating a stream through which each file will pass
var stream = through.obj(function(file, enc, cb) {
var retry = backoff.exponential();
Function loadHelper
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var loadHelper = function(helperDefinition,options) {
var cOpts = _.merge({
handlebars: Handlebars,
projectDir: process.cwd(),
particleLoader: null,
Function ParticleLoader
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ParticleLoader = function(options) {
this.root = options.root;
this.registry = {};
this.typeMap = {
'asset': 'assets',
Function stream
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var stream = through.obj(function(file, enc, cb) {
var retry = backoff.exponential();
retry.failAfter(20);
retry.on('ready', function(number,delay) {
Function parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.parse = function parse(str,options) {
var opts = _.merge({}, options);
if (_.isPlainObject(str)) {
- 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 cValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function cValue(str,options) {
options = _.merge({
hash: {
forceNumber: false
}
- 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"