alfirin/sept-web-radio

View on GitHub

Showing 46 of 46 total issues

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

module.exports = function (grunt) {
  var matchdep = require('matchdep');

  // load all grunt tasks
  matchdep.filterDev('grunt-*').forEach(grunt.loadNpmTasks);
Severity: Major
Found in Gruntfile.js - About 1 day to fix

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

    // Generated on 2013-07-31 using generator-angular 0.3.1
    'use strict';
    
    var path = require('path');
    
    
    Severity: Minor
    Found in Gruntfile.js - About 3 hrs to fix

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

      exports.article = function (req, res, next, id) {
        Article.load(id, function (err, article) {
          if (err) {
            return next(err);
          }
      Severity: Major
      Found in backend/controllers/articles.js and 1 other location - About 3 hrs to fix
      backend/controllers/playlists.js on lines 13..24

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

      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

      exports.playlist = function (req, res, next, id) {
        Playlist.load(id, function (err, playlist) {
          if (err) {
            return next(err);
          }
      Severity: Major
      Found in backend/controllers/playlists.js and 1 other location - About 3 hrs to fix
      backend/controllers/articles.js on lines 13..24

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

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

      module.exports = function (passport) {
        return {
          authCallback: function (req, res) {
            res.redirect('/');
          },
      Severity: Major
      Found in backend/controllers/users.js - About 2 hrs to fix

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

        module.exports = function (app, env, passport, dbConnexion) {
          app.set('showStackError', true);
        
          //Prettify HTML
          app.locals.pretty = true;
        Severity: Major
        Found in backend/config/express.js - About 2 hrs to fix

          Function tolerate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                tolerate: function( dd ){
                  // declare local refs
                  var i, drp, drg, data, arr, len, elem,
                  // interaction iteration variables
                    x = 0, ia, end = dd.interactions.length,
          Severity: Minor
          Found in app/scripts/libs/jquery-ui/jquery.event.drop-2.2.js - About 2 hrs to fix

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

            exports.article = {
              hasAuthorization: function (req, res, next) {
                if (req.article.user.id != req.user.id) {
                  return res.send(401, 'User is not authorized for this article!');
                }
            Severity: Major
            Found in backend/config/middlewares/authorization.js and 1 other location - About 1 hr to fix
            backend/config/middlewares/authorization.js on lines 40..47

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

            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

            exports.playlist = {
              hasAuthorization: function (req, res, next) {
                if (req.playlist.user.id != req.user.id) {
                  return res.send(401, 'User is not authorized for this playlist!');
                }
            Severity: Major
            Found in backend/config/middlewares/authorization.js and 1 other location - About 1 hr to fix
            backend/config/middlewares/authorization.js on lines 28..35

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

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

            exports.query = function (req, res) {
            
              var featured = req.query.featured;
              var limit = parseInt(req.query.limit, 10);
            
            
            Severity: Minor
            Found in backend/controllers/playlists.js - About 1 hr to fix

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

              module.exports = function(config) {
                config.set({
                  // base path, that will be used to resolve files and exclude
                  basePath: '',
              
              
              Severity: Minor
              Found in karma.conf.js - About 1 hr to fix

                Function controller has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function controller($rootScope, $scope, $element, swrDragAndDrop, $animate) {
                
                      var self = this;
                
                      this.init = function () {
                Severity: Minor
                Found in app/scripts/directives/dragAndDrop.js - About 1 hr to fix

                  Function getButtonLabel has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        $scope.getButtonLabel = function () {
                          var selectedPlaylistsSize = _.size($scope.selectedPlaylistIds);
                          var selectedItemssSize = _.size($scope.selectedItemIds);
                  
                          var label = '';
                  Severity: Minor
                  Found in app/scripts/controllers/StageCtrl.js - About 1 hr to fix

                    Function controller has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function controller($scope, $element) {
                          this.positionFrom = -1;
                          var self = this;
                    
                          this.init = function () {
                    Severity: Minor
                    Found in app/scripts/directives/swrSortable.js - About 1 hr to fix

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

                          function controller($rootScope, $scope, $element, swrDragAndDropService) {
                      
                            var self = this;
                      
                            this.init = function () {
                      Severity: Minor
                      Found in app/scripts/directives/dragAndDrop.js - About 1 hr to fix

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

                        module.exports = function (passport) {
                          //Serialize sessions
                          passport.serializeUser(function (user, done) {
                            done(null, user.id);
                          });
                        Severity: Minor
                        Found in backend/config/passport.js - About 1 hr to fix

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

                          UserSchema.path('email').validate(function (email) {
                            // if you are authenticating by any of the oauth strategies, don't validate
                            if (authTypes.indexOf(this.provider) !== -1) {
                              return true;
                            }
                          Severity: Major
                          Found in backend/models/user.js and 2 other locations - About 1 hr to fix
                          backend/models/user.js on lines 61..67
                          backend/models/user.js on lines 69..75

                          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

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

                          UserSchema.path('hashedPassword').validate(function (hashedPassword) {
                            // if you are authenticating by any of the oauth strategies, don't validate
                            if (authTypes.indexOf(this.provider) !== -1) {
                              return true;
                            }
                          Severity: Major
                          Found in backend/models/user.js and 2 other locations - About 1 hr to fix
                          backend/models/user.js on lines 53..59
                          backend/models/user.js on lines 61..67

                          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

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

                          UserSchema.path('username').validate(function (username) {
                            // if you are authenticating by any of the oauth strategies, don't validate
                            if (authTypes.indexOf(this.provider) !== -1) {
                              return true;
                            }
                          Severity: Major
                          Found in backend/models/user.js and 2 other locations - About 1 hr to fix
                          backend/models/user.js on lines 53..59
                          backend/models/user.js on lines 69..75

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

                                handler: function( event, dd ){
                                  // local vars
                                  var results, $targets;
                                  // make sure the right data is available
                                  if ( !dd )
                          Severity: Minor
                          Found in app/scripts/libs/jquery-ui/jquery.event.drop-2.2.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language