Showing 12 of 61 total issues
Function askFor
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
askFor() {
const done = this.async();
debug('prompting for input', this.options);
const prompts = [{
name: 'description',
- Create a ticketCreate a ticket
Function packageJson
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
packageJson() {
this.addDependencies(
'babel',
'bcryptjs',
'coffee-script',
- Create a ticketCreate a ticket
Function getCurrentUser
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
getCurrentUser() {
let promise;
if (this.state.currentUser) {
promise = Promise.resolve(this.state.currentUser.result);
} else if (this.state.currentUserPromise) {
- Read upRead up
- Create a ticketCreate a ticket
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 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (email, password, done) => {
log('authenticating user ' + email);
return Promise.resolve(true)
.then(() => Users.findByEmail(email))
.then((user) => {
- Read upRead up
- Create a ticketCreate a ticket
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 subgenerators
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
subgenerators() {
const composeLocal = (name) => {
debug('composing with generator', name);
this.composeWith(`ats-node-webapp:${name}`, {options: this.props}, {local: require.resolve(`../../${name}`)});
};
- Create a ticketCreate a ticket
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const menuItems = [
{route: '/', text: 'Home'},
{route: '/nyan', text: 'Nyan Mode'},
];
- Create a ticketCreate a ticket
Function process
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
process(dir, templateDir, context) {
fs.readdirSync(dir).forEach((file) => {
const filePath = path.join(dir, file);
const templatePath = path.join(templateDir, file);
const isDirectory = fs.statSync(filePath).isDirectory();
- Create a ticketCreate a ticket
Function packageJson
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
packageJson() {
this.addDependencies(
'body-parser',
'compression',
'cookie-parser',
- Create a ticketCreate a ticket
Function runTests
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function runTests(sourceGlob, testGlob, reportDir, reporter = DEFAULT_SPEC_REPORTER, coverageReporters = DEFAULT_COVERAGE_REPORTERS, tdd = false) {
- Create a ticketCreate a ticket
Function instrument
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function instrument(glob, title, action, dest, changedArgs) {
- Create a ticketCreate a ticket
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (value) => {
if (typeof value === 'string') {
const match = value.match(regexIso8601);
if (match) {
const milliseconds = Date.parse(match[0]);
- Read upRead up
- Create a ticketCreate a ticket
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 updateNpmScript
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function updateNpmScript(name, data) {
const pkg = this.readPackageJson();
const existing = pkg.scripts && pkg.scripts[name];
let result = null;
- Read upRead up
- Create a ticketCreate a ticket
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"