Preparing report...

Report for github.com/ugorji/go

A+    Excellent!    Found 24 issues across 70 files

Tweet

gofmt94%

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!


golint92%

Golint is a linter for Go source code.

    • go/doc.go
    • Line 6: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • go/codec/codec_test.go
    • Line 128: warning: error var testErrWriterErr should have name of the form errFoo (golint)
    • Line 1813: warning: don't use underscores in Go names; func __doTestErrWriter should be _DoTestErrWriter (golint)
    • Line 1830: warning: don't use underscores in Go names; func __doTestJsonLargeInteger should be _DoTestJSONLargeInteger (golint)
    • Line 2279: warning: don't use underscores in Go names; func __doTestDecodeNilMapEntryValue should be _DoTestDecodeNilMapEntryValue (golint)
    • Line 3725: warning: don't use underscores in Go names; func __doTestBufioDecReader should be _DoTestBufioDecReader (golint)
    • Line 3926: warning: don't use underscores in Go names; func __doTestIntegers should be _DoTestIntegers (golint)
    • Line 4019: warning: don't use underscores in Go names; func __doTestFloats should be _DoTestFloats (golint)
    • Line 4064: warning: don't use underscores in Go names; func __doTestIntegerFloatConversions should be _DoTestIntegerFloatConversions (golint)
    • Line 4427: warning: don't use underscores in Go names; var parseInt64_reader should be parseInt64Reader (golint)
    • go/codec/decimal.go
    • Line 29: warning: don't use underscores in Go names; func parseFloat32_strconv should be parseFloat32Strconv (golint)
    • Line 35: warning: don't use underscores in Go names; func parseFloat64_strconv should be parseFloat64Strconv (golint)
    • Line 154: warning: don't use underscores in Go names; func parseFloat32_reader should be parseFloat32Reader (golint)
    • Line 177: warning: don't use underscores in Go names; func parseFloat32_custom should be parseFloat32Custom (golint)
    • Line 191: warning: don't use underscores in Go names; func parseFloat64_reader should be parseFloat64Reader (golint)
    • Line 214: warning: don't use underscores in Go names; func parseFloat64_custom should be parseFloat64Custom (golint)
    • Line 228: warning: don't use underscores in Go names; func parseUint64_simple should be parseUint64Simple (golint)
    • Line 256: warning: don't use underscores in Go names; func parseUint64_reader should be parseUint64Reader (golint)
    • Line 271: warning: don't use underscores in Go names; func parseInteger_bytes should be parseIntegerBytes (golint)
    • go/codec/helper_unsafe.go
    • Line 1218: warning: don't use underscores in Go names; func len_map_chan should be lenMapChan (golint)
    • Line 1225: warning: don't use underscores in Go names; func len_map should be lenMap (golint)
    • Line 1229: warning: don't use underscores in Go names; func len_chan should be lenChan (golint)
    • go/codec/helper_unsafe_compiler_gc.go
    • Line 143: warning: don't use underscores in Go names; func mapassign_fast32 should be mapassignFast32 (golint)
    • Line 147: warning: don't use underscores in Go names; func mapassign_fast32ptr should be mapassignFast32ptr (golint)
    • Line 151: warning: don't use underscores in Go names; func mapassign_fast64 should be mapassignFast64 (golint)
    • Line 155: warning: don't use underscores in Go names; func mapassign_fast64ptr should be mapassignFast64ptr (golint)
    • Line 159: warning: don't use underscores in Go names; func mapassign_faststr should be mapassignFaststr (golint)
    • Line 163: warning: don't use underscores in Go names; func mapaccess2_fast32 should be mapaccess2Fast32 (golint)
    • Line 167: warning: don't use underscores in Go names; func mapaccess2_fast64 should be mapaccess2Fast64 (golint)
    • Line 171: warning: don't use underscores in Go names; func mapaccess2_faststr should be mapaccess2Faststr (golint)

gocyclo74%

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.

    • go/codec/mammoth2_codecgen_generated_test.go
    • Line 49: warning: cyclomatic complexity 525 of function (*TestMammoth2).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 4320: warning: cyclomatic complexity 515 of function (*TestMammoth2).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 3346: warning: cyclomatic complexity 371 of function (*TestMammoth2).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 6751: warning: cyclomatic complexity 74 of function (*TestMammoth2).IsCodecEmpty() is high (> 15) (gocyclo)
    • Line 6844: warning: cyclomatic complexity 37 of function (*TestMammoth2Wrapper).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 7181: warning: cyclomatic complexity 36 of function (*TestMammoth2Wrapper).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 7103: warning: cyclomatic complexity 26 of function (*TestMammoth2Wrapper).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 7484: warning: cyclomatic complexity 24 of function (codecSelfer19781).decSliceTestMammoth2() is high (> 15) (gocyclo)
    • go/codec/decode.go
    • Line 1082: warning: cyclomatic complexity 56 of function (*Decoder).kMap() is high (> 15) (gocyclo)
    • Line 754: warning: cyclomatic complexity 46 of function (*Decoder).kSlice() is high (> 15) (gocyclo)
    • Line 468: warning: cyclomatic complexity 34 of function (*Decoder).kInterfaceNaked() is high (> 15) (gocyclo)
    • Line 1716: warning: cyclomatic complexity 32 of function (*Decoder).decode() is high (> 15) (gocyclo)
    • Line 986: warning: cyclomatic complexity 25 of function (*Decoder).kChan() is high (> 15) (gocyclo)
    • Line 1620: warning: cyclomatic complexity 25 of function setZero() is high (> 15) (gocyclo)
    • Line 663: warning: cyclomatic complexity 22 of function (*Decoder).kStruct() is high (> 15) (gocyclo)
    • Line 922: warning: cyclomatic complexity 16 of function (*Decoder).kArray() is high (> 15) (gocyclo)
    • go/codec/binc.go
    • Line 876: warning: cyclomatic complexity 29 of function (*bincDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • Line 991: warning: cyclomatic complexity 29 of function (*bincDecDriver).nextValueBytesBdReadR() is high (> 15) (gocyclo)
    • go/codec/helper.go
    • Line 1084: warning: cyclomatic complexity 72 of function (*basicHandleRuntimeState).fnLoad() is high (> 15) (gocyclo)
    • Line 2279: warning: cyclomatic complexity 29 of function (*TypeInfos).rget() is high (> 15) (gocyclo)
    • Line 2094: warning: cyclomatic complexity 24 of function (*TypeInfos).load() is high (> 15) (gocyclo)
    • go/codec/json.go
    • Line 509: warning: cyclomatic complexity 20 of function (*jsonEncDriver).quoteStr() is high (> 15) (gocyclo)
    • Line 1217: warning: cyclomatic complexity 17 of function (*jsonDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • Line 1095: warning: cyclomatic complexity 17 of function (*jsonDecDriver).dblQuoteStringAsBytes() is high (> 15) (gocyclo)
    • go/codec/simple.go
    • Line 617: warning: cyclomatic complexity 29 of function (*simpleDecDriver).nextValueBytesBdReadR() is high (> 15) (gocyclo)
    • Line 526: warning: cyclomatic complexity 19 of function (*simpleDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • go/codec/cbor.go
    • Line 799: warning: cyclomatic complexity 25 of function (*cborDecDriver).nextValueBytesBdReadR() is high (> 15) (gocyclo)
    • Line 683: warning: cyclomatic complexity 22 of function (*cborDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • go/codec/values_codecgen_generated_test.go
    • Line 9257: warning: cyclomatic complexity 466 of function (*TestStrucFlex).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 11913: warning: cyclomatic complexity 246 of function (*TestStrucFlex).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 11547: warning: cyclomatic complexity 155 of function (*TestStrucFlex).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 3213: warning: cyclomatic complexity 135 of function (*TestStruc).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 4323: warning: cyclomatic complexity 131 of function (*TestStruc).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 1506: warning: cyclomatic complexity 121 of function (*TestStrucCommon).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 2513: warning: cyclomatic complexity 119 of function (*TestStrucCommon).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 4144: warning: cyclomatic complexity 75 of function (*TestStruc).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 2355: warning: cyclomatic complexity 67 of function (*TestStrucCommon).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 308: warning: cyclomatic complexity 44 of function (*AnonInTestStruc).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 909: warning: cyclomatic complexity 40 of function (*testSimpleFields).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 1267: warning: cyclomatic complexity 40 of function (*testSimpleFields).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 3208: warning: cyclomatic complexity 38 of function (*TestStrucCommon).IsCodecEmpty() is high (> 15) (gocyclo)
    • Line 678: warning: cyclomatic complexity 38 of function (*AnonInTestStruc).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 8069: warning: cyclomatic complexity 36 of function (*AnonInTestStrucIntf).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 13206: warning: cyclomatic complexity 35 of function (*TestStrucFlex).IsCodecEmpty() is high (> 15) (gocyclo)
    • Line 8300: warning: cyclomatic complexity 27 of function (*AnonInTestStrucIntf).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 15822: warning: cyclomatic complexity 26 of function (codecSelfer19780).decSlicePtrtoTestStrucFlex() is high (> 15) (gocyclo)
    • Line 13985: warning: cyclomatic complexity 26 of function (codecSelfer19780).decSlicePtrtoTestStruc() is high (> 15) (gocyclo)
    • Line 13525: warning: cyclomatic complexity 25 of function (codecSelfer19780).decSlicePtrtoint64() is high (> 15) (gocyclo)
    • Line 1200: warning: cyclomatic complexity 25 of function (*testSimpleFields).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 15376: warning: cyclomatic complexity 25 of function (codecSelfer19780).decSlicePtrtoArray4uint64() is high (> 15) (gocyclo)
    • Line 15174: warning: cyclomatic complexity 24 of function (codecSelfer19780).decSlicewrapUint8() is high (> 15) (gocyclo)
    • Line 8236: warning: cyclomatic complexity 24 of function (*AnonInTestStrucIntf).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 15073: warning: cyclomatic complexity 24 of function (codecSelfer19780).decSlicewrapBytes() is high (> 15) (gocyclo)
    • Line 13331: warning: cyclomatic complexity 24 of function (codecSelfer19780).decwrapStringSlice() is high (> 15) (gocyclo)
    • Line 13630: warning: cyclomatic complexity 24 of function (codecSelfer19780).decSlicestringUint64T() is high (> 15) (gocyclo)
    • Line 13230: warning: cyclomatic complexity 24 of function (codecSelfer19780).decwrapUint64Slice() is high (> 15) (gocyclo)
    • Line 7339: warning: cyclomatic complexity 23 of function (*Sstructbig).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 619: warning: cyclomatic complexity 23 of function (*AnonInTestStruc).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 7666: warning: cyclomatic complexity 23 of function (*SstructbigToArray).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 7601: warning: cyclomatic complexity 20 of function (*SstructbigToArray).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 7456: warning: cyclomatic complexity 20 of function (*SstructbigToArray).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 7129: warning: cyclomatic complexity 20 of function (*Sstructbig).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 7274: warning: cyclomatic complexity 20 of function (*Sstructbig).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 1501: warning: cyclomatic complexity 18 of function (*testSimpleFields).IsCodecEmpty() is high (> 15) (gocyclo)
    • Line 904: warning: cyclomatic complexity 18 of function (*AnonInTestStruc).IsCodecEmpty() is high (> 15) (gocyclo)
    • Line 15493: warning: cyclomatic complexity 17 of function (codecSelfer19780).decMapstringUint64TPtrtostringUint64T() is high (> 15) (gocyclo)
    • Line 13739: warning: cyclomatic complexity 16 of function (codecSelfer19780).decMapstringPtrtostringUint64T() is high (> 15) (gocyclo)
    • Line 15664: warning: cyclomatic complexity 16 of function (codecSelfer19780).decMapstringPtrtoTestStrucFlex() is high (> 15) (gocyclo)
    • Line 13827: warning: cyclomatic complexity 16 of function (codecSelfer19780).decMapstringPtrtoTestStruc() is high (> 15) (gocyclo)
    • go/codec/gen.go
    • Line 1193: warning: cyclomatic complexity 50 of function (*genRunner).encStruct() is high (> 15) (gocyclo)
    • Line 893: warning: cyclomatic complexity 47 of function (*genRunner).enc() is high (> 15) (gocyclo)
    • Line 1583: warning: cyclomatic complexity 43 of function (*genRunner).dec() is high (> 15) (gocyclo)
    • Line 301: warning: cyclomatic complexity 27 of function Gen() is high (> 15) (gocyclo)
    • Line 1757: warning: cyclomatic complexity 22 of function (*genRunner).decTryAssignPrimitive() is high (> 15) (gocyclo)
    • Line 2181: warning: cyclomatic complexity 20 of function genMethodNameT() is high (> 15) (gocyclo)
    • Line 2352: warning: cyclomatic complexity 20 of function genInternalDecCommandAsString() is high (> 15) (gocyclo)
    • Line 520: warning: cyclomatic complexity 17 of function (*genRunner).genRefPkgs() is high (> 15) (gocyclo)
    • Line 1462: warning: cyclomatic complexity 16 of function (*genRunner).decVarInitPtr() is high (> 15) (gocyclo)
    • go/codec/msgpack.go
    • Line 552: warning: cyclomatic complexity 39 of function (*msgpackDecDriver).nextValueBytesBdReadR() is high (> 15) (gocyclo)
    • Line 426: warning: cyclomatic complexity 36 of function (*msgpackDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • Line 730: warning: cyclomatic complexity 24 of function (*msgpackDecDriver).DecodeUint64() is high (> 15) (gocyclo)
    • Line 899: warning: cyclomatic complexity 21 of function (*msgpackDecDriver).ContainerType() is high (> 15) (gocyclo)
    • Line 825: warning: cyclomatic complexity 19 of function (*msgpackDecDriver).DecodeBytes() is high (> 15) (gocyclo)
    • Line 690: warning: cyclomatic complexity 18 of function (*msgpackDecDriver).DecodeInt64() is high (> 15) (gocyclo)
    • Line 978: warning: cyclomatic complexity 17 of function (*msgpackDecDriver).DecodeTime() is high (> 15) (gocyclo)
    • go/codec/encode.go
    • Line 1130: warning: cyclomatic complexity 48 of function (*Encoder).encode() is high (> 15) (gocyclo)
    • Line 726: warning: cyclomatic complexity 27 of function (*Encoder).kMapCanonical() is high (> 15) (gocyclo)
    • Line 532: warning: cyclomatic complexity 26 of function (*Encoder).kStruct() is high (> 15) (gocyclo)
    • Line 1247: warning: cyclomatic complexity 17 of function (*Encoder).encodeValue() is high (> 15) (gocyclo)
    • go/codec/codec_test.go
    • Line 753: warning: cyclomatic complexity 40 of function testVerifyVal() is high (> 15) (gocyclo)
    • Line 4425: warning: cyclomatic complexity 30 of function doTestJsonNumberParsing() is high (> 15) (gocyclo)
    • Line 962: warning: cyclomatic complexity 28 of function testCodecTableOne() is high (> 15) (gocyclo)
    • Line 2533: warning: cyclomatic complexity 26 of function testRandomFillRV() is high (> 15) (gocyclo)
    • Line 4019: warning: cyclomatic complexity 23 of function __doTestFloats() is high (> 15) (gocyclo)
    • Line 1350: warning: cyclomatic complexity 23 of function doTestCodecChan() is high (> 15) (gocyclo)
    • Line 1830: warning: cyclomatic complexity 22 of function __doTestJsonLargeInteger() is high (> 15) (gocyclo)
    • Line 4233: warning: cyclomatic complexity 20 of function doTestJsonLargeInteger() is high (> 15) (gocyclo)
    • Line 1951: warning: cyclomatic complexity 19 of function doTestPythonGenStreams() is high (> 15) (gocyclo)
    • Line 1149: warning: cyclomatic complexity 18 of function doTestCodecMiscOne() is high (> 15) (gocyclo)
    • Line 1479: warning: cyclomatic complexity 18 of function doTestCodecRpcOne() is high (> 15) (gocyclo)
    • Line 2357: warning: cyclomatic complexity 17 of function doTestLargeContainerLen() is high (> 15) (gocyclo)
    • Line 688: warning: cyclomatic complexity 17 of function testTableVerify() is high (> 15) (gocyclo)

ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell90%

Misspell Finds commonly misspelled English words

    • go/codec/xml.go
    • Line 317: warning: "PREFERED" is a misspelling of "PREFERRED" (misspell)
    • Line 326: warning: "PREFERED" is a misspelling of "PREFERRED" (misspell)
    • go/codec/writer.go
    • Line 41: warning: "accomodate" is a misspelling of "accommodate" (misspell)
    • Line 41: warning: "writen" is a misspelling of "written" (misspell)