kennethlynne/generator-angular-xl

View on GitHub

Showing 11 of 34 total issues

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

module.exports = function (grunt) {
  require('load-grunt-tasks')(grunt);
  require('time-grunt')(grunt);

  var includes = require('./resources.json');
Severity: Major
Found in templates/common/Gruntfile.js - About 2 days to fix

    File Gruntfile.js has 512 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
    'use strict';
    var path = require('path');
    
    module.exports = function (grunt) {
    Severity: Major
    Found in templates/common/Gruntfile.js - About 1 day to fix

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

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

        Function Generator has 52 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: Major
        Found in script-base.js - About 2 hrs to fix

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

          module.exports = function (grunt) {
            require('load-grunt-tasks')(grunt);
          
            grunt.initConfig({
              pkg: grunt.file.readJSON('package.json'),
          Severity: Minor
          Found in Gruntfile.js - About 1 hr to fix

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

            module.exports = function (config) {
            
              var preprocessors = {},
                mapAppPath = function (path) {
                  return appPath + '/' + path;
            Severity: Minor
            Found in templates/common/root/karma.conf.js - About 1 hr to fix

              Function Generator has 28 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: Minor
              Found in app/index.js - About 1 hr to fix

                Function Generator has a Cognitive Complexity of 9 (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 55 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 generateSourceAndTest has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                Generator.prototype.generateSourceAndTest = function (appTemplate, testTemplate, targetDirectory, testTargetDirectory, targetFilename) {
                Severity: Minor
                Found in script-base.js - About 35 mins to fix

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

                  angular.deepExtend = function (destination, source) {
                    for (var property in source) {
                      if (source[property] && source[property].constructor && source[property].constructor === Object) {
                        destination[property] = destination[property] || {};
                        angular.deepExtend(destination[property], source[property]);
                  Severity: Minor
                  Found in templates/javascript/framework/deepExtend.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

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

                  module.exports = function (grunt) {
                    require('load-grunt-tasks')(grunt);
                    require('time-grunt')(grunt);
                  
                    var includes = require('./resources.json');
                  Severity: Minor
                  Found in templates/common/Gruntfile.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