tangosource/tangoestimate

View on GitHub

Showing 12 of 82 total issues

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

module.exports = function (grunt) {
  var localConfig;
  try {
    localConfig = require('./server/config/ennvironment');
  } catch(e) {
Severity: Major
Found in Gruntfile.js - About 3 days to fix

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

    // Generated on 2015-01-19 using generator-angular-fullstack 2.0.13
    'use strict';
    
    module.exports = function (grunt) {
      var localConfig;
    Severity: Major
    Found in Gruntfile.js - About 1 day to fix

      File retrospective.spec.js has 507 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      var config = require('../../server/config/environment');
      
      describe('Retrospective View', function() {
        var page;
      Severity: Major
      Found in e2e/retrospective/retrospective.spec.js - About 1 day to fix

        File main.spec.js has 415 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        
        var should = require('should');
        var io = require('socket.io-client');
        var _ = require('lodash');
        Severity: Minor
        Found in server/components/sockets/main.spec.js - About 5 hrs to fix

          File retrospective.controller.spec.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          'use strict';
          
          describe('Controller: RetrospectiveCtrl', function () {
          
            // load the controller's module
          Severity: Minor
          Found in client/app/retrospective/retrospective.controller.spec.js - About 2 hrs to fix

            Function MainPage has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var MainPage = function() {
              this.container = element(by.css('#container'));
              this.form = this.container.element(by.css('form[name="startSessionForm"]'));
            
              this.usernameInput = this.container.element(by.model('currentUser.username'));
            Severity: Major
            Found in e2e/retrospective/retrospective.po.js - About 2 hrs to fix

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

                var MainPage = function() {
                  this.container = element(by.css('#container'));
                  this.form = this.container.element(by.css('form[name="startSessionForm"]'));
                
                  this.usernameInput = this.container.element(by.model('currentUser.username'));
                Severity: Minor
                Found in e2e/session/session.po.js - About 1 hr to fix

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

                    $scope.init = function(){
                      $scope.currentUser = userService.getUser(); //get user name and type
                      $scope.url         = $location.$$absUrl;// Url to share with the team
                      $scope.sessionId   = $routeParams.id;
                      $scope.inputMode   = {};
                  Severity: Minor
                  Found in client/app/retrospective/retrospective.controller.js - About 1 hr to fix

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

                    module.exports = function(app) {
                      var env = app.get('env');
                    
                      app.locals.FACEBOOK_APP_ID= config.FACEBOOK_APP_ID;
                      app.locals.GOOGLE_ANALYTICS_ID= config.GOOGLE_ANALYTICS_ID;
                    Severity: Minor
                    Found in server/config/express.js - About 1 hr to fix

                      Function onLeaveSession has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function onLeaveSession(socket){
                        var match, union;
                        var roomId = _.findKey(rooms, function(room){//Find user in rooms
                          union = _.union(room.players, room.moderators);
                          match = _.findWhere(union, {id: socket.id});
                      Severity: Minor
                      Found in server/components/sockets/main.js - About 55 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 onJoinSession has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function onJoinSession(io, socket, data) {
                        if(!rooms[data.roomId]){ return socket.emit('errorMsg', {message: "Session does not exist"}); }
                        if(!data.username || !data.type){ return socket.emit('errorMsg', {message: "Missing information"}); }
                      
                        socket.join(data.roomId);
                      Severity: Minor
                      Found in server/components/sockets/main.js - About 25 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