Preparing report...

Report for github.com/google/gopacket

(v1.1.19)

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


gofmt79%

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

    • gen.go
    • Line 1: warning: file is not gofmted with -s (gofmt)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo82%

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.

    • layers/cdp.go
    • Line 270: warning: cyclomatic complexity 61 of function decodeCiscoDiscoveryInfo() is high (> 15) (gocyclo)
    • Line 550: warning: cyclomatic complexity 28 of function (CDPTLVType).String() is high (> 15) (gocyclo)
    • Line 510: warning: cyclomatic complexity 16 of function decodeAddresses() is high (> 15) (gocyclo)
    • layers/sctp.go
    • Line 248: warning: cyclomatic complexity 20 of function (SCTPPayloadProtocol).String() is high (> 15) (gocyclo)
    • pcapgo/capture.go
    • Line 44: warning: cyclomatic complexity 18 of function (*EthernetHandle).readOne() is high (> 15) (gocyclo)
    • pcapgo/ngread.go
    • Line 443: warning: cyclomatic complexity 25 of function (*NgReader).readPacketHeader() is high (> 15) (gocyclo)
    • Line 197: warning: cyclomatic complexity 20 of function (*NgReader).readSectionHeader() is high (> 15) (gocyclo)
    • Line 325: warning: cyclomatic complexity 17 of function (*NgReader).readInterfaceDescriptor() is high (> 15) (gocyclo)
    • pcapgo/ngwrite.go
    • Line 118: warning: cyclomatic complexity 20 of function (*NgWriter).writeOptions() is high (> 15) (gocyclo)
    • layers/dot11.go
    • Line 421: warning: cyclomatic complexity 172 of function (Dot11InformationElementID).String() is high (> 15) (gocyclo)
    • Line 918: warning: cyclomatic complexity 28 of function (*Dot11).DecodeFromBytes() is high (> 15) (gocyclo)
    • layers/ndp.go
    • Line 241: warning: cyclomatic complexity 160 of function (NDPChassisType).String() is high (> 15) (gocyclo)
    • examples/reassemblydump/main.go
    • Line 469: warning: cyclomatic complexity 40 of function main() is high (> 15) (gocyclo)
    • Line 145: warning: cyclomatic complexity 33 of function (*httpReader).run() is high (> 15) (gocyclo)
    • Line 376: warning: cyclomatic complexity 22 of function (*tcpStream).ReassembledSG() is high (> 15) (gocyclo)
    • reassembly/tcpassembly.go
    • Line 750: warning: cyclomatic complexity 31 of function (*Assembler).checkOverlap() is high (> 15) (gocyclo)
    • Line 638: warning: cyclomatic complexity 26 of function (*Assembler).AssembleWithContext() is high (> 15) (gocyclo)
    • Line 1020: warning: cyclomatic complexity 16 of function (*Assembler).cleanSG() is high (> 15) (gocyclo)
    • layers/sflow.go
    • Line 456: warning: cyclomatic complexity 61 of function decodeFlowSample() is high (> 15) (gocyclo)
    • Line 912: warning: cyclomatic complexity 25 of function (SFlowFlowRecordType).String() is high (> 15) (gocyclo)
    • Line 779: warning: cyclomatic complexity 23 of function decodeCounterSample() is high (> 15) (gocyclo)
    • reassembly/tcpcheck.go
    • Line 167: warning: cyclomatic complexity 35 of function (*TCPSimpleFSM).CheckState() is high (> 15) (gocyclo)
    • Line 57: warning: cyclomatic complexity 18 of function (*TCPOptionCheck).Accept() is high (> 15) (gocyclo)
    • layers/lldp.go
    • Line 801: warning: cyclomatic complexity 31 of function decodeLinkLayerDiscovery() is high (> 15) (gocyclo)
    • Line 1034: warning: cyclomatic complexity 27 of function (*LinkLayerDiscoveryInfo).DecodeMedia() is high (> 15) (gocyclo)
    • Line 1319: warning: cyclomatic complexity 27 of function (IANAAddressFamily).String() is high (> 15) (gocyclo)
    • Line 1539: warning: cyclomatic complexity 23 of function (LLDPLocationAddressType).String() is high (> 15) (gocyclo)
    • Line 907: warning: cyclomatic complexity 18 of function (*LinkLayerDiscoveryInfo).Decode8021() is high (> 15) (gocyclo)
    • layers/dns.go
    • Line 896: warning: cyclomatic complexity 25 of function (*DNSResourceRecord).decodeRData() is high (> 15) (gocyclo)
    • Line 77: warning: cyclomatic complexity 21 of function (DNSType).String() is high (> 15) (gocyclo)
    • Line 151: warning: cyclomatic complexity 20 of function (DNSResponseCode).String() is high (> 15) (gocyclo)
    • Line 538: warning: cyclomatic complexity 17 of function decodeName() is high (> 15) (gocyclo)
    • layers/gre.go
    • Line 91: warning: cyclomatic complexity 24 of function (*GRE).SerializeTo() is high (> 15) (gocyclo)
    • layers/sip.go
    • Line 76: warning: cyclomatic complexity 16 of function (SIPMethod).String() is high (> 15) (gocyclo)
    • Line 115: warning: cyclomatic complexity 16 of function GetSIPMethod() is high (> 15) (gocyclo)
    • layers/ip6.go
    • Line 139: warning: cyclomatic complexity 22 of function (*IPv6).SerializeTo() is high (> 15) (gocyclo)
    • layers/tls.go
    • Line 213: warning: cyclomatic complexity 16 of function (*TLS).SerializeTo() is high (> 15) (gocyclo)
    • layers/radiotap.go
    • Line 490: warning: cyclomatic complexity 46 of function (RadioTapVHT).String() is high (> 15) (gocyclo)
    • Line 732: warning: cyclomatic complexity 30 of function (*RadioTap).DecodeFromBytes() is high (> 15) (gocyclo)
    • Line 905: warning: cyclomatic complexity 25 of function (RadioTap).SerializeTo() is high (> 15) (gocyclo)
    • Line 333: warning: cyclomatic complexity 17 of function (RadioTapMCS).String() is high (> 15) (gocyclo)
    • layers/ospf.go
    • Line 288: warning: cyclomatic complexity 24 of function extractLSAInformation() is high (> 15) (gocyclo)
    • layers/tcp.go
    • Line 59: warning: cyclomatic complexity 17 of function (TCPOptionKind).String() is high (> 15) (gocyclo)
    • packet.go
    • Line 255: warning: cyclomatic complexity 17 of function layerString() is high (> 15) (gocyclo)
    • layers/radius.go
    • Line 194: warning: cyclomatic complexity 84 of function (RADIUSAttributeType).String() is high (> 15) (gocyclo)
    • Line 387: warning: cyclomatic complexity 16 of function (*RADIUS).DecodeFromBytes() is high (> 15) (gocyclo)
    • layers/dns_test.go
    • Line 254: warning: cyclomatic complexity 32 of function testResourceEqual() is high (> 15) (gocyclo)
    • Line 363: warning: cyclomatic complexity 23 of function testDNSEqual() is high (> 15) (gocyclo)
    • layers/ip4.go
    • Line 188: warning: cyclomatic complexity 16 of function (*IPv4).DecodeFromBytes() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell86%

Misspell Finds commonly misspelled English words

    • layers/dhcpv6_test.go
    • Line 85: warning: "expection" is a misspelling of "exception" (misspell)
    • Line 88: warning: "expection" is a misspelling of "exception" (misspell)
    • Line 91: warning: "expection" is a misspelling of "exception" (misspell)
    • layers/vxlan.go
    • Line 17: warning: "specifed" is a misspelling of "specified" (misspell)
    • Line 47: warning: "retuns" is a misspelling of "returns" (misspell)
    • doc.go
    • Line 330: warning: "accomodate" is a misspelling of "accommodate" (misspell)
    • reassembly/tcpassembly.go
    • Line 445: warning: "directionnal" is a misspelling of "directional" (misspell)
    • Line 536: warning: "seperate" is a misspelling of "separate" (misspell)
    • Line 1184: warning: "embarassing" is a misspelling of "embarrassing" (misspell)
    • macs/valid_mac_prefixes.go
    • Line 2359: warning: "Enterpirse" is a misspelling of "Enterprise" (misspell)
    • Line 2489: warning: "PROCES" is a misspelling of "PROCESS" (misspell)
    • Line 2492: warning: "Medicore" is a misspelling of "Mediocre" (misspell)
    • Line 3498: warning: "Corperation" is a misspelling of "Corporation" (misspell)
    • Line 4539: warning: "Terminales" is a misspelling of "Terminals" (misspell)
    • Line 4679: warning: "Aircaft" is a misspelling of "Aircraft" (misspell)
    • Line 4827: warning: "electronik" is a misspelling of "election" (misspell)
    • Line 5016: warning: "Engeneering" is a misspelling of "Engineering" (misspell)
    • Line 5882: warning: "Internation" is a misspelling of "International" (misspell)
    • Line 6425: warning: "Comandos" is a misspelling of "Commandos" (misspell)
    • Line 6624: warning: "Technolgy" is a misspelling of "Technology" (misspell)
    • Line 6635: warning: "Convergens" is a misspelling of "Converse" (misspell)
    • Line 7612: warning: "Electricial" is a misspelling of "Electrical" (misspell)
    • Line 8440: warning: "Electronicas" is a misspelling of "Electronics" (misspell)
    • Line 9580: warning: "Produktions" is a misspelling of "Productions" (misspell)
    • Line 9620: warning: "Definicion" is a misspelling of "Definition" (misspell)
    • Line 9926: warning: "Electornic" is a misspelling of "Electronic" (misspell)
    • Line 10304: warning: "COMPONENTES" is a misspelling of "COMPONENTS" (misspell)
    • Line 10945: warning: "Trafic" is a misspelling of "Traffic" (misspell)
    • Line 11180: warning: "ELECTRONIK" is a misspelling of "ELECTION" (misspell)
    • Line 12057: warning: "MANAGMENT" is a misspelling of "MANAGEMENT" (misspell)
    • Line 13302: warning: "ELECTRONIK" is a misspelling of "ELECTION" (misspell)
    • Line 13574: warning: "Electronik" is a misspelling of "Election" (misspell)
    • Line 13730: warning: "ELECTRONICOS" is a misspelling of "ELECTRONICS" (misspell)
    • Line 15423: warning: "Corporacion" is a misspelling of "Corporation" (misspell)
    • Line 17401: warning: "Internation" is a misspelling of "International" (misspell)
    • Line 17543: warning: "Internacional" is a misspelling of "International" (misspell)
    • Line 17596: warning: "Electon" is a misspelling of "Election" (misspell)
    • Line 17951: warning: "PROTECTRON" is a misspelling of "PROTECTION" (misspell)
    • Line 19253: warning: "Portalis" is a misspelling of "Portals" (misspell)
    • Line 19613: warning: "Instrumentos" is a misspelling of "Instruments" (misspell)
    • Line 19662: warning: "Internation" is a misspelling of "International" (misspell)
    • Line 19971: warning: "Electornics" is a misspelling of "Electronics" (misspell)
    • Line 20301: warning: "Instituto" is a misspelling of "Institution" (misspell)
    • Line 20513: warning: "Devialet" is a misspelling of "Deviate" (misspell)
    • Line 20864: warning: "Produktions" is a misspelling of "Productions" (misspell)
    • Line 21933: warning: "INDUSTRIAS" is a misspelling of "INDUSTRIES" (misspell)
    • Line 24059: warning: "ROBOTIS" is a misspelling of "ROBOTICS" (misspell)
    • layers/iana_ports.go
    • Line 1264: warning: "commonspace" is a misspelling of "commonplace" (misspell)
    • Line 2081: warning: "composit" is a misspelling of "compost" (misspell)
    • Line 2330: warning: "extensis" is a misspelling of "extensions" (misspell)
    • Line 2393: warning: "messanger" is a misspelling of "messenger" (misspell)
    • Line 5457: warning: "programmar" is a misspelling of "programmer" (misspell)
    • Line 7061: warning: "commonspace" is a misspelling of "commonplace" (misspell)
    • Line 7864: warning: "composit" is a misspelling of "compost" (misspell)
    • Line 8113: warning: "extensis" is a misspelling of "extensions" (misspell)
    • Line 8176: warning: "messanger" is a misspelling of "messenger" (misspell)
    • time.go
    • Line 65: warning: "aqcuired" is a misspelling of "acquired" (misspell)
    • Line 67: warning: "occured" is a misspelling of "occurred" (misspell)