Preparing report...

Report for github.com/chenjiandongx/sniffer

(v0.2.0)

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


gocyclo100%

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.

No problems detected. Good job!


golint22%

Golint is a linter for Go source code.

    • sniffer/cli.go
    • Line 11: warning: exported function NewApp should have comment or be unexported (golint)
    • sniffer/dns.go
    • Line 12: warning: exported type Lookup should have comment or be unexported (golint)
    • Line 14: warning: exported type DNSResolver should have comment or be unexported (golint)
    • Line 20: warning: exported function NewDnsResolver should have comment or be unexported (golint)
    • Line 48: warning: exported method DNSResolver.Close should have comment or be unexported (golint)
    • Line 53: warning: exported method DNSResolver.Lookup should have comment or be unexported (golint)
    • sniffer/pcap.go
    • Line 15: warning: exported type RemoteSocket should have comment or be unexported (golint)
    • Line 20: warning: exported type LocalSocket should have comment or be unexported (golint)
    • Line 26: warning: exported type Connection should have comment or be unexported (golint)
    • Line 31: warning: exported type OpenSockets should have comment or be unexported (golint)
    • Line 32: warning: exported type Utilization should have comment or be unexported (golint)
    • Line 34: warning: exported type SocketFetcher should have comment or be unexported (golint)
    • Line 38: warning: exported type Protocol should have comment or be unexported (golint)
    • Line 41: warning: exported const ProtoTCP should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported type Direction should have comment or be unexported (golint)
    • Line 48: warning: exported const DirectionUpload should have comment (or a comment on this block) or be unexported (golint)
    • Line 52: warning: exported type ConnectionInfo should have comment or be unexported (golint)
    • Line 60: warning: exported type Segment should have comment or be unexported (golint)
    • Line 72: warning: exported type PcapClient should have comment or be unexported (golint)
    • Line 86: warning: exported function NewPcapClient should have comment or be unexported (golint)
    • Line 110: warning: exported function ListAllDevices should have comment or be unexported (golint)
    • Line 321: warning: exported method PcapClient.Close should have comment or be unexported (golint)
    • Line 330: warning: exported method PcapClient.GetUtilization should have comment or be unexported (golint)
    • sniffer/sniffer.go
    • Line 41: warning: exported method Options.Validate should have comment or be unexported (golint)
    • Line 51: warning: exported function DefaultOptions should have comment or be unexported (golint)
    • Line 62: warning: exported type Sniffer should have comment or be unexported (golint)
    • Line 71: warning: exported function NewSniffer should have comment or be unexported (golint)
    • Line 88: warning: exported method Sniffer.SwitchViewMode should have comment or be unexported (golint)
    • Line 96: warning: exported method Sniffer.Start should have comment or be unexported (golint)
    • Line 127: warning: exported method Sniffer.Close should have comment or be unexported (golint)
    • Line 133: warning: exported method Sniffer.Refresh should have comment or be unexported (golint)
    • sniffer/stat.go
    • Line 14: warning: exported type Stat should have comment or be unexported (golint)
    • Line 19: warning: exported type ConnectionData should have comment or be unexported (golint)
    • Line 28: warning: exported type NetworkData should have comment or be unexported (golint)
    • Line 36: warning: exported method NetworkData.DivideBy should have comment or be unexported (golint)
    • Line 43: warning: exported method ConnectionData.DivideBy should have comment or be unexported (golint)
    • Line 50: warning: exported type ProcessesResult should have comment or be unexported (golint)
    • Line 55: warning: exported type RemoteAddrsResult should have comment or be unexported (golint)
    • Line 60: warning: exported type ConnectionsResult should have comment or be unexported (golint)
    • Line 65: warning: exported type Snapshot should have comment or be unexported (golint)
    • Line 76: warning: exported method Snapshot.TopNProcesses should have comment or be unexported (golint)
    • Line 99: warning: exported method Snapshot.TopNRemoteAddrs should have comment or be unexported (golint)
    • Line 122: warning: exported method Snapshot.TopNConnections should have comment or be unexported (golint)
    • Line 145: warning: exported type StatsManager should have comment or be unexported (golint)
    • Line 152: warning: exported function NewStatsManager should have comment or be unexported (golint)
    • Line 160: warning: exported method StatsManager.Put should have comment or be unexported (golint)
    • Line 185: warning: exported method StatsManager.GetStats should have comment or be unexported (golint)
    • sniffer/ui.go
    • Line 22: warning: exported type UIComponent should have comment or be unexported (golint)
    • Line 26: warning: exported type ViewMode should have comment or be unexported (golint)
    • Line 28: warning: exported method ViewMode.Validate should have comment or be unexported (golint)
    • Line 37: warning: exported const ModeTableBytes should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type Unit should have comment or be unexported (golint)
    • Line 45: warning: exported const UnitB should have comment (or a comment on this block) or be unexported (golint)
    • Line 51: warning: exported method Unit.Validate should have comment or be unexported (golint)
    • Line 63: warning: exported method Unit.Ratio should have comment or be unexported (golint)
    • Line 115: warning: exported function NewUIComponent should have comment or be unexported (golint)
    • Line 144: warning: exported method UIComponent.Close should have comment or be unexported (golint)
    • Line 176: warning: exported type Viewer should have comment or be unexported (golint)
    • Line 183: warning: exported type PlotViewer should have comment or be unexported (golint)
    • Line 205: warning: exported method PlotViewer.Setup should have comment or be unexported (golint)
    • Line 286: warning: exported method PlotViewer.Shift should have comment or be unexported (golint)
    • Line 296: warning: exported method PlotViewer.Resize should have comment or be unexported (golint)
    • Line 304: warning: exported method PlotViewer.Render should have comment or be unexported (golint)
    • Line 322: warning: exported type TableViewer should have comment or be unexported (golint)
    • Line 334: warning: exported method TableViewer.Setup should have comment or be unexported (golint)
    • Line 467: warning: exported method TableViewer.Shift should have comment or be unexported (golint)
    • Line 474: warning: exported method TableViewer.Resize should have comment or be unexported (golint)
    • Line 479: warning: exported method TableViewer.Render should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!