alfirin/sept-web-radio

View on GitHub

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

      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

            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

                          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

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

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

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function addItemsToPlaylist has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  this.addItemsToPlaylist = function (playlistId, itemIds) {
                                    var playlist = self.findPlaylistById(playlistId);
                            
                                    var playlistItemsSize = 0;
                            
                            
                            Severity: Minor
                            Found in app/scripts/services/playlistServices.js - About 1 hr to fix

                              Avoid deeply nested control flow statements.
                              Open

                                          if ( data.winner && ia.drop.length < drop.multi ){
                                            // new winner... dropstart
                                            if ( !data.active[x] && !data.anyactive ){
                                              // check to make sure that this is not prevented
                                              if ( $special.drag.hijack( drop.event, "dropstart", dd, x, data.elem )[0] !== false ){
                              Severity: Major
                              Found in app/scripts/libs/jquery-ui/jquery.event.drop-2.2.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                            if ( !drp ) continue;
                                Severity: Major
                                Found in app/scripts/libs/jquery-ui/jquery.event.drop-2.2.js - About 45 mins to fix

                                  Function controller has a Cognitive Complexity of 8 (exceeds 5 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 45 mins to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Function walk has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  var walk = function (path) {
                                    fs.readdirSync(path).forEach(function (file) {
                                      var newPath = path + '/' + file;
                                      var stat = fs.statSync(newPath);
                                      if (stat.isFile()) {
                                  Severity: Minor
                                  Found in app.js - About 35 mins to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language