src/models/http/httpProxy.js
Function create
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function create (logger) {
const BINARY_CONTENT_ENCODINGS = [
'gzip', 'br', 'compress', 'deflate'
];
const BINARY_MIME_TYPES = [
Function create
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Open
function create (logger) {
const BINARY_CONTENT_ENCODINGS = [
'gzip', 'br', 'compress', 'deflate'
];
const BINARY_MIME_TYPES = [
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getProxyRequest
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getProxyRequest (baseUrl, originalRequest, proxyOptions, requestDetails) {
/* eslint complexity: 0 */
const parts = new URL(baseUrl),
protocol = parts.protocol === 'https:' ? https : http,
defaultPort = parts.protocol === 'https:' ? 443 : 80,
Function to
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function to (proxyDestination, originalRequest, options, requestDetails) {
addInjectedHeadersTo(originalRequest, options.injectHeaders);
function log (direction, what) {
Parsing error: Invalid ecmaVersion. Open
Open
'use strict';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/