michaelleeallen/reducto

View on GitHub
lib/service.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function exports has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (config, services) {
  return function service (req, res, next) {
    var parts = config.name.split(':');
    var serviceConfig = services[parts[1]][parts[0]];
    var context = _.has(config, 'context') ? config.context : _.merge({}, req.body, req.query, req.params, res.locals);
Severity: Minor
Found in lib/service.js - About 1 hr to fix

    Function service has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      return function service (req, res, next) {
        var parts = config.name.split(':');
        var serviceConfig = services[parts[1]][parts[0]];
        var context = _.has(config, 'context') ? config.context : _.merge({}, req.body, req.query, req.params, res.locals);
        var uri = utils.replaceStringTokens(context, serviceConfig.uri);
    Severity: Minor
    Found in lib/service.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status