Showing 7 of 13 total issues
Function default
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
default: function () {
if (this.options.travis) {
this.composeWith('travis', {}, {
local: require.resolve('generator-travis/generators/app')
});
File index.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
var _ = require('lodash');
var extend = _.merge;
var generators = require('yeoman-generator');
var parseAuthor = require('parse-author');
Function constructor
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function () {
generators.Base.apply(this, arguments);
this.option('travis', {
type: Boolean,
Function askFor
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
askFor: function () {
var prompts = [{
name: 'description',
message: 'Description',
when: !this.props.description
Function package
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
package: function () {
var pkg = this.fs.readJSON(this.destinationPath(this.options.generateInto, 'package.json'), {});
extend(pkg, {
devDependencies: {
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function () {
generators.Base.apply(this, arguments);
this.option('generateInto', {
type: String,
Function default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
default: function () {
if (this.options.travis) {
this.composeWith('travis', {}, {
local: require.resolve('generator-travis/generators/app')
});
- 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"