holidayextras/jsonapi-server

View on GitHub
lib/router.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function applyMiddleware has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

router.applyMiddleware = () => {
  app = app || jsonApi._apiConfig.router || express()
  app.use((req, res, next) => {
    res.set({
      'Content-Type': 'application/vnd.api+json',
Severity: Minor
Found in lib/router.js - About 1 hr to fix

    Function _getParams has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    router._getParams = req => {
      let urlParts = req.url.split(jsonApi._apiConfig.base)
      urlParts.shift()
      urlParts = urlParts.join(jsonApi._apiConfig.base).split('?')
    
    
    Severity: Minor
    Found in lib/router.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status