RHeactorJS/bdd-contexts

View on GitHub
src/rest-client.js

Summary

Maintainability
D
1 day
Test Coverage

File rest-client.js has 438 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import _forIn from 'lodash/forIn'
import _filter from 'lodash/filter'
import _merge from 'lodash/merge'
import _property from 'lodash/property'
import {expect} from 'chai'
Severity: Minor
Found in src/rest-client.js - About 6 hrs to fix

    RestClientContext has 47 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export const RestClientContext = {
      beforeScenario: (context) => {
        context.body = undefined
        context.header = {}
      },
    Severity: Minor
    Found in src/rest-client.js - About 6 hrs to fix

      Function doRequest has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function doRequest (context, method, endpoint, next) {
        let agent = client(context)
        let url = utils.template(endpoint, utils.data(context))
        let localUrl = url.replace(testHost, '')
        if (process.env.DEBUG_REST) {
      Severity: Minor
      Found in src/rest-client.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                    if (response.headers['www-authenticate']) console.log('<', 'www-authenticate:', response.headers['www-authenticate'])
        Severity: Major
        Found in src/rest-client.js - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status