DEFRA/hapi-pg-rest-api

View on GitHub
src/controller.js

Summary

Maintainability
A
2 hrs
Test Coverage
A
96%

Function create has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const create = async (request, h) => {
  const config = request.route.settings.plugins.hapiPgRestAPI
  const repo = manager.get(config.name)
  const { columns, data: payload } = await getRequestData(request, config)

Severity: Minor
Found in src/controller.js - About 1 hr to fix

    Function updateOne has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const updateOne = async (request, h) => {
      const config = request.route.settings.plugins.hapiPgRestAPI
      const repo = manager.get(config.name)
      const { columns, filter } = await getRequestData(request, config)
    
    
    Severity: Minor
    Found in src/controller.js - About 1 hr to fix

      Avoid too many return statements within this function.
      Open

          return errorReply(error, h)
      Severity: Major
      Found in src/controller.js - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status