kennethlynne/generator-angular-xl

View on GitHub

Showing 34 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

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

          if (typeof this.env.options.appPath === 'undefined') {
              try {
                  this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
              } catch (e) {}
              this.env.options.appPath = this.env.options.appPath || 'app';
      Severity: Major
      Found in state/index.js and 4 other locations - About 4 hrs to fix
      app/index.js on lines 24..29
      component/index.js on lines 15..20
      script-base.js on lines 55..61
      script-base.js on lines 63..69

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 117.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

          if (typeof this.env.options.appPath === 'undefined') {
              try {
                  this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
              } catch (e) {
              }
      Severity: Major
      Found in script-base.js and 4 other locations - About 4 hrs to fix
      app/index.js on lines 24..29
      component/index.js on lines 15..20
      state/index.js on lines 16..21
      script-base.js on lines 63..69

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 117.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

          if (typeof this.env.options.testPath === 'undefined') {
              try {
                  this.env.options.testPath = require(path.join(process.cwd(), 'bower.json')).testPath;
              } catch (e) {
              }
      Severity: Major
      Found in script-base.js and 4 other locations - About 4 hrs to fix
      app/index.js on lines 24..29
      component/index.js on lines 15..20
      state/index.js on lines 16..21
      script-base.js on lines 55..61

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 117.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

        if (typeof this.env.options.appPath === 'undefined') {
          try {
              this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
          } catch (e) {}
          this.env.options.appPath = this.env.options.appPath || 'app';
      Severity: Major
      Found in component/index.js and 4 other locations - About 4 hrs to fix
      app/index.js on lines 24..29
      state/index.js on lines 16..21
      script-base.js on lines 55..61
      script-base.js on lines 63..69

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 117.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 5 locations. Consider refactoring.
      Open

        if (typeof this.env.options.appPath === 'undefined') {
          try {
            this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
          } catch (e) {}
          this.env.options.appPath = this.env.options.appPath || 'app';
      Severity: Major
      Found in app/index.js and 4 other locations - About 4 hrs to fix
      component/index.js on lines 15..20
      state/index.js on lines 16..21
      script-base.js on lines 55..61
      script-base.js on lines 63..69

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 117.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      function rewriteFile (args) {
        args.path = args.path || process.cwd();
        var fullPath = path.join(args.path, args.file);
      
        args.haystack = fs.readFileSync(fullPath, 'utf8');
      Severity: Major
      Found in util.js and 1 other location - About 3 hrs to fix
      util.js on lines 22..30

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 102.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      function appendFile(args) {
          args.path = args.path || process.cwd();
          var fullPath = path.join(args.path, args.file);
      
          args.input = fs.readFileSync(fullPath, 'utf8');
      Severity: Major
      Found in util.js and 1 other location - About 3 hrs to fix
      util.js on lines 12..20

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 102.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        Generator.prototype.testTemplate = function (src, dest) {
            yeoman.generators.Base.prototype.template.apply(this, [
                src + this.scriptSuffix,
                path.join(this.env.options.testPath, dest) + this.scriptSuffix
            ]);
        Severity: Major
        Found in script-base.js and 1 other location - About 2 hrs to fix
        script-base.js on lines 79..84

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        Generator.prototype.appTemplate = function (src, dest) {
            yeoman.generators.Base.prototype.template.apply(this, [
                src + this.scriptSuffix,
                path.join(this.env.options.appPath, dest) + this.scriptSuffix
            ]);
        Severity: Major
        Found in script-base.js and 1 other location - About 2 hrs to fix
        script-base.js on lines 86..91

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              angular.module('<%= scriptAppName %>.components')
                .controller('<%= cameledName %>ComponentCtrl', function ($scope, $element) {
                  $scope.text = '<%= name %> component';
                })
                .component('<%= cameledName %>', function () {
              Severity: Major
              Found in templates/javascript/component.js and 1 other location - About 1 hr to fix
              templates/javascript/navbar.js on lines 3..11

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 61.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              angular.module('<%= scriptAppName %>.components')
                .controller('navbarComponentCtrl', function ($scope, $element) {
                  $scope.text = 'this is the navbar component';
                })
                .component('navbar', function () {
              Severity: Major
              Found in templates/javascript/navbar.js and 1 other location - About 1 hr to fix
              templates/javascript/component.js on lines 3..11

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 61.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    return (Config.API.protocol + '://' + Config.API.host + ':' + Config.API.port + Config.API.path + '/');
                Severity: Major
                Found in templates/javascript/framework/config.js and 1 other location - About 1 hr to fix
                templates/javascript/framework/mock-api.js on lines 11..11

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 57.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    var APIUrl = (Config.API.protocol + '://' + Config.API.host + ':' + Config.API.port + Config.API.path + '/');
                Severity: Major
                Found in templates/javascript/framework/mock-api.js and 1 other location - About 1 hr to fix
                templates/javascript/framework/config.js on lines 26..26

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 57.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language