lib/generator.js
Function generateRun
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generateRun(projects, tmpls, names, fn) {
async.each(
projects,
function(project, next) {
generator.fs
Function generateScaffold
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generateScaffold(project, name, filterOut, fn) {
var _path = path.join(__dirname, '..', 'templates', project.name)
, walk = require('findit')(_path)
, dirs = []
, files = []
Function scaffold
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.scaffold = function(name, filterOut, fn) {
name = Array.isArray(name) ? name : [ name ];
filterOut = Array.isArray(filterOut) ? filterOut : [];
// Just for easability, we'll add an 's' to the end of the filters to cover a quasi-plural form
Function generate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.generate = function(project, tmpls, names, fn) {
if (arguments.length < 4) {
fn = names;
names = tmpls;
tmpls = project;
- 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"