Showing 19 of 55 total issues
Function exports
has 1093 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function() {
var settings = [];
settings.push({
File settings.js
has 1097 lines of code (exceeds 250 allowed). Consider refactoring. Open
// # settings
var _ = require( 'underscore' );
Function exports
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function( mongoose, iglooMongoosePlugin, settings ) {
var Package = new mongoose.Schema({
slug: {
type: String
- 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 exports
has 234 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function( mongoose, iglooMongoosePlugin, settings ) {
var Package = new mongoose.Schema({
slug: {
type: String
Function exports
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function() {
return {
defaults: {
Function exports
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function( Package ) {
// Get 5 most popular packages
function popular( req, res, next ) {
req.query.limit = 5;
Function getSampleCode
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSampleCode( convertedSettings ) {
// If there are no settings, return an empty string
if ( convertedSettings.length === 0 ) {
return '';
}
Function exports
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function( Package, settings ) {
function home( req, res, next ) {
var popularPackages = [];
var latestPackages = [];
Function getJSHintCode
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getJSHintCode( convertedSettings ) {
// If there are no settings, return an empty string
if ( convertedSettings.length === 0 ) {
return '';
}
Function exports
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function( settings ) {
function index( req, res, next ) {
res.format({
html: function() {
Function home
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function home( req, res, next ) {
var popularPackages = [];
var latestPackages = [];
async.waterfall([
Function create
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create( req, res, next ) {
if ( ! req.body.settings ) {
return next({
param: 'settings',
message: 'Settings is missing or blank'
Function exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function( IoC ) {
var app = this;
var router = express.Router();
var controller = IoC.create( 'controllers/packages' );
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(IoC, settings) {
var app = this;
// set the default views directory
Function show
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show( req, res, next ) {
async.waterfall([
// Find package and increment the number of views
function findPackageAndIncrementViews( callback ) {
Package.findOne( { slug: req.params.slug }, function( err, _package ) {
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(IoC, logger, settings) {
var app = this;
// adds X-Response-Time header
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function( Package ) {
// Get 5 most popular packages
function popular( req, res, next ) {
req.query.limit = 5;
- 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 exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function( Package, settings ) {
function home( req, res, next ) {
var popularPackages = [];
var latestPackages = [];
- 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 listPaginated
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function listPaginated( req, res, next, findOptions, extraOptions ) {