DaftMonk/fullstack-demo

View on GitHub

Showing 10 of 21 total issues

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

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

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

    // Generated on 2014-08-29 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

      Function Auth has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        .factory('Auth', function Auth($location, $rootScope, $http, User, $cookieStore, $q) {
          var currentUser = {};
          if($cookieStore.get('token')) {
            currentUser = User.get();
          }
      Severity: Major
      Found in client/components/auth/auth.service.js - About 3 hrs to fix

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

          exports.setup = function (User, config) {
            var passport = require('passport');
            var TwitterStrategy = require('passport-twitter').Strategy;
          
            passport.use(new TwitterStrategy({
          Severity: Minor
          Found in server/auth/twitter/passport.js - About 1 hr to fix

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

            module.exports = function(app) {
              var env = app.get('env');
            
              app.set('views', config.root + '/server/views');
              app.engine('html', require('ejs').renderFile);
            Severity: Minor
            Found in server/config/express.js - About 1 hr to fix

              Function delete has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      delete: function(del) {
                        del = del || angular.noop;
              
                        /**
                         * Open a delete confirmation modal
              Severity: Minor
              Found in client/components/modal/modal.service.js - About 1 hr to fix

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

                exports.setup = function (User, config) {
                  passport.use(new GoogleStrategy({
                      clientID: config.google.clientID,
                      clientSecret: config.google.clientSecret,
                      callbackURL: config.google.callbackURL
                Severity: Minor
                Found in server/auth/google/passport.js - About 1 hr to fix

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

                  exports.destroy = function(req, res) {
                    Thing.findById(req.params.id, function (err, thing) {
                      if(err) { return handleError(res, err); }
                      if(!thing) { return res.send(404); }
                      thing.remove(function(err) {
                  Severity: Minor
                  Found in server/api/thing/thing.controller.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

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

                    .factory('Auth', function Auth($location, $rootScope, $http, User, $cookieStore, $q) {
                      var currentUser = {};
                      if($cookieStore.get('token')) {
                        currentUser = User.get();
                      }
                  Severity: Minor
                  Found in client/components/auth/auth.service.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