Preparing report...

Report for github.com/twsnmp/twsnmpfc

A+    Excellent!    Found 51 issues across 87 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


golint52%

Golint is a linter for Go source code.

    • twsnmpfc/datastore/ai.go
    • Line 10: warning: exported type AIResult should have comment or be unexported (golint)
    • Line 16: warning: exported function SaveAIResult should have comment or be unexported (golint)
    • Line 33: warning: exported function GetAIReesult should have comment or be unexported (golint)
    • Line 59: warning: exported function DeleteAIResult should have comment or be unexported (golint)
    • twsnmpfc/datastore/map.go
    • Line 136: warning: exported function SaveBackImage should have comment or be unexported (golint)
    • Line 146: warning: exported function GetBackImage should have comment or be unexported (golint)
    • Line 175: warning: exported function GetPrivateKey should have comment or be unexported (golint)
    • Line 179: warning: exported function SaveMapConf should have comment or be unexported (golint)
    • twsnmpfc/datastore/polling.go
    • Line 13: warning: exported type PollingEnt should have comment or be unexported (golint)
    • Line 34: warning: exported type PollingLogEnt should have comment or be unexported (golint)
    • Line 66: warning: exported function UpdatePolling should have comment or be unexported (golint)
    • Line 86: warning: exported function DeletePolling should have comment or be unexported (golint)
    • Line 92: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 127: warning: exported function AddPollingLog should have comment or be unexported (golint)
    • Line 148: warning: exported function ForEachPollingLog should have comment or be unexported (golint)
    • Line 183: warning: exported function ClearPollingLog should have comment or be unexported (golint)
    • twsnmpfc/report/report.go
    • Line 34: warning: exported function Start should have comment or be unexported (golint)
    • Line 45: warning: exported function UpdateReportConf should have comment or be unexported (golint)
    • Line 503: warning: exported type AddrInfoEnt should have comment or be unexported (golint)
    • Line 509: warning: exported function GetAddressInfo should have comment or be unexported (golint)
    • twsnmpfc/datastore/backup.go
    • Line 21: warning: exported type DBBackupEnt should have comment or be unexported (golint)
    • Line 27: warning: exported function SaveBackup should have comment or be unexported (golint)
    • Line 44: warning: exported function CheckDBBackup should have comment or be unexported (golint)
    • Line 103: warning: exported function StopBackup should have comment or be unexported (golint)
    • Line 273: warning: exported function RestoreDB should have comment or be unexported (golint)
    • twsnmpfc/datastore/stats.go
    • Line 12: warning: exported type DBStatsEnt should have comment or be unexported (golint)
    • Line 26: warning: exported type DBStatsLogEnt should have comment or be unexported (golint)
    • Line 32: warning: exported function UpdateDBStats should have comment or be unexported (golint)
    • twsnmpfc/polling/polling.go
    • Line 41: warning: exported function Start should have comment or be unexported (golint)
    • Line 47: warning: exported function AutoAddPolling should have comment or be unexported (golint)
    • Line 60: warning: exported function PollNowNode should have comment or be unexported (golint)
    • Line 85: warning: exported function CheckAllPoll should have comment or be unexported (golint)
    • twsnmpfc/datastore/report_user.go
    • Line 3: warning: exported type UserClientEnt should have comment or be unexported (golint)
    • Line 8: warning: exported type UserEnt should have comment or be unexported (golint)
    • Line 25: warning: exported function GetUser should have comment or be unexported (golint)
    • Line 32: warning: exported function AddUser should have comment or be unexported (golint)
    • Line 36: warning: exported function ForEachUsers should have comment or be unexported (golint)
    • Line 43: warning: exported function DeleteUser should have comment or be unexported (golint)
    • twsnmpfc/backend/backend.go
    • Line 16: warning: exported function Start should have comment or be unexported (golint)
    • Line 28: warning: exported function HasNewVersion should have comment or be unexported (golint)
    • twsnmpfc/datastore/arp.go
    • Line 9: warning: exported type ArpEnt should have comment or be unexported (golint)
    • Line 14: warning: exported function UpdateArpEnt should have comment or be unexported (golint)
    • Line 24: warning: exported function ForEachArp should have comment or be unexported (golint)
    • Line 47: warning: exported function ResetArpTable should have comment or be unexported (golint)
    • twsnmpfc/datastore/datastore.go
    • Line 28: warning: comment on exported var MapConf should be of the form "MapConf ..." (golint)
    • Line 30: warning: exported var NotifyConf should have comment or be unexported (golint)
    • Line 51: warning: comment on exported var MIBDB should be of the form "MIBDB ..." (golint)
    • Line 91: warning: exported function Init should have comment or be unexported (golint)
    • twsnmpfc/datastore/report.go
    • Line 10: warning: exported function LoadReport should have comment or be unexported (golint)
    • Line 70: warning: exported function SaveReport should have comment or be unexported (golint)
    • Line 165: warning: exported function DeleteReport should have comment or be unexported (golint)
    • Line 193: warning: exported function ClearReport should have comment or be unexported (golint)
    • twsnmpfc/datastore/report_flow.go
    • Line 3: warning: exported type ServerEnt should have comment or be unexported (golint)
    • Line 20: warning: exported type FlowEnt should have comment or be unexported (golint)
    • Line 41: warning: exported function GetFlow should have comment or be unexported (golint)
    • Line 48: warning: exported function AddFlow should have comment or be unexported (golint)
    • Line 52: warning: exported function ForEachFlows should have comment or be unexported (golint)
    • Line 59: warning: exported function GetServer should have comment or be unexported (golint)
    • Line 66: warning: exported function AddServer should have comment or be unexported (golint)
    • Line 70: warning: exported function ForEachServers should have comment or be unexported (golint)
    • twsnmpfc/report/flow.go
    • Line 23: warning: exported function ReportFlow should have comment or be unexported (golint)
    • Line 39: warning: exported function ResetFlowsScore should have comment or be unexported (golint)
    • Line 51: warning: exported function ResetServersScore should have comment or be unexported (golint)
    • Line 136: warning: exported var UnKnownPortMap should have comment or be unexported (golint)
    • twsnmpfc/report/device.go
    • Line 17: warning: exported function ReportDevice should have comment or be unexported (golint)
    • Line 26: warning: exported function ResetDevicesScore should have comment or be unexported (golint)
    • twsnmpfc/datastore/discover.go
    • Line 10: warning: exported type DiscoverConfEnt should have comment or be unexported (golint)
    • Line 20: warning: exported function SaveDiscoverConf should have comment or be unexported (golint)
    • twsnmpfc/datastore/influxdb.go
    • Line 14: warning: exported type InfluxdbConfEnt should have comment or be unexported (golint)
    • Line 24: warning: exported function SaveInfluxdbConf should have comment or be unexported (golint)
    • Line 45: warning: exported function InitInfluxdb should have comment or be unexported (golint)
    • Line 121: warning: exported function SendPollingLogToInfluxdb should have comment or be unexported (golint)
    • Line 171: warning: exported function SendAIScoreToInfluxdb should have comment or be unexported (golint)
    • twsnmpfc/datastore/notify.go
    • Line 10: warning: exported type NotifyConfEnt should have comment or be unexported (golint)
    • Line 25: warning: exported function SaveNotifyConf should have comment or be unexported (golint)
    • twsnmpfc/polling/dns.go
    • Line 106: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 119: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 128: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 134: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • twsnmpfc/ping/ping.go
    • Line 29: warning: exported type PingStat should have comment or be unexported (golint)
    • Line 32: warning: exported const PingStart should have comment (or a comment on this block) or be unexported (golint)
    • Line 44: warning: exported type PingEnt should have comment or be unexported (golint)
    • Line 67: warning: exported function Start should have comment or be unexported (golint)
    • twsnmpfc/datastore/geoip.go
    • Line 53: warning: exported function GetLoc should have comment or be unexported (golint)
    • Line 79: warning: exported function IsPrivateIP should have comment or be unexported (golint)
    • Line 103: warning: exported function IsGlobalUnicast should have comment or be unexported (golint)
    • twsnmpfc/report/user.go
    • Line 19: warning: exported function ReportUser should have comment or be unexported (golint)
    • Line 29: warning: exported function ResetUsersScore should have comment or be unexported (golint)
    • twsnmpfc/datastore/grok.go
    • Line 9: warning: exported type GrokEnt should have comment or be unexported (golint)
    • Line 109: warning: exported function GetGrokEnt should have comment or be unexported (golint)
    • Line 133: warning: exported function DeleteGrokEnt should have comment or be unexported (golint)
    • Line 148: warning: exported function ForEachGrokEnt should have comment or be unexported (golint)
    • twsnmpfc/datastore/log.go
    • Line 17: warning: exported const LogModeNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported type EventLogEnt should have comment or be unexported (golint)
    • Line 32: warning: exported type LogEnt should have comment or be unexported (golint)
    • Line 38: warning: exported type LogFilterEnt should have comment or be unexported (golint)
    • Line 45: warning: exported function AddEventLog should have comment or be unexported (golint)
    • Line 56: warning: exported function ForEachEventLog should have comment or be unexported (golint)
    • Line 87: warning: exported function ForEachLastEventLog should have comment or be unexported (golint)
    • Line 111: warning: exported function ForEachLog should have comment or be unexported (golint)
    • Line 182: warning: exported function DeleteAllLogs should have comment or be unexported (golint)
    • Line 195: warning: exported function DeleteArp should have comment or be unexported (golint)
    • Line 260: warning: exported function SaveLogBuffer should have comment or be unexported (golint)
    • twsnmpfc/datastore/node.go
    • Line 11: warning: exported type NodeEnt should have comment or be unexported (golint)
    • Line 80: warning: exported function AddNode should have comment or be unexported (golint)
    • Line 102: warning: exported function UpdateNode should have comment or be unexported (golint)
    • Line 120: warning: exported function DeleteNode should have comment or be unexported (golint)
    • Line 126: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 154: warning: exported function GetNode should have comment or be unexported (golint)
    • Line 164: warning: exported function FindNodeFromIP should have comment or be unexported (golint)
    • Line 176: warning: exported function FindNodeFromMAC should have comment or be unexported (golint)
    • Line 188: warning: exported function ForEachNodes should have comment or be unexported (golint)
    • Line 200: warning: exported function DeleteNodeStateChanged should have comment or be unexported (golint)
    • Line 204: warning: exported function ForEachStateChangedNodes should have comment or be unexported (golint)
    • twsnmpfc/datastore/pollingtemplate.go
    • Line 10: warning: exported type PollingTemplateEnt should have comment or be unexported (golint)
    • Line 26: warning: exported function GetPollingTemplate should have comment or be unexported (golint)
    • Line 33: warning: exported function ForEachPollingTemplate should have comment or be unexported (golint)
    • twsnmpfc/webapi/webapi.go
    • Line 23: warning: exported type WebAPI should have comment or be unexported (golint)
    • Line 42: warning: exported function Start should have comment or be unexported (golint)
    • Line 50: warning: exported function Stop should have comment or be unexported (golint)
    • twsnmpfc/notify/notify.go
    • Line 23: warning: exported function Start should have comment or be unexported (golint)
    • Line 197: warning: exported function SendTestMail should have comment or be unexported (golint)
    • twsnmpfc/discover/discover.go
    • Line 27: warning: exported var Stat should have comment or be unexported (golint)
    • Line 33: warning: exported type DiscoverStat should have comment or be unexported (golint)
    • Line 68: warning: exported function StartDiscover should have comment or be unexported (golint)
    • twsnmpfc/datastore/line.go
    • Line 9: warning: exported type LineEnt should have comment or be unexported (golint)
    • Line 19: warning: exported function AddLine should have comment or be unexported (golint)
    • Line 41: warning: exported function UpdateLine should have comment or be unexported (golint)
    • Line 59: warning: exported function DeleteLine should have comment or be unexported (golint)
    • Line 74: warning: exported function GetLine should have comment or be unexported (golint)
    • twsnmpfc/datastore/report_device.go
    • Line 3: warning: exported type DeviceEnt should have comment or be unexported (golint)
    • Line 17: warning: exported function GetDevice should have comment or be unexported (golint)
    • Line 24: warning: exported function AddDevice should have comment or be unexported (golint)
    • Line 28: warning: exported function ForEachDevices should have comment or be unexported (golint)
    • twsnmpfc/datastore/report_ip.go
    • Line 5: warning: exported type IPReportEnt should have comment or be unexported (golint)
    • Line 22: warning: exported function GetIPReport should have comment or be unexported (golint)
    • Line 29: warning: exported function AddIPReport should have comment or be unexported (golint)
    • Line 34: warning: exported function ForEachIPReport should have comment or be unexported (golint)

gocyclo77%

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.

    • twsnmpfc/discover/discover.go
    • Line 68: warning: cyclomatic complexity 27 of function StartDiscover() is high (> 15) (gocyclo)
    • Line 332: warning: cyclomatic complexity 22 of function addBasicPolling() is high (> 15) (gocyclo)
    • twsnmpfc/webapi/netflow.go
    • Line 200: warning: cyclomatic complexity 45 of function postIPFIX() is high (> 15) (gocyclo)
    • Line 44: warning: cyclomatic complexity 41 of function postNetFlow() is high (> 15) (gocyclo)
    • twsnmpfc/polling/snmp.go
    • Line 158: warning: cyclomatic complexity 29 of function doPollingSnmpGet() is high (> 15) (gocyclo)
    • Line 322: warning: cyclomatic complexity 16 of function doPollingSnmpProcess() is high (> 15) (gocyclo)

ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


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!