Preparing report...

Report for github.com/zmap/zcrypto

(v0.0.0-20250324021606-4f0ea0eaccac)

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


gofmt99%

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


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo75%

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.

    • tls/conn.go
    • Line 596: warning: cyclomatic complexity 53 of function (*Conn).readRecordOrCCS() is high (> 15) (gocyclo)
    • Line 1010: warning: cyclomatic complexity 25 of function (*Conn).readHandshake() is high (> 15) (gocyclo)
    • Line 328: warning: cyclomatic complexity 23 of function (*halfConn).decrypt() is high (> 15) (gocyclo)
    • tls/handshake_client.go
    • Line 327: warning: cyclomatic complexity 47 of function (*Conn).clientHandshake() is high (> 15) (gocyclo)
    • Line 758: warning: cyclomatic complexity 34 of function (*clientHandshakeState).doFullHandshake() is high (> 15) (gocyclo)
    • Line 225: warning: cyclomatic complexity 22 of function (*Conn).makeClientHello() is high (> 15) (gocyclo)
    • Line 533: warning: cyclomatic complexity 22 of function (*Conn).loadSession() is high (> 15) (gocyclo)
    • Line 127: warning: cyclomatic complexity 21 of function (*ClientFingerprintConfiguration).marshal() is high (> 15) (gocyclo)
    • Line 671: warning: cyclomatic complexity 19 of function (*clientHandshakeState).handshake() is high (> 15) (gocyclo)
    • Line 981: warning: cyclomatic complexity 17 of function (*clientHandshakeState).processServerHello() is high (> 15) (gocyclo)
    • x509/crl_parser.go
    • Line 59: warning: cyclomatic complexity 42 of function ParseRevocationList() is high (> 15) (gocyclo)
    • Line 266: warning: cyclomatic complexity 20 of function parseASN1String() is high (> 15) (gocyclo)
    • Line 241: warning: cyclomatic complexity 16 of function isPrintable() is high (> 15) (gocyclo)
    • tls/handshake_server.go
    • Line 476: warning: cyclomatic complexity 37 of function (*serverHandshakeState).doFullHandshake() is high (> 15) (gocyclo)
    • Line 174: warning: cyclomatic complexity 24 of function (*serverHandshakeState).processClientHello() is high (> 15) (gocyclo)
    • Line 63: warning: cyclomatic complexity 16 of function (*serverHandshakeState).handshake() is high (> 15) (gocyclo)
    • x509/extensions_test.go
    • Line 195: warning: cyclomatic complexity 32 of function TestNameConstraintJSON() is high (> 15) (gocyclo)
    • Line 33: warning: cyclomatic complexity 20 of function TestGeneralNamesJSON() is high (> 15) (gocyclo)
    • ct/x509/x509.go
    • Line 856: warning: cyclomatic complexity 64 of function parseCertificate() is high (> 15) (gocyclo)
    • Line 1269: warning: cyclomatic complexity 47 of function buildExtensions() is high (> 15) (gocyclo)
    • Line 641: warning: cyclomatic complexity 17 of function (*Certificate).CheckSignature() is high (> 15) (gocyclo)
    • Line 1474: warning: cyclomatic complexity 17 of function CreateCertificate() is high (> 15) (gocyclo)
    • Line 752: warning: cyclomatic complexity 16 of function parsePublicKey() is high (> 15) (gocyclo)
    • x509/extensions.go
    • Line 250: warning: cyclomatic complexity 20 of function (*NameConstraints).UnmarshalJSON() is high (> 15) (gocyclo)
    • Line 731: warning: cyclomatic complexity 20 of function (*Certificate).JsonifyExtensions() is high (> 15) (gocyclo)
    • x509/x509.go
    • Line 1578: warning: cyclomatic complexity 151 of function parseCertificate() is high (> 15) (gocyclo)
    • Line 2348: warning: cyclomatic complexity 62 of function buildExtensions() is high (> 15) (gocyclo)
    • Line 1057: warning: cyclomatic complexity 31 of function CheckSignatureFromKey() is high (> 15) (gocyclo)
    • Line 3342: warning: cyclomatic complexity 27 of function CreateRevocationList() is high (> 15) (gocyclo)
    • Line 1300: warning: cyclomatic complexity 25 of function parsePublicKey() is high (> 15) (gocyclo)
    • Line 1469: warning: cyclomatic complexity 25 of function parseGeneralNames() is high (> 15) (gocyclo)
    • Line 2974: warning: cyclomatic complexity 25 of function CreateCertificateRequest() is high (> 15) (gocyclo)
    • Line 3274: warning: cyclomatic complexity 21 of function getSignatureAlgorithmFromAI() is high (> 15) (gocyclo)
    • Line 444: warning: cyclomatic complexity 17 of function GetSignatureAlgorithmFromAI() is high (> 15) (gocyclo)
    • Line 2572: warning: cyclomatic complexity 16 of function signingParamsForPublicKey() is high (> 15) (gocyclo)
    • tls/common.go
    • Line 1348: warning: cyclomatic complexity 37 of function (*ClientHelloInfo).SupportsCertificate() is high (> 15) (gocyclo)
    • x509/pkix/pkix.go
    • Line 90: warning: cyclomatic complexity 26 of function (*Name).FillFromRDNSequence() is high (> 15) (gocyclo)
    • ct/asn1/common.go
    • Line 87: warning: cyclomatic complexity 16 of function parseFieldParameters() is high (> 15) (gocyclo)
    • encoding/asn1/asn1.go
    • Line 697: warning: cyclomatic complexity 97 of function parseField() is high (> 15) (gocyclo)
    • Line 445: warning: cyclomatic complexity 18 of function isPrintable() is high (> 15) (gocyclo)
    • tls/handshake_server_tls13.go
    • Line 473: warning: cyclomatic complexity 32 of function illegalClientHelloChange() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 29 of function (*serverHandshakeStateTLS13).processClientHello() is high (> 15) (gocyclo)
    • Line 239: warning: cyclomatic complexity 21 of function (*serverHandshakeStateTLS13).checkForResumption() is high (> 15) (gocyclo)
    • Line 765: warning: cyclomatic complexity 18 of function (*serverHandshakeStateTLS13).readClientCertificate() is high (> 15) (gocyclo)
    • ct/x509/verify.go
    • Line 148: warning: cyclomatic complexity 18 of function (*Certificate).isValid() is high (> 15) (gocyclo)
    • encoding/asn1/marshal.go
    • Line 579: warning: cyclomatic complexity 40 of function makeField() is high (> 15) (gocyclo)
    • Line 461: warning: cyclomatic complexity 32 of function makeBody() is high (> 15) (gocyclo)
    • tls/handshake_client_test.go
    • Line 279: warning: cyclomatic complexity 41 of function (*clientTest).run() is high (> 15) (gocyclo)
    • Line 1483: warning: cyclomatic complexity 37 of function testVerifyConnection() is high (> 15) (gocyclo)
    • Line 1714: warning: cyclomatic complexity 29 of function testVerifyPeerCertificate() is high (> 15) (gocyclo)
    • Line 881: warning: cyclomatic complexity 23 of function testResumption() is high (> 15) (gocyclo)
    • Line 1062: warning: cyclomatic complexity 18 of function TestLRUClientSessionCache() is high (> 15) (gocyclo)
    • tls/tls_test.go
    • Line 1074: warning: cyclomatic complexity 35 of function TestConnectionState() is high (> 15) (gocyclo)
    • Line 782: warning: cyclomatic complexity 29 of function TestCloneNonFuncFields() is high (> 15) (gocyclo)
    • Line 1380: warning: cyclomatic complexity 26 of function TestCipherSuites() is high (> 15) (gocyclo)
    • Line 578: warning: cyclomatic complexity 18 of function TestConnCloseWrite() is high (> 15) (gocyclo)
    • Line 206: warning: cyclomatic complexity 16 of function TestDeadlineOnWrite() is high (> 15) (gocyclo)
    • x509/x509_test.go
    • Line 266: warning: cyclomatic complexity 31 of function TestCreateSelfSignedCertificate() is high (> 15) (gocyclo)
    • Line 1221: warning: cyclomatic complexity 17 of function TestParseGeneralNamesOtherName() is high (> 15) (gocyclo)
    • tls/key_agreement.go
    • Line 112: warning: cyclomatic complexity 22 of function (*signedKeyAgreement).verifyParameters() is high (> 15) (gocyclo)
    • Line 505: warning: cyclomatic complexity 20 of function (*ecdheKeyAgreement).processServerKeyExchange() is high (> 15) (gocyclo)
    • Line 388: warning: cyclomatic complexity 18 of function (*ecdheKeyAgreement).generateServerKeyExchange() is high (> 15) (gocyclo)
    • x509/verify.go
    • Line 283: warning: cyclomatic complexity 22 of function (*Certificate).Verify() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 17 of function (*Certificate).buildChains() is high (> 15) (gocyclo)
    • x509/extended_key_usage.go
    • Line 418: warning: cyclomatic complexity 65 of function (*auxExtendedKeyUsage).populateFromExtKeyUsage() is high (> 15) (gocyclo)
    • Line 282: warning: cyclomatic complexity 65 of function (*auxExtendedKeyUsage).populateFromASN1() is high (> 15) (gocyclo)
    • tls/conn_test.go
    • Line 128: warning: cyclomatic complexity 19 of function runDynamicRecordSizingTest() is high (> 15) (gocyclo)
    • tls/tls.go
    • Line 277: warning: cyclomatic complexity 31 of function X509KeyPair() is high (> 15) (gocyclo)
    • Line 119: warning: cyclomatic complexity 17 of function dial() is high (> 15) (gocyclo)
    • ct/asn1/marshal.go
    • Line 470: warning: cyclomatic complexity 29 of function marshalField() is high (> 15) (gocyclo)
    • Line 380: warning: cyclomatic complexity 23 of function marshalBody() is high (> 15) (gocyclo)
    • Line 300: warning: cyclomatic complexity 17 of function marshalUTCTime() is high (> 15) (gocyclo)
    • tls/handshake_client_tls13.go
    • Line 173: warning: cyclomatic complexity 20 of function (*clientHandshakeStateTLS13).processHelloRetryRequest() is high (> 15) (gocyclo)
    • Line 410: warning: cyclomatic complexity 17 of function (*clientHandshakeStateTLS13).readServerCertificate() is high (> 15) (gocyclo)
    • Line 39: warning: cyclomatic complexity 17 of function (*clientHandshakeStateTLS13).handshake() is high (> 15) (gocyclo)
    • tls/handshake_messages.go
    • Line 367: warning: cyclomatic complexity 93 of function (*clientHelloMsg).unmarshal() is high (> 15) (gocyclo)
    • Line 773: warning: cyclomatic complexity 46 of function (*serverHelloMsg).unmarshal() is high (> 15) (gocyclo)
    • Line 103: warning: cyclomatic complexity 30 of function (*clientHelloMsg).marshal() is high (> 15) (gocyclo)
    • Line 1211: warning: cyclomatic complexity 28 of function (*certificateRequestMsgTLS13).unmarshal() is high (> 15) (gocyclo)
    • Line 1450: warning: cyclomatic complexity 21 of function unmarshalCertificate() is high (> 15) (gocyclo)
    • Line 648: warning: cyclomatic complexity 18 of function (*serverHelloMsg).marshal() is high (> 15) (gocyclo)
    • Line 1718: warning: cyclomatic complexity 16 of function (*certificateRequestMsg).unmarshal() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell98%

Misspell Finds commonly misspelled English words

    • x509/json.go
    • Line 151: warning: "PREFERED" is a misspelling of "PREFERRED" (misspell)
    • Line 506: warning: "implimented" is a misspelling of "implemented" (misspell)
    • Line 515: warning: "implimented" is a misspelling of "implemented" (misspell)