Showing 12 of 32 total issues
Function prompting
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
prompting: function () {
if (this.skipConfig) { return ; }
var done = this.async();
Function prompting
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
prompting: function () {
if (this.skipConfig) { return ; }
var done = this.async();
Function prompting
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
prompting: function () {
var done = this.async();
this.instanceName = _.camelize(this.name);
this.instancesName = _.camelize(this.name) + 's';
Function writing
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
writing: function () {
mkdir.sync('client/assets/fonts/' + this.name);
if (!utils.fileExists('client/styles/fonts.scss')) {
Function prompting
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
prompting: function () {
var done = this.async();
this.types = {};
Function writing
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
writing: function () {
var filters = this.config.get('filters');
var filesByBackendType = {
mongo: ['controller.js', 'model.js'],
Function rewrite
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
rewrite: function (args) {
// check if splicable is already in the body text
var re = new RegExp(args.splicable.map(function (line) {
return '\s*' + escapeRegExp(line);
}).join('\n'));
Function writing
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
writing: function () {
var basePath = 'client/views/' + this.dashName + '/' + this.dashName;
this.template('index.js', basePath + '.js');
Function processDirectory
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
processDirectory: function (self, source, destination) {
var root = isPathAbsolute(source) ? source : path.join(self.sourceRoot(), source);
var files = glob.sync('**', { dot: true, nodir: true, cwd: root });
var dest, src;
Function appendOnTop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
appendOnTop: function (opts, cb) {
fs.readFile(opts.dest, function (err, data) {
if (err) { return cb(err, null); }
fs.writeFile(opts.dest, opts.append + '\n', function (err) {
if (err) { return cb(err, 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 writing
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
writing: function () {
var basePath = 'client/directives/' + this.dashName + '/' + this.dashName;
this.template('directive.js', basePath + '.directive.js');
- 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 isAuthenticated
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.isAuthenticated = function () {
return compose()
.use(validateJwt)
.use(function (req, res, 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"