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);
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');
Function exports
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (passport) {
return {
authCallback: function (req, res) {
res.redirect('/');
},
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;
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,
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);
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: '',
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 () {
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 = '';
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 () {
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 () {
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);
});
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 )
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('/');
},
- 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 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;
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 ){
Avoid deeply nested control flow statements. Open
if ( !drp ) continue;
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 () {
- 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 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()) {
- 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"