Function askForDir
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.askForDir = function(type,that,module,ownDir,cb){
that.module = module;
that.appname = module.name;
that.dir = path.dirname(module.file);
Function askForDir
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
exports.askForDir = function(type,that,module,ownDir,cb){
that.module = module;
that.appname = module.name;
that.dir = path.dirname(module.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 dirPromptCallback
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var dirPromptCallback = function (props) {
that.dir = path.join(props.dir,'/');
var dirToCreate = that.dir;
if (ownDir){
Function getParentModule
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.getParentModule = function(dir){
//starting this dir, find the first module and return parsed results
if (fs.existsSync(dir)) {
var files = fs.readdirSync(dir);
for (var i = 0; i < files.length; i++) {
- 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 processTemplates
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.processTemplates = function(name,dir,type,that,defaultDir,configName,module){
Function injectRoute
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.injectRoute = function(moduleFile,uirouter,name,route,routeUrl,that){
Function askForDir
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.askForDir = function(type,that,module,ownDir,cb){
Function inject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.inject = function(filename,that,module) {
//special case to skip unit tests
if (_(filename).endsWith('.spec.js')) { return; }
if (_(filename).startsWith(APP_FOLDER)) {
- 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"