keymetrics/pm2-io-apm

View on GitHub
src/metrics/httpMetrics.ts

Summary

Maintainability
A
3 hrs
Test Coverage

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

  private registerHttpsMetric () {
    if (this.metricService === undefined) return this.logger(`Failed to load metric service`)
    const histogram = new Histogram()
    const p50: InternalMetric = {
      name: `HTTPS Mean Latency`,
Severity: Minor
Found in src/metrics/httpMetrics.ts - About 1 hr to fix

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

      private registerHttpMetric () {
        if (this.metricService === undefined) return this.logger(`Failed to load metric service`)
        const histogram = new Histogram()
        const p50: InternalMetric = {
          name: `HTTP Mean Latency`,
    Severity: Minor
    Found in src/metrics/httpMetrics.ts - About 1 hr to fix

      Function hookHttp has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private hookHttp (nodule: any, name: string) {
          if (nodule.Server === undefined || nodule.Server.prototype === undefined) return
          if (this.modules[name] !== undefined) return this.logger(`Module ${name} already hooked`)
          this.logger(`Hooking to ${name} module`)
          this.modules[name] = nodule.Server.prototype
      Severity: Minor
      Found in src/metrics/httpMetrics.ts - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status