Preparing report...

Report for github.com/ugorji/go/codec

(v1.2.7)

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


gofmt96%

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!


gocyclo67%

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.

    • decode.go
    • Line 1082: warning: cyclomatic complexity 55 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 33 of function (*Decoder).kInterfaceNaked() is high (> 15) (gocyclo)
    • Line 1716: warning: cyclomatic complexity 31 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 24 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)
    • gen.go
    • Line 1193: warning: cyclomatic complexity 49 of function (*genRunner).encStruct() is high (> 15) (gocyclo)
    • Line 893: warning: cyclomatic complexity 46 of function (*genRunner).enc() is high (> 15) (gocyclo)
    • Line 1583: warning: cyclomatic complexity 42 of function (*genRunner).dec() is high (> 15) (gocyclo)
    • Line 301: warning: cyclomatic complexity 25 of function Gen() is high (> 15) (gocyclo)
    • Line 1757: warning: cyclomatic complexity 21 of function (*genRunner).decTryAssignPrimitive() is high (> 15) (gocyclo)
    • Line 2352: warning: cyclomatic complexity 19 of function genInternalDecCommandAsString() is high (> 15) (gocyclo)
    • Line 2181: warning: cyclomatic complexity 18 of function genMethodNameT() 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)
    • encode.go
    • Line 1130: warning: cyclomatic complexity 47 of function (*Encoder).encode() is high (> 15) (gocyclo)
    • Line 726: warning: cyclomatic complexity 26 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)
    • codec_test.go
    • Line 753: warning: cyclomatic complexity 38 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 25 of function testRandomFillRV() is high (> 15) (gocyclo)
    • Line 1350: warning: cyclomatic complexity 23 of function doTestCodecChan() is high (> 15) (gocyclo)
    • Line 4019: warning: cyclomatic complexity 23 of function __doTestFloats() is high (> 15) (gocyclo)
    • Line 1830: warning: cyclomatic complexity 21 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 1479: warning: cyclomatic complexity 18 of function doTestCodecRpcOne() is high (> 15) (gocyclo)
    • Line 1149: warning: cyclomatic complexity 18 of function doTestCodecMiscOne() is high (> 15) (gocyclo)
    • Line 2357: warning: cyclomatic complexity 17 of function doTestLargeContainerLen() is high (> 15) (gocyclo)
    • binc.go
    • Line 879: warning: cyclomatic complexity 27 of function (*bincDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • Line 994: warning: cyclomatic complexity 25 of function (*bincDecDriver).nextValueBytesBdReadR() is high (> 15) (gocyclo)
    • json.go
    • Line 509: warning: cyclomatic complexity 19 of function (*jsonEncDriver).quoteStr() is high (> 15) (gocyclo)
    • Line 1217: warning: cyclomatic complexity 16 of function (*jsonDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • Line 1095: warning: cyclomatic complexity 16 of function (*jsonDecDriver).dblQuoteStringAsBytes() is high (> 15) (gocyclo)
    • mammoth_generated_test.go
    • Line 1125: warning: cyclomatic complexity 316 of function __doTestMammothMaps() is high (> 15) (gocyclo)
    • Line 274: warning: cyclomatic complexity 78 of function __doTestMammothSlices() is high (> 15) (gocyclo)
    • helper.go
    • Line 1089: warning: cyclomatic complexity 71 of function (*basicHandleRuntimeState).fnLoad() is high (> 15) (gocyclo)
    • Line 2288: warning: cyclomatic complexity 29 of function (*TypeInfos).rget() is high (> 15) (gocyclo)
    • Line 2103: warning: cyclomatic complexity 24 of function (*TypeInfos).load() is high (> 15) (gocyclo)
    • msgpack.go
    • Line 552: warning: cyclomatic complexity 37 of function (*msgpackDecDriver).nextValueBytesBdReadR() is high (> 15) (gocyclo)
    • Line 426: warning: cyclomatic complexity 34 of function (*msgpackDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • Line 730: warning: cyclomatic complexity 22 of function (*msgpackDecDriver).DecodeUint64() is high (> 15) (gocyclo)
    • Line 902: warning: cyclomatic complexity 21 of function (*msgpackDecDriver).ContainerType() is high (> 15) (gocyclo)
    • Line 825: warning: cyclomatic complexity 20 of function (*msgpackDecDriver).DecodeBytes() is high (> 15) (gocyclo)
    • Line 981: warning: cyclomatic complexity 17 of function (*msgpackDecDriver).DecodeTime() is high (> 15) (gocyclo)
    • Line 690: warning: cyclomatic complexity 16 of function (*msgpackDecDriver).DecodeInt64() is high (> 15) (gocyclo)
    • helper_unsafe.go
    • Line 400: warning: cyclomatic complexity 34 of function isEmptyValueFallbackRecur() is high (> 15) (gocyclo)
    • 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 154 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 74 of function (*TestStruc).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 2355: warning: cyclomatic complexity 66 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 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 1200: warning: cyclomatic complexity 24 of function (*testSimpleFields).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 13230: warning: cyclomatic complexity 24 of function (codecSelfer19780).decwrapUint64Slice() is high (> 15) (gocyclo)
    • Line 13630: warning: cyclomatic complexity 24 of function (codecSelfer19780).decSlicestringUint64T() is high (> 15) (gocyclo)
    • Line 7339: warning: cyclomatic complexity 23 of function (*Sstructbig).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 8236: warning: cyclomatic complexity 23 of function (*AnonInTestStrucIntf).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 7666: warning: cyclomatic complexity 23 of function (*SstructbigToArray).codecDecodeSelfFromArray() is high (> 15) (gocyclo)
    • Line 619: warning: cyclomatic complexity 22 of function (*AnonInTestStruc).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 7129: warning: cyclomatic complexity 20 of function (*Sstructbig).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 7456: warning: cyclomatic complexity 20 of function (*SstructbigToArray).CodecEncodeSelf() is high (> 15) (gocyclo)
    • Line 7274: warning: cyclomatic complexity 19 of function (*Sstructbig).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 7601: warning: cyclomatic complexity 19 of function (*SstructbigToArray).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 904: warning: cyclomatic complexity 18 of function (*AnonInTestStruc).IsCodecEmpty() is high (> 15) (gocyclo)
    • Line 1501: warning: cyclomatic complexity 18 of function (*testSimpleFields).IsCodecEmpty() is high (> 15) (gocyclo)
    • Line 15493: warning: cyclomatic complexity 17 of function (codecSelfer19780).decMapstringUint64TPtrtostringUint64T() is high (> 15) (gocyclo)
    • Line 15664: warning: cyclomatic complexity 16 of function (codecSelfer19780).decMapstringPtrtoTestStrucFlex() is high (> 15) (gocyclo)
    • Line 13739: warning: cyclomatic complexity 16 of function (codecSelfer19780).decMapstringPtrtostringUint64T() is high (> 15) (gocyclo)
    • Line 13827: warning: cyclomatic complexity 16 of function (codecSelfer19780).decMapstringPtrtoTestStruc() is high (> 15) (gocyclo)
    • cbor.go
    • Line 802: warning: cyclomatic complexity 23 of function (*cborDecDriver).nextValueBytesBdReadR() is high (> 15) (gocyclo)
    • Line 686: warning: cyclomatic complexity 20 of function (*cborDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • Line 570: warning: cyclomatic complexity 16 of function (*cborDecDriver).DecodeBytes() is high (> 15) (gocyclo)
    • 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 370 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 25 of function (*TestMammoth2Wrapper).codecDecodeSelfFromMap() is high (> 15) (gocyclo)
    • Line 7484: warning: cyclomatic complexity 24 of function (codecSelfer19781).decSliceTestMammoth2() is high (> 15) (gocyclo)
    • decimal.go
    • Line 372: warning: cyclomatic complexity 33 of function readFloat() is high (> 15) (gocyclo)
    • simple.go
    • Line 620: warning: cyclomatic complexity 28 of function (*simpleDecDriver).nextValueBytesBdReadR() is high (> 15) (gocyclo)
    • Line 529: warning: cyclomatic complexity 18 of function (*simpleDecDriver).DecodeNaked() is high (> 15) (gocyclo)
    • cbor_test.go
    • Line 105: warning: cyclomatic complexity 17 of function TestCborGoldens() 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

    • json.go
    • Line 97: warning: "alse" is a misspelling of "else" (misspell)
    • Line 284: warning: "writen" is a misspelling of "written" (misspell)
    • writer.go
    • Line 41: warning: "accomodate" is a misspelling of "accommodate" (misspell)
    • Line 41: warning: "writen" is a misspelling of "written" (misspell)
    • xml.go
    • Line 317: warning: "PREFERED" is a misspelling of "PREFERRED" (misspell)
    • Line 326: warning: "PREFERED" is a misspelling of "PREFERRED" (misspell)
    • gen.go
    • Line 2781: warning: "hierachy" is a misspelling of "hierarchy" (misspell)
    • helper.go
    • Line 1098: warning: "implementes" is a misspelling of "implements" (misspell)
    • Line 1702: warning: "hierachy" is a misspelling of "hierarchy" (misspell)