alex030293/mean-boilerplate

View on GitHub

Showing 175 of 175 total issues

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

FruitSchema.pre('save', function(next){
    now = new Date();
    this.dateModified = now;
    if ( !this.dateCreated ) {
        this.dateCreated = now;
Severity: Major
Found in model/DAO/fruitDAO.js and 1 other location - About 1 hr to fix
model/DAO/userDAO.js on lines 13..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 68.

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

    d.on('error', function(error){
        if(!isInTest) console.log(error.stacktrace);
        res.status(500).send({'error': error.message});
    });
Severity: Major
Found in routes/api/0.1/userAPI.js and 5 other locations - About 1 hr to fix
routes/api/0.1/userAPI.js on lines 12..15
routes/api/0.1/userAPI.js on lines 39..42
routes/api/0.1/userAPI.js on lines 60..64
routes/api/0.1/userAPI.js on lines 106..109
routes/api/0.1/userAPI.js on lines 129..132

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

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

    d.on('error', function(error){
        if(!isInTest) console.log(error.stacktrace);
        res.status(500).send({'error': error.message});
    });
Severity: Major
Found in routes/api/0.1/userAPI.js and 5 other locations - About 1 hr to fix
routes/api/0.1/userAPI.js on lines 12..15
routes/api/0.1/userAPI.js on lines 39..42
routes/api/0.1/userAPI.js on lines 60..64
routes/api/0.1/userAPI.js on lines 82..85
routes/api/0.1/userAPI.js on lines 129..132

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

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

    d.on('error', function(error){
        if(!isInTest) console.log(error.stacktrace);
        res.status(500).send({'error': error.message});

    });
Severity: Major
Found in routes/api/0.1/userAPI.js and 5 other locations - About 1 hr to fix
routes/api/0.1/userAPI.js on lines 12..15
routes/api/0.1/userAPI.js on lines 39..42
routes/api/0.1/userAPI.js on lines 82..85
routes/api/0.1/userAPI.js on lines 106..109
routes/api/0.1/userAPI.js on lines 129..132

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

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

    d.on('error', function(error){
        if(!isInTest) console.log(error.stacktrace);
        res.status(500).send({'error': error.message});
    });
Severity: Major
Found in routes/api/0.1/userAPI.js and 5 other locations - About 1 hr to fix
routes/api/0.1/userAPI.js on lines 12..15
routes/api/0.1/userAPI.js on lines 60..64
routes/api/0.1/userAPI.js on lines 82..85
routes/api/0.1/userAPI.js on lines 106..109
routes/api/0.1/userAPI.js on lines 129..132

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

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

    $scope.send = function(username, password){
        $("#login img").hide();
        if (working) return;
        working = true;
        var $this = $('#login'),
Severity: Minor
Found in public/js/Controllers/LoginController.js - About 1 hr to fix

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        d.on('error', function(error){
            console.log(error.stacktrace);
            res.status(500).send({'error': error.message});
        });
    Severity: Major
    Found in routes/api/0.1/fruitAPI.js and 5 other locations - About 1 hr to fix
    routes/api/0.1/fruitAPI.js on lines 10..13
    routes/api/0.1/fruitAPI.js on lines 57..61
    routes/api/0.1/fruitAPI.js on lines 78..81
    routes/api/0.1/fruitAPI.js on lines 102..105
    routes/index.js on lines 9..12

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

    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

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        d.on('error', function(error){
            console.log(error.stacktrace);
            res.status(500).send({'error': error.message});
        });
    Severity: Major
    Found in routes/api/0.1/fruitAPI.js and 5 other locations - About 1 hr to fix
    routes/api/0.1/fruitAPI.js on lines 10..13
    routes/api/0.1/fruitAPI.js on lines 37..40
    routes/api/0.1/fruitAPI.js on lines 57..61
    routes/api/0.1/fruitAPI.js on lines 102..105
    routes/index.js on lines 9..12

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

    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

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        d.on('error', function(error){
            console.log(error.stacktrace);
            res.status(500).send({'error': error.message});
        });
    Severity: Major
    Found in routes/api/0.1/fruitAPI.js and 5 other locations - About 1 hr to fix
    routes/api/0.1/fruitAPI.js on lines 37..40
    routes/api/0.1/fruitAPI.js on lines 57..61
    routes/api/0.1/fruitAPI.js on lines 78..81
    routes/api/0.1/fruitAPI.js on lines 102..105
    routes/index.js on lines 9..12

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

    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

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        d.on('error', function(error){
            console.log(error.stacktrace);
            res.status(500).send({'error': error.message});
        });
    Severity: Major
    Found in routes/api/0.1/fruitAPI.js and 5 other locations - About 1 hr to fix
    routes/api/0.1/fruitAPI.js on lines 10..13
    routes/api/0.1/fruitAPI.js on lines 37..40
    routes/api/0.1/fruitAPI.js on lines 57..61
    routes/api/0.1/fruitAPI.js on lines 78..81
    routes/index.js on lines 9..12

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

    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

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        d.on('error', function(error){
            console.log(error.stacktrace);
            res.status(500).send({'error': error.message});
    
        });
    Severity: Major
    Found in routes/api/0.1/fruitAPI.js and 5 other locations - About 1 hr to fix
    routes/api/0.1/fruitAPI.js on lines 10..13
    routes/api/0.1/fruitAPI.js on lines 37..40
    routes/api/0.1/fruitAPI.js on lines 78..81
    routes/api/0.1/fruitAPI.js on lines 102..105
    routes/index.js on lines 9..12

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

    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

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        d.on('error', function(error){
            console.log(error.stacktrace);
            res.status(500).send({'error': error.message});
        });
    Severity: Major
    Found in routes/index.js and 5 other locations - About 1 hr to fix
    routes/api/0.1/fruitAPI.js on lines 10..13
    routes/api/0.1/fruitAPI.js on lines 37..40
    routes/api/0.1/fruitAPI.js on lines 57..61
    routes/api/0.1/fruitAPI.js on lines 78..81
    routes/api/0.1/fruitAPI.js on lines 102..105

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

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

        $scope.save_fruit = function(){
            $scope.$parent.loading = true;
            if($scope.$parent.fruit._id === undefined){
                //Adding fruit -> POST
                fruitFactory.save({
    Severity: Minor
    Found in public/js/Controllers/CardController.js - About 1 hr to fix

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

                  fruitFactory.save({
                      name: $scope.$parent.fruit.name,
                      description: $scope.$parent.fruit.description,
                      price: $scope.$parent.fruit.price
                  }, function(response) {
      Severity: Minor
      Found in public/js/Controllers/CardController.js and 1 other location - About 55 mins to fix
      public/js/Controllers/CardController.js on lines 29..33

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

      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

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

                  fruitFactory.update({id: $scope.$parent.fruit._id}, {
                      name: $scope.$parent.fruit.name,
                      description: $scope.$parent.fruit.description,
                      price: $scope.$parent.fruit.price
                  },function(response) {
      Severity: Minor
      Found in public/js/Controllers/CardController.js and 1 other location - About 55 mins to fix
      public/js/Controllers/CardController.js on lines 14..18

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

      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

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

                  },function(response) {
                      console.log(response);
                      $scope.$parent.editing = false;
                      $scope.$parent.update_fruits();
                  }, function(response) {
      Severity: Minor
      Found in public/js/Controllers/CardController.js and 2 other locations - About 35 mins to fix
      public/js/Controllers/CardController.js on lines 18..22
      public/js/Controllers/CardController.js on lines 48..52

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

      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

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

              function(response) {
                  console.log(response);
                  $scope.$parent.editing = false;
                  $scope.$parent.update_fruits();
              }, function(response) {
      Severity: Minor
      Found in public/js/Controllers/CardController.js and 2 other locations - About 35 mins to fix
      public/js/Controllers/CardController.js on lines 18..22
      public/js/Controllers/CardController.js on lines 33..37

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

      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

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

                  }, function(response) {
                          console.log(response);
                          $scope.$parent.editing = false;
                          $scope.$parent.update_fruits();
                  }, function(response) {
      Severity: Minor
      Found in public/js/Controllers/CardController.js and 2 other locations - About 35 mins to fix
      public/js/Controllers/CardController.js on lines 33..37
      public/js/Controllers/CardController.js on lines 48..52

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

      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

      Heading (h2) should not be qualified.
      Open

      section.main .right h2{
      Severity: Minor
      Found in public/css/style.css by csslint

      Rule doesn't have all its properties in alphabetical order.
      Open

      .generator .top .params label:not(.radio){
      Severity: Minor
      Found in public/css/style.css by csslint
      Severity
      Category
      Status
      Source
      Language