Preparing report...

Report for github.com/toni-moreno/snmpcollector

A+    Excellent!    Found 26 issues across 64 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!


gocyclo78%

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.

    • snmpcollector/pkg/config/snmpmetriccfg.go
    • Line 109: warning: cyclomatic complexity 46 of function (*SnmpMetricCfg).Init() is high (> 15) (gocyclo)
    • Line 279: warning: cyclomatic complexity 17 of function (*SnmpMetricCfg).GetMultiStringTagFieldMap() is high (> 15) (gocyclo)
    • Line 214: warning: cyclomatic complexity 17 of function (*SnmpMetricCfg).GetValidConversions() is high (> 15) (gocyclo)
    • snmpcollector/pkg/data/measurement/measurement.go
    • Line 749: warning: cyclomatic complexity 28 of function (*Measurement).loadIndexedLabels() is high (> 15) (gocyclo)
    • Line 180: warning: cyclomatic complexity 21 of function (*Measurement).BuildMultiIndexLabels() is high (> 15) (gocyclo)
    • Line 627: warning: cyclomatic complexity 17 of function (*Measurement).ComputeEvaluatedMetrics() is high (> 15) (gocyclo)
    • Line 391: warning: cyclomatic complexity 17 of function (*Measurement).AddFilter() is high (> 15) (gocyclo)
    • Line 468: warning: cyclomatic complexity 16 of function (*Measurement).UpdateFilter() is high (> 15) (gocyclo)
    • snmpcollector/pkg/data/snmp/snmp.go
    • Line 497: warning: cyclomatic complexity 30 of function GetClient() is high (> 15) (gocyclo)
    • Line 61: warning: cyclomatic complexity 21 of function PduVal2Cooked() is high (> 15) (gocyclo)
    • Line 108: warning: cyclomatic complexity 21 of function PduType2Str() is high (> 15) (gocyclo)
    • Line 258: warning: cyclomatic complexity 16 of function GetSysInfo() is high (> 15) (gocyclo)

golint85%

Golint is a linter for Go source code.

    • snmpcollector/pkg/data/snmp/client.go
    • Line 9: warning: exported type Client should have comment or be unexported (golint)
    • Line 18: warning: exported function New should have comment or be unexported (golint)
    • Line 51: warning: exported method Client.Connect should have comment or be unexported (golint)
    • Line 58: warning: exported method Client.Target should have comment or be unexported (golint)
    • Line 62: warning: comment on exported method Client.Get should be of the form "Get ..." (golint)
    • snmpcollector/pkg/config/snmpmetriccfg.go
    • Line 22: warning: exported type ConversionMode should have comment or be unexported (golint)
    • Line 25: warning: exported const FLOAT should have comment (or a comment on this block) or be unexported (golint)
    • Line 230: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • snmpcollector/pkg/mock/snmpserver.go
    • Line 35: warning: exported method SnmpServer.ResponseForPkt should have comment or be unexported (golint)
    • Line 93: warning: exported var ErrUnsupportedProtoVersion should have comment or be unexported (golint)
    • Line 94: warning: exported var ErrNoSNMPInstance should have comment or be unexported (golint)
    • Line 95: warning: exported var ErrUnsupportedOperation should have comment or be unexported (golint)
    • Line 96: warning: exported var ErrNoPermission should have comment or be unexported (golint)
    • Line 97: warning: exported var ErrUnsupportedPacketData should have comment or be unexported (golint)
    • snmpcollector/pkg/data/utils/utils.go
    • Line 121: warning: exported type NetworkAddress should have comment or be unexported (golint)
    • Line 126: warning: exported function SplitHostPortDefault should have comment or be unexported (golint)
    • Line 168: warning: exported function DecodeBasicAuthHeader should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign90%

IneffAssign detects ineffectual assignments in Go code.


misspell95%

Misspell Finds commonly misspelled English words

    • snmpcollector/pkg/webui/websession.go
    • Line 98: warning: "Destory" is a misspelling of "Destroy" (misspell)
    • Line 99: warning: "Destory" is a misspelling of "Destroy" (misspell)
    • Line 149: warning: "Destory" is a misspelling of "Destroy" (misspell)
    • Line 149: warning: "destory" is a misspelling of "destroy" (misspell)
    • Line 150: warning: "Destory" is a misspelling of "Destroy" (misspell)