amercier/generator-angular-php

View on GitHub

Showing 11 of 28 total issues

Function Generator has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Generator = module.exports = function Generator(args, options) {
  yeoman.generators.Base.apply(this, arguments);
  this.argument('appname', { type: String, required: false });
  this.appname = this.appname || path.basename(process.cwd());
  this.appname = this._.camelize(this._.slugify(this._.humanize(this.appname)));
Severity: Major
Found in app/index.js - About 3 hrs to fix

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

    'use strict';
    var fs = require('fs');
    var path = require('path');
    var util = require('util');
    var angularUtils = require('../util.js');
    Severity: Minor
    Found in app/index.js - About 3 hrs to fix

      Function exports has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function (grunt) {
        require('load-grunt-tasks')(grunt);
      
        grunt.initConfig({
          pkg: require('./package.json'),
      Severity: Major
      Found in Gruntfile.js - About 2 hrs to fix

        Function askForModules has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Generator.prototype.askForModules = function askForModules() {
          var cb = this.async();
        
          var prompts = [{
            type: 'checkbox',
        Severity: Major
        Found in app/index.js - About 2 hrs to fix

          Function Generator has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          var Generator = module.exports = function Generator() {
            yeoman.generators.NamedBase.apply(this, arguments);
          
            try {
              this.appname = require(path.join(process.cwd(), 'bower.json')).name;
          Severity: Minor
          Found in script-base.js - About 2 hrs 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

          Function Generator has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var Generator = module.exports = function Generator() {
            yeoman.generators.NamedBase.apply(this, arguments);
          
            try {
              this.appname = require(path.join(process.cwd(), 'bower.json')).name;
          Severity: Minor
          Found in script-base.js - About 1 hr to fix

            Function Generator has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            var Generator = module.exports = function Generator(args, options) {
              yeoman.generators.Base.apply(this, arguments);
              this.argument('appname', { type: String, required: false });
              this.appname = this.appname || path.basename(process.cwd());
              this.appname = this._.camelize(this._.slugify(this._.humanize(this.appname)));
            Severity: Minor
            Found in app/index.js - About 1 hr 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

            Function rewriteAppJs has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Generator.prototype.rewriteAppJs = function () {
              var coffee = this.env.options.coffee;
            
              if (!this.foundWhenForRoute) {
                this.on('end', function () {
            Severity: Minor
            Found in route/index.js - About 1 hr to fix

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

              var Generator = module.exports = function Generator() {
                yeoman.generators.NamedBase.apply(this, arguments);
              
                this.sourceRoot(path.join(__dirname, '../templates/common'));
              
              
              Severity: Minor
              Found in view/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

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

              var Generator = module.exports = function Generator(args, options) {
                ScriptBase.apply(this, arguments);
                this.fileName = this.name;
              
                if (typeof this.env.options.appPath === 'undefined') {
              Severity: Minor
              Found in decorator/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

              Function rewriteAppJs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              Generator.prototype.rewriteAppJs = function () {
                var coffee = this.env.options.coffee;
              
                if (!this.foundWhenForRoute) {
                  this.on('end', function () {
              Severity: Minor
              Found in route/index.js - About 25 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