Preparing report...

Report for github.com/prometheus/client_golang

(v1.20.5)

A+    Excellent!    Found 16 issues across 130 files

Tweet

go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo87%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • prometheus/histogram.go
    • Line 1690: warning: cyclomatic complexity 25 of function (*nativeExemplars).addExemplar() is high (> 15) (gocyclo)
    • Line 529: warning: cyclomatic complexity 17 of function newHistogram() is high (> 15) (gocyclo)
    • prometheus/vec_test.go
    • Line 702: warning: cyclomatic complexity 42 of function testConstrainedCurryVec() is high (> 15) (gocyclo)
    • Line 505: warning: cyclomatic complexity 40 of function testCurryVec() is high (> 15) (gocyclo)
    • prometheus/internal/difflib.go
    • Line 566: warning: cyclomatic complexity 23 of function WriteUnifiedDiff() is high (> 15) (gocyclo)
    • Line 226: warning: cyclomatic complexity 22 of function (*SequenceMatcher).findLongestMatch() is high (> 15) (gocyclo)
    • prometheus/registry.go
    • Line 412: warning: cyclomatic complexity 27 of function (*Registry).Gather() is high (> 15) (gocyclo)
    • Line 620: warning: cyclomatic complexity 25 of function processMetric() is high (> 15) (gocyclo)
    • Line 869: warning: cyclomatic complexity 21 of function checkMetricConsistency() is high (> 15) (gocyclo)
    • Line 270: warning: cyclomatic complexity 16 of function (*Registry).Register() is high (> 15) (gocyclo)
    • prometheus/promhttp/http_test.go
    • Line 369: warning: cyclomatic complexity 23 of function TestInstrumentMetricHandlerWithCompression() is high (> 15) (gocyclo)
    • Line 104: warning: cyclomatic complexity 17 of function TestHandlerErrorHandling() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!