trailsjs/generator-node

View on GitHub

Showing 7 of 13 total issues

Function default has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  default: function () {
    if (this.options.travis) {
      this.composeWith('travis', {}, {
        local: require.resolve('generator-travis/generators/app')
      });
Severity: Major
Found in generators/app/index.js - About 2 hrs to fix

    File index.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    var _ = require('lodash');
    var extend = _.merge;
    var generators = require('yeoman-generator');
    var parseAuthor = require('parse-author');
    Severity: Minor
    Found in generators/app/index.js - About 2 hrs to fix

      Function constructor has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor: function () {
          generators.Base.apply(this, arguments);
      
          this.option('travis', {
            type: Boolean,
      Severity: Major
      Found in generators/app/index.js - About 2 hrs to fix

        Function askFor has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            askFor: function () {
              var prompts = [{
                name: 'description',
                message: 'Description',
                when: !this.props.description
        Severity: Minor
        Found in generators/app/index.js - About 1 hr to fix

          Function package has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              package: function () {
                var pkg = this.fs.readJSON(this.destinationPath(this.options.generateInto, 'package.json'), {});
          
                extend(pkg, {
                  devDependencies: {
          Severity: Minor
          Found in generators/gulp/index.js - About 1 hr to fix

            Function constructor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor: function () {
                generators.Base.apply(this, arguments);
            
                this.option('generateInto', {
                  type: String,
            Severity: Minor
            Found in generators/gulp/index.js - About 1 hr to fix

              Function default has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                default: function () {
                  if (this.options.travis) {
                    this.composeWith('travis', {}, {
                      local: require.resolve('generator-travis/generators/app')
                    });
              Severity: Minor
              Found in generators/app/index.js - About 35 mins to fix

              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

              Severity
              Category
              Status
              Source
              Language