42Zavattas/generator-bangular

View on GitHub

Showing 32 of 32 total issues

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

var BangularGenerator = yeoman.generators.NamedBase.extend({

  initializing: function () {
    this.camelName = _.capitalize(_.camelize(this.name, true));
    this.dashName = _.dasherize(_.decapitalize(this.name));
Severity: Major
Found in service/index.js and 1 other location - About 1 day to fix
factory/index.js on lines 6..27

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 200.

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 BangularGenerator = yeoman.generators.NamedBase.extend({

  initializing: function () {
    this.camelName = _.capitalize(_.camelize(this.name, true));
    this.dashName = _.dasherize(_.decapitalize(this.name));
Severity: Major
Found in factory/index.js and 1 other location - About 1 day to fix
service/index.js on lines 6..27

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 200.

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('<%= appname %>')
  .controller('SignupCtrl', function ($location, Auth) {

    var vm = this;

Severity: Major
Found in app/templates/client/views/signup(auth)/signup.controller.js and 1 other location - About 5 hrs to fix
app/templates/client/views/login(auth)/login.controller.js on lines 3..32

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 146.

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('<%= appname %>')
  .controller('LoginCtrl', function ($location, Auth) {

    var vm = this;

Severity: Major
Found in app/templates/client/views/login(auth)/login.controller.js and 1 other location - About 5 hrs to fix
app/templates/client/views/signup(auth)/signup.controller.js on lines 3..32

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 146.

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

    this.login = function (user) {
      var deferred = $q.defer();
      $http.post('/auth/local', user)
        .then(function (res) {
          _user = res.data.user;
Severity: Major
Found in app/templates/client/services/auth(auth)/auth.js and 1 other location - About 5 hrs to fix
app/templates/client/services/auth(auth)/auth.js on lines 27..39

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 142.

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

    this.signup = function (user) {
      var deferred = $q.defer();
      $http.post('/api/users', user)
        .then(function (res) {
          _user = res.data.user;
Severity: Major
Found in app/templates/client/services/auth(auth)/auth.js and 1 other location - About 5 hrs to fix
app/templates/client/services/auth(auth)/auth.js on lines 47..59

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 142.

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 prompting has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  prompting: function () {

    if (this.skipConfig) { return ; }

    var done = this.async();
Severity: Major
Found in app/index.js - About 5 hrs to fix

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

          utils.appendNeedleOrOnTop({
            needle: '// imports',
            file: 'client/styles/app.scss',
            append: '@import "../directives/' + this.dashName + '/' + this.dashName + '";'
          }, function importCallback (err) {
    Severity: Major
    Found in directive/index.js and 1 other location - About 3 hrs to fix
    route/index.js on lines 60..71

    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 97.

    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

            utils.appendNeedleOrOnTop({
              needle: '// imports',
              file: 'client/styles/app.scss',
              append: '@import "../views/' + this.dashName + '/' + this.dashName + '";'
            }, function importCallback (err) {
    Severity: Major
    Found in route/index.js and 1 other location - About 3 hrs to fix
    directive/index.js on lines 59..70

    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 97.

    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

        }, {
          type: 'checkbox',
          name: 'modules',
          message: 'Which module do you want to load?',
          choices: [{
    Severity: Major
    Found in app/index.js and 1 other location - About 2 hrs to fix
    app/index.js on lines 95..116

    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 91.

    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

        }, {
          type: 'checkbox',
          name: 'tests',
          message: 'Customize your test suite.',
          choices: [{
    Severity: Major
    Found in app/index.js and 1 other location - About 2 hrs to fix
    app/index.js on lines 116..137

    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 91.

    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 prompting has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      prompting: function () {
    
        if (this.skipConfig) { return ; }
    
        var done = this.async();
    Severity: Major
    Found in anim/index.js - About 2 hrs to fix

      Function prompting has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        prompting: function () {
          var done = this.async();
      
          this.instanceName = _.camelize(this.name);
          this.instancesName = _.camelize(this.name) + 's';
      Severity: Minor
      Found in api/index.js - About 1 hr to fix

        Function writing has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          writing: function () {
        
            mkdir.sync('client/assets/fonts/' + this.name);
        
            if (!utils.fileExists('client/styles/fonts.scss')) {
        Severity: Minor
        Found in font/index.js - About 1 hr to fix

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

            prompting: function () {
          
              var done = this.async();
          
              this.types = {};
          Severity: Minor
          Found in font/index.js - About 1 hr to fix

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

              writing: function () {
            
                var filters = this.config.get('filters');
                var filesByBackendType = {
                  mongo: ['controller.js', 'model.js'],
            Severity: Minor
            Found in api/index.js - About 1 hr to fix

              Function rewrite has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                rewrite: function (args) {
                  // check if splicable is already in the body text
                  var re = new RegExp(args.splicable.map(function (line) {
                    return '\s*' + escapeRegExp(line);
                  }).join('\n'));
              Severity: Minor
              Found in util.js - About 1 hr to fix

                Function writing has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  writing: function () {
                
                    var basePath = 'client/views/' + this.dashName + '/' + this.dashName;
                
                    this.template('index.js', basePath + '.js');
                Severity: Minor
                Found in route/index.js - About 1 hr to fix

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

                    initializing: function () {
                      this.camelName = _.camelize(this.name);
                      this.dashName = _.dasherize(this.name);
                    },
                  Severity: Major
                  Found in directive/index.js and 1 other location - About 1 hr to fix
                  filter/index.js on lines 8..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 56.

                  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

                    initializing: function () {
                      this.dashName = _.dasherize(this.name);
                      this.camelName = _.camelize(this.name);
                    },
                  Severity: Major
                  Found in filter/index.js and 1 other location - About 1 hr to fix
                  directive/index.js on lines 11..14

                  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 56.

                  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