This repo hasn't had a successful analysis for its default branch yet.

gerard2p/koaton

View on GitHub
src/middleware/orm.js

Summary

Maintainability
B
5 hrs
Test Coverage

Showing 5 of 5 total issues

Function addModel has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function addModel (modelName, definition) {
relations[modelName] = [];
const rel = {
belongsTo: relation.bind(modelName, 'belongsTo'),
hasMany: relation.bind(modelName, 'hasMany'),
Severity: Major
Found in src/middleware/orm.js - About 2 hrs to fix

Function initializeORM has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function initializeORM (seed) {
let res = null;
/* istanbul ignore next */
schema.on('error', (err) => {
debug(err.stack);
Severity: Minor
Found in src/middleware/orm.js - About 1 hr to fix

Function manyToMany has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

manyToMany (configuration) {
let targetModel = inflector.pluralize(configuration.targetModel);
let intermediateTable = `${modelName}_${targetModel}`;
let key1 = `${modelName}ID`;
let key2 = `${targetModel}ID`;
Severity: Minor
Found in src/middleware/orm.js - About 1 hr to fix

Function makerelation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function makerelation (model, relation) {
let options = {
as: relation.As,
foreignKey: relation.key
};
Severity: Minor
Found in src/middleware/orm.js - About 1 hr to fix

TODO found
Open

// TODO: Create your own ORM, caminte worked but is not enough, remember LORM?
Severity: Minor
Found in src/middleware/orm.js by fixme
Category
Status