src/util/middleware.js
Function useAbsoluteUrls
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function useAbsoluteUrls (port) {
return function (request, response, next) {
const setHeaderOriginal = response.setHeader,
sendOriginal = response.send,
host = request.headers.host || `localhost:${port}`,
Function send
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
response.send = function () {
const args = Array.prototype.slice.call(arguments),
body = args[0],
changeLinks = function (obj) {
if (obj._links) {
Function json
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function json (log) {
return function (request, response, next) {
// Disable body parsing, if already parsed
if (request.headers['content-type'] === 'application/json' && helpers.isObject(request.body)) {
next();
Function validateApiKey
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function validateApiKey (expectedApiKey, log) {
return function (request, response, next) {
if (!expectedApiKey) {
next();
return;
Parsing error: Invalid ecmaVersion. Open
Open
'use strict';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/