Showing 10 of 21 total issues
Function exports
has 538 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
var localConfig;
try {
localConfig = require('./server/config/local.env');
} catch(e) {
File Gruntfile.js
has 541 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Generated on 2014-08-29 using generator-angular-fullstack 2.0.13
'use strict';
module.exports = function (grunt) {
var localConfig;
Function Auth
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
.factory('Auth', function Auth($location, $rootScope, $http, User, $cookieStore, $q) {
var currentUser = {};
if($cookieStore.get('token')) {
currentUser = User.get();
}
Function exports
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
Function setup
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.setup = function (User, config) {
var passport = require('passport');
var TwitterStrategy = require('passport-twitter').Strategy;
passport.use(new TwitterStrategy({
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(app) {
var env = app.get('env');
app.set('views', config.root + '/server/views');
app.engine('html', require('ejs').renderFile);
Function delete
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
delete: function(del) {
del = del || angular.noop;
/**
* Open a delete confirmation modal
Function setup
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.setup = function (User, config) {
passport.use(new GoogleStrategy({
clientID: config.google.clientID,
clientSecret: config.google.clientSecret,
callbackURL: config.google.callbackURL
Function destroy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
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) {
- Read upRead up
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
Open
.factory('Auth', function Auth($location, $rootScope, $http, User, $cookieStore, $q) {
var currentUser = {};
if($cookieStore.get('token')) {
currentUser = User.get();
}
- Read upRead up
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"