dustin-H/bauhaus-ui

View on GitHub
src/utils/helpers/superagentPlugin.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function superagentPlugin has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var superagentPlugin = function(config = {}) {
  if (config.disable == null) {
    config.disable = {}
  }
  return function(request) {
Severity: Minor
Found in src/utils/helpers/superagentPlugin.js - About 1 hr to fix

    Function end has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        request.end = function(fn) {
          if (config.auth === true && state.auth.token != null && state.auth.token !== '' && state.auth.error === false && state.auth.header != null && state.auth.header !== '') {
            request = request.set(state.auth.header, state.auth.token)
          }
          request._end(function(err, res) { // TODO: REFACTOR THIS
    Severity: Minor
    Found in src/utils/helpers/superagentPlugin.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

            if (config.auth === true && state.auth.token != null && state.auth.token !== '' && state.auth.error === false && state.auth.header != null && state.auth.header !== '') {
              request = request.set(state.auth.header, state.auth.token)
            }
      Severity: Major
      Found in src/utils/helpers/superagentPlugin.js - About 40 mins to fix

        There are no issues that match your filters.

        Category
        Status