keymetrics/pm2-io-apm

View on GitHub
src/census/plugins/http2.ts

Summary

Maintainability
C
7 hrs
Test Coverage

Function getPatchEmitFunction has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private getPatchEmitFunction () {
    const plugin = this
    return (original: RequestFunction): Func<http2.ClientHttp2Stream> => {
      return function patchedEmit (
                 this: http2.Http2Server, event: string,
Severity: Major
Found in src/census/plugins/http2.ts - About 2 hrs to fix

    Function patchedEmit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          return function patchedEmit (
                     this: http2.Http2Server, event: string,
                     stream: http2.ServerHttp2Stream,
                     headers: http2.IncomingHttpHeaders): http2.ClientHttp2Stream {
            if (event !== 'stream') {
    Severity: Minor
    Found in src/census/plugins/http2.ts - About 2 hrs to fix

      Function getMakeHttp2RequestTraceFunction has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private getMakeHttp2RequestTraceFunction (
            request: http2.ClientHttp2Stream, headers: http2.OutgoingHttpHeaders,
            authority: string, plugin: Http2Plugin): Func<http2.ClientHttp2Stream> {
          return (span: Span): http2.ClientHttp2Stream => {
            if (!span) return request
      Severity: Minor
      Found in src/census/plugins/http2.ts - About 1 hr to fix

        Function getPatchRequestFunction has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private getPatchRequestFunction () {
            const plugin = this
            return (original: RequestFunction,
                    authority: string): Func<http2.ClientHttp2Stream> => {
              return function patchedRequest (
        Severity: Minor
        Found in src/census/plugins/http2.ts - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status