Showing 37 of 37 total issues
Function constructor
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
constructor(config: VerifierOptions) {
this.config = config;
if (this.config.logLevel && !isEmpty(this.config.logLevel)) {
serviceFactory.logLevel(this.config.logLevel);
- 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 setupStates
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const setupStates = (
state: ProviderState,
config: ProxyOptions
): Promise<JsonMap | void> => {
logger.debug(`setting up state '${JSON.stringify(state)}'`);
- 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 registerAfterHook
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const registerAfterHook = (
app: express.Express,
config: ProxyOptions,
stateSetupPath: string
): void => {
- 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 traceHttpInteractions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const traceHttpInteractions = (): void => {
const originalRequest = http.request;
http.request = (
options: RequestOptions | string | URL,
cb: RequestOptions | ((res: IncomingMessage) => void) | undefined
- 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 cleanup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const cleanup = (
success: boolean,
pact: ConsumerPact,
opts: PactV4Options,
cleanupFn: () => void,
- 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 executeTest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const executeTest = async <T>(
pact: ConsumerPact,
opts: PactV4Options,
testFn: TestFunction<T>,
cleanupFn: () => void
- 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 reify
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function reify(input: unknown): AnyJson {
if (isMatcher(input)) {
return reify(input.value);
}
- 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 registerBeforeHook
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const registerBeforeHook = (
app: express.Express,
config: ProxyOptions,
stateSetupPath: string
): void => {
- 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 executeTest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public async executeTest<T>(
testFn: (mockServer: V3MockServer) => Promise<T>
): Promise<T | undefined> {
const scheme = this.opts.tls ? 'https' : 'http';
const host = this.opts.host || '127.0.0.1';
- 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
Avoid too many return
statements within this function. Open
return input;
Avoid too many return
statements within this function. Open
return `Unknown mismatch: ${mismatch}`;
Function setHeaders
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const setHeaders = (
part: InteractionPart,
interaction: ConsumerInteraction,
headers?: Headers
): void => {
- 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 printMismatch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function printMismatch(m: Mismatch): string {
if (isPluginContentMismatch(m)) {
const s = [
`\t${m.path}: ${m.mismatch}\n`,
m.mismatch
- 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 setRequestDetails
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const setRequestDetails = (
interaction: ConsumerInteraction,
req: V3Request
): void => {
interaction.withRequest(
- 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 appendText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public appendText(content: string | Matcher<string>): XmlElement {
if (typeof content === 'object' && content['pact:matcher:type']) {
this.children.push(
new XmlText(
isMatcher(content) &&
- 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 eachLike
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function eachLike<T>(
template: T,
opts?: { min: number }
): ArrayMatcher<T[]> {
if (isUndefined(template)) {
- 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 executeTest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async executeTest<T>(
integrationTest: (tc: TransportConfig, m: SynchronousMessage) => Promise<T>
): Promise<T | undefined> {
let val: T | undefined;
let error: Error | undefined;
- 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"