Showing 8 of 26 total issues
Function fetchEmbed
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function fetchEmbed(relations, config, data, headers){
var promises = relations.map(function(relation){
var parent = config.metadata[relation.version][relation.parent];
var isCollection = isCollectionRelation(relation);
var isResource = !isCollection;
Function load
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function load(config){
return {
collection: function(metadata){
return collectionHandler(metadata, config);
},
Function load
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function load(version, modelName, metadata){
log.trace('Loading Model: version \'%s\' model \'%s\' metadata %j',
version, modelName, metadata);
// clone the initial dictionary before start changing it
Function init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init(modelName, runtimeConfig){
log.trace('Loading client for model %s', modelName);
var client = new ZSSClient(getConfig(runtimeConfig, modelName));
return {
Function promises
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var promises = relations.map(function(relation){
var parent = config.metadata[relation.version][relation.parent];
var isCollection = isCollectionRelation(relation);
var isResource = !isCollection;
var idKey = isCollection ? parent.idKey : relation.modelFk;
Function createHandler
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createHandler(metadata, config, handler, pagination) {
var includePagination = pagination || false;
var handlerConfig = getHandlerConfig(metadata, config);
return function(req, res, next){
log.trace('Request with params: %j and query: %j', req.params, req.query);
Function load
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function load(config){
return {
collection: function(metadata){
var metadataIndex = config.metadata[metadata.version];
return getCollectionPath(metadata, metadataIndex);
Avoid too many return
statements within this function. Open
Open
return null;