Preparing report...

Report for github.com/elastic/apm-agent-go

A+    Excellent!    Found 32 issues across 354 files

Tweet

gofmt98%

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


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!


gocyclo94%

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.

    • apm-agent-go/model/marshal_fastjson.go
    • Line 26: warning: cyclomatic complexity 27 of function (*Service).MarshalFastJSON() is high (> 15) (gocyclo)
    • Line 987: warning: cyclomatic complexity 27 of function (*Error).MarshalFastJSON() is high (> 15) (gocyclo)
    • Line 870: warning: cyclomatic complexity 25 of function (*Context).MarshalFastJSON() is high (> 15) (gocyclo)
    • Line 551: warning: cyclomatic complexity 25 of function (*Span).MarshalFastJSON() is high (> 15) (gocyclo)
    • Line 1075: warning: cyclomatic complexity 21 of function (*Exception).MarshalFastJSON() is high (> 15) (gocyclo)
    • Line 623: warning: cyclomatic complexity 21 of function (*SpanContext).MarshalFastJSON() is high (> 15) (gocyclo)
    • Line 1146: warning: cyclomatic complexity 19 of function (*StacktraceFrame).MarshalFastJSON() is high (> 15) (gocyclo)
    • Line 1261: warning: cyclomatic complexity 19 of function (*Request).MarshalFastJSON() is high (> 15) (gocyclo)
    • Line 484: warning: cyclomatic complexity 19 of function (*Transaction).MarshalFastJSON() is high (> 15) (gocyclo)
    • Line 1397: warning: cyclomatic complexity 17 of function (*Metrics).MarshalFastJSON() is high (> 15) (gocyclo)
    • apm-agent-go/module/apmot/span.go
    • Line 226: warning: cyclomatic complexity 22 of function (*otSpan).setTransactionContext() is high (> 15) (gocyclo)
    • Line 145: warning: cyclomatic complexity 20 of function (*otSpan).setSpanContext() is high (> 15) (gocyclo)
    • apm-agent-go/tracer.go
    • Line 765: warning: cyclomatic complexity 106 of function (*Tracer).loop() is high (> 15) (gocyclo)
    • Line 123: warning: cyclomatic complexity 32 of function (*TracerOptions).initDefaults() is high (> 15) (gocyclo)

golint100%

Golint is a linter for Go source code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.

    • apm-agent-go/model/marshal_fastjson.go
    • Line 113: warning: ineffectual assignment to first (ineffassign)
    • Line 227: warning: ineffectual assignment to first (ineffassign)
    • Line 302: warning: ineffectual assignment to first (ineffassign)
    • Line 341: warning: ineffectual assignment to first (ineffassign)
    • Line 409: warning: ineffectual assignment to first (ineffassign)
    • Line 446: warning: ineffectual assignment to first (ineffassign)
    • Line 473: warning: ineffectual assignment to first (ineffassign)
    • Line 678: warning: ineffectual assignment to first (ineffassign)
    • Line 730: warning: ineffectual assignment to first (ineffassign)
    • Line 769: warning: ineffectual assignment to first (ineffassign)
    • Line 859: warning: ineffectual assignment to first (ineffassign)
    • Line 937: warning: ineffectual assignment to first (ineffassign)
    • Line 976: warning: ineffectual assignment to first (ineffassign)
    • Line 1064: warning: ineffectual assignment to first (ineffassign)
    • Line 1336: warning: ineffectual assignment to first (ineffassign)
    • Line 1386: warning: ineffectual assignment to first (ineffassign)
    • Line 1464: warning: ineffectual assignment to first (ineffassign)
    • Line 1491: warning: ineffectual assignment to first (ineffassign)

misspell99%

Misspell Finds commonly misspelled English words