Showing 42 of 102 total issues
Function ApplicationSchedulers
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ApplicationSchedulers = (Entity, PersistenceServices = DPersistenceServices) => {
return {
find(req, res, next) {
const field = 'query';
Function CallReportApi
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CallReportApi = (owner_user = null, req = null) => {
return {
create(e) {
const data = {
Function AuthApp
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AuthApp = (Entity) => {
return {
login (req, res, next) {
Function validateFile
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const validateFile = (file, opts) => {
const defaultParams = {
maxsize: process.env.MAESTRO_UPLOAD_MAXSIZE | 16302400, //~10 mb,
minsize: process.env.MAESTRO_UPLOAD_MINSIZE | 1, // 1 kbs
Function AccessApp
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AccessApp = (Entity, AccessServices = DAccessServices) => {
return {
update: (req, res, next) => {
Function HealthCheck
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const HealthCheck = () => {
const handle_services = (Service) => {
const {name} = Service;
Function DatacentersConnection
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DatacentersConnection = (result, req, PersistenceServices, Entity) => {
const dc_id = _.get(result, 'dc_id');
return {
connected() {
Function mailerConnector
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mailerConnector = (mailer = DMailer) => {
if (!mailer.isConnected()) {
try {
factoryValid(
Function persistenceSystem
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const persistenceSystem = (IEntity) => (Entity) => {
return {
create(req, res, next) {
PersistenceServices(Entity)
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (Entity) => {
return {
accessSingleRoleRefs: (collections, _id = false) => {
Function DepsApp
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DepsApp = (Entity, DepServices = DDepServices) => {
const field = 'deps';
return {
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async render(data) {
if (!template)
template = await populate();
const {task, _id} = data;
Function MapFileType
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MapFileType = (type=null) => {
const tprivate = {
"application/json": "json",
"text/csv": "csv",
"text/plain": "txt"
Function connect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
connect() {
const smtpConfig = {
host: process.env.SMTP_HOST,
port: process.env.SMTP_PORT,
Function validateFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const validateFile = (file, opts) => {
const defaultParams = {
maxsize: process.env.MAESTRO_UPLOAD_MAXSIZE | 16302400, //~10 mb,
minsize: process.env.MAESTRO_UPLOAD_MINSIZE | 1, // 1 kbs
- 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 where
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Query.prototype.where = function (key, value) {
// if object was passed instead of key-value pair
// iterate over that object and call .where(key, value)
if (_.isObject(key)) {
let conditions = key;
- 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 UploaderRepository
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const UploaderRepository = (folder) => {
factoryValid(
_.pick(process.env, ['AWS_S3_BUCKET_NAME', 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY']),
s3Valid
- 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 find
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Query.prototype.find = function (query, options) {
let Model = this.model;
query = _.assign({}, this.query, query);
- 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 HealthCheck
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const HealthCheck = () => {
const handle_services = (Service) => {
const {name} = Service;
- 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 mailerConnector
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const mailerConnector = (mailer = DMailer) => {
if (!mailer.isConnected()) {
try {
factoryValid(
- 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"