lib/middleware.js
Function determineHierarchy
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const determineHierarchy = (routeStack, includeHttpMethods = true) => {
const transformed = {}
routeStack.map(element => {
if (element.route) {
const split = element.route.path.split('/').slice(1)
Function exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = options => (req, res, next) => {
const config = {
includeHttpMethods: false,
...options
}
Avoid deeply nested control flow statements. Open
Open
if (element.route.methods) {
if (includeHttpMethods) {
Object.keys(element.route.methods).map(method => {
existingElement[key][method.toUpperCase()] = {
isHttpMethod: true,