Showing 10 of 21 total issues
File metrics.go
has 533 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
package metrics
import (
"fmt"
"net/http"
Function IncWholeResponse
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func IncWholeResponse(reqID string, req http.Request, statusCode int, size int, duration int64, scheme string, cached bool, stale bool) {
Method TelemetryContext.RegisterWholeResponse
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (tc TelemetryContext) RegisterWholeResponse(reqID string, req http.Request, statusCode int, contentLength int, requestStartTime time.Time, scheme string, cached bool, stale bool) {
Method TelemetryContext.RegisterLegitRequest
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (tc TelemetryContext) RegisterLegitRequest(hostMatch bool, legitPort bool, hostname string, listeningPort string, confHostname string, confPort string) {
Function StoreMetadata
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func StoreMetadata(ctx context.Context, domainID string, method string, url url.URL, meta []string, expiration time.Duration) (bool, error) {
Avoid deeply nested control flow statements. Open
Open
} else if code < 600 {
request5xx.With(labels).Inc()
}
Method Object.StoreFullPage
has 6 return statements (exceeds 4 allowed). Open
Open
func (c Object) StoreFullPage(ctx context.Context, expiration time.Duration) (bool, error) {
if !c.IsStatusAllowed() || !c.IsMethodAllowed() || expiration < 1 {
logger.GetGlobal().WithFields(log.Fields{
"ReqID": c.ReqID,
}).Debugf(
Method Object.RetrieveFullPage
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *Object) RetrieveFullPage() error {
obj := &URIObj{}
meta, err := FetchMetadata(c.DomainID, c.CurrentURIObject.Method, c.CurrentURIObject.URL)
if err != nil {
Function LogRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func LogRequest(req http.Request, statusCode int, lenContent int, reqID string, cacheLabel int) {
Method TelemetryContext.RegisterRequestCall
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (tc TelemetryContext) RegisterRequestCall(reqID string, req http.Request, reqURL url.URL, scheme string, webSocket bool) {