Showing 12 of 20 total issues
Function DBRepository
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DBRepository = (Entity, options = {}) => {
const DB = Entity.dao;
return {
Function ApplicationAudit
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ApplicationAudit = (EntityStorage) => (Entity, PersistenceServices = DPersistenceServices) => {
const AuditTrackCharged = AuditTrack(PersistenceServices(Entity));
const dUser = "MaestroServer";
Function Persistence
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Persistence = (Entity, FactoryDBRepository = DFactoryDBRepository) => {
const DBRepository = FactoryDBRepository(Entity);
return {
Function find
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Query.prototype.find = function (query, options) {
let Model = this.model;
query = _.assign({}, this.query, query);
Function HTTPService
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const HTTPService = (url) => (header = {}) => {
Object.assign(header, {Authorization: privateToken.token}); // inject private token, used to autheticate on private services
const factoryRequest = (caller, path, args) => {
- 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 HTTPService
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const HTTPService = (url) => (header = {}) => {
Object.assign(header, {Authorization: privateToken.token}); // inject private token, used to autheticate on private services
const factoryRequest = (caller, path, args) => {
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (Entity) => {
return {
accessSingleRoleRefs: (collections, _id = false) => {
Function exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (PersistenceStorage) => (body, entity, entity_id, user, created=false) => {
return new Promise((resolve, reject) => {
if (!_.isEmpty(body)) {
- 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 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 isID
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const isID = (obj, relation, key = '_id') => {
const exist = _.get(obj, relation);
if(_.isArray(exist)) {
const interator = obj[relation].map(e=>isID(e, '', 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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function () {
const passport = new Passport();
const strategy = new Strategy(config.jwtSecret, function (payload, done) {
- 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"