Showing 14 of 41 total issues
File index.js
has 539 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var path = require('path');
var generators = require('yeoman-generator');
var _ = require('lodash');
var chalk = require('chalk');
Function projectFiles
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
projectFiles: function() {
this.npmPackages = null;
var done = this.async();
if (this.Tasks.length <= 0) {
this.log(chalk.bold.yellow('You didn\'t select any gulp task'));
Function constructor
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor: function() {
generators.Base.apply(this, arguments);
this.allTasks = [
'lint',
Function exports
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function() {
var readTextFile = function(filename) {
var body = fs.readFileSync(filename, 'utf8');
return body;
};
Function askFor
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
askFor: function() {
var done = this.async();
var choices = this.allFiles.map(function(file) {
Function askFor
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
askFor: function() {
var done = this.async();
var that = this;
var choices = this.allTasks.map(function(task) {
File gulps.tests.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var path = require('path');
var helpers = require('yeoman-generator').test;
var testHelper = require('./testHelper')();
Function projectFiles
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
projectFiles: function() {
this.npmPackages = null;
var done = this.async();
if (this.Tasks.length <= 0) {
this.log(chalk.bold.yellow('You didn\'t select any gulp task'));
- 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 askForGithub
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
askForGithub: function() {
var done = this.async();
var that = this;
var prompts = [{
name: 'githubUser',
Function install
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
install: function() {
if (!this.npmPackages) {
return;
}
Function projectFiles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var projectFiles = function(done, expectedTasks, assertNoFile) {
assertNoFile = assertNoFile !== false;
// always tranform the argument into an array
expectedTasks = expectedTasks ? [].concat(expectedTasks) : [];
Function projectFiles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
projectFiles: function() {
this.sourceRoot(path.join(__dirname, '../templates/app'));
// if (this.Jshintrc) {
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
askFor: function() {
var done = this.async();
var choices = this.allFiles.map(function(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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function() {
var readTextFile = function(filename) {
var body = fs.readFileSync(filename, 'utf8');
return body;
};
- 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"