Showing 16 of 42 total issues
Function exports
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
// load all grunt tasks
require('load-grunt-tasks')(grunt);
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);
File Gruntfile.js
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jslint node: true */
'use strict';
var pkg = require('./package.json');
var _ = require('./package.json');
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 askFor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
ServiceGenerator.prototype.askFor = function askFor() {
var cb = this.async();
var that = this;
var prompts = [{
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
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 askFor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
ModuleGenerator.prototype.askFor = function askFor() {
var cb = this.async();
var that = this;
var modulePath = that.name ? that.name.split('.') : [];
Function decode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
decode: function (input) {
var output = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = "";
var i = 0;
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 encode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
encode: function (input) {
var output = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = "";
var i = 0;
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 askFor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ModuleGenerator.prototype.askFor = function askFor() {
var cb = this.async();
var that = this;
var modulePath = that.name ? that.name.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 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"