Showing 220 of 414 total issues
Function walkSchema
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function walkSchema(app, Model, schema, parentName, fromArray, rawPath) {
var modelConfig = utils.getModels()[Model.modelName];
for (var key in schema) {
var field = schema[key];
Function getFileNameFromFile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getFileNameFromFile(outDirectory, sourceFileName, cb) {
var fileName = null;
sourceFileName = sourceFileName.toLowerCase();
if (!fs.existsSync(outDirectory)) {
Function DBConnection
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var DBConnection = /** @class */ (function () {
function DBConnection(config) {
DBConnection.logger.trace("Creating DBConnection instance");
this.config = config;
this.debug(this.config.env.database.debug || false);
Function getFileNameFromFile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getFileNameFromFile(outDirectory, sourceFileName,cb){
var fileName=null;
sourceFileName=sourceFileName.toLowerCase();
if (!fs.existsSync(outDirectory)){
Function getFileNameFromFile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getFileNameFromFile(outDirectory, sourceFileName, cb) {
var fileName = null;
sourceFileName = sourceFileName.toLowerCase();
if (!fs.existsSync(outDirectory)) {
Function checkRole
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function checkRole(role) {
return function (req, res, next) {
var injector = require('../../../../');
var config = injector.config;
Function save
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function save(doc) {
var defer = Q.defer();
//Create the Model object from the json received
if (Model.injector()._references) {
if (Model.injector()._references.toDB) {
Function uploadFile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function uploadFile(item, cb) {
fs.exists(item.path, function (exists) {
if (exists) {
//TODO pass as setting paramter
if (1 == 0) {//Get file name as randoom
Function endOK
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function endOK() {
var refConf = confs[refModel.modelName];
if (refConf.search.disable === true) {
res.statusCode = statusCode.UNAUTHORIZED;
Function uploadFile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function uploadFile(item, cb) {
fs.exists(item.path, function (exists) {
if (exists) {
//TODO pass as setting paramter
if(1==0) {//Get file name as randoom
Function expressSetup
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function expressSetup(app, config) {
app.set('views', FSUtils.join(config.appPath, 'views'));
app.set('view engine', config.application.view_engine || 'ejs');
logger.token('body', function getUrlToken(req) {
return req.__body || "";
Function expressSetup
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function expressSetup(app:Express, config:any) {
app.set('views', FSUtils.join(config.appPath, 'views'));
app.set('view engine', config.application.view_engine || 'ejs');
Function Logger
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Logger = /** @class */ (function () {
function Logger() {
}
/**
* Get a logger to log your application
Function clearCache
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FSUtils.clearCache = function (cfg, relativePath) {
var e_1, _a;
return __awaiter(this, void 0, void 0, function () {
var dirName, baseNameNoExt, globPath, stream, stream_1, stream_1_1, entry, e_1_1;
return __generator(this, function (_b) {
Function MiddlewareRegistry
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var MiddlewareRegistry = /** @class */ (function () {
function MiddlewareRegistry(config) {
this._middlewares = {};
this.config = config;
MiddlewareRegistry.logger.trace("Creating MiddlewareRegistry instance");
Function doLogin
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function doLogin(model, cbk) {
if (loginInfo.found == undefined) {
model.findOne(loginCondition, null).lean().exec(function (err, result) {
//var logModels = config.login.model;
if (err) {
Function checkToken
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.checkToken = function (req, res, cb) {
var token = req.params.token;
jwt.verify(token, aconf["token.secret"], function (unauthorized, decoded) {
if (unauthorized) {
if(cb) return cb(false);
Function getImage
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getImage(param) {
return function (req, res) {
var conf = param.model.injector();
Function configureForm
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.configureForm = function (Model) {
var inj = Model.injector();
if (inj.form && inj.form.tabs) {
for (var t in inj.form.tabs) {
var tab = inj.form.tabs[t];
Function logout
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.logout = function (req, res) {
log.info(req.user);
if (aconf.login.stateless) {
res.statusCode = statusCode.BAD_REQUEST;
res.json({result: 'auth mode is stateless'});