Preparing report...

Report for github.com/ohler55/ojg

(v1.22.0)

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


gofmt100%

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

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo85%

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.

    • alt/bool.go
    • Line 18: warning: cyclomatic complexity 16 of function Bool() is high (> 15) (gocyclo)
    • jp/set.go
    • Line 71: warning: cyclomatic complexity 339 of function (Expr).set() is high (> 15) (gocyclo)
    • sen/parser.go
    • Line 253: warning: cyclomatic complexity 137 of function (*Parser).parseBuffer() is high (> 15) (gocyclo)
    • Line 165: warning: cyclomatic complexity 20 of function (*Parser).ParseReader() is high (> 15) (gocyclo)
    • oj/parser.go
    • Line 220: warning: cyclomatic complexity 112 of function (*Parser).parseBuffer() is high (> 15) (gocyclo)
    • Line 132: warning: cyclomatic complexity 20 of function (*Parser).ParseReader() is high (> 15) (gocyclo)
    • alt/diff.go
    • Line 128: warning: cyclomatic complexity 56 of function diff() is high (> 15) (gocyclo)
    • Line 59: warning: cyclomatic complexity 32 of function Match() is high (> 15) (gocyclo)
    • Line 275: warning: cyclomatic complexity 18 of function asInt() is high (> 15) (gocyclo)
    • oj/writer.go
    • Line 167: warning: cyclomatic complexity 37 of function (*Writer).appendJSON() is high (> 15) (gocyclo)
    • Line 479: warning: cyclomatic complexity 32 of function (*Writer).appendStruct() is high (> 15) (gocyclo)
    • Line 672: warning: cyclomatic complexity 24 of function (*Writer).appendMap() is high (> 15) (gocyclo)
    • Line 410: warning: cyclomatic complexity 20 of function appendSortObject() is high (> 15) (gocyclo)
    • Line 347: warning: cyclomatic complexity 19 of function appendObject() is high (> 15) (gocyclo)
    • asm/sum.go
    • Line 34: warning: cyclomatic complexity 19 of function sum() is high (> 15) (gocyclo)
    • converter.go
    • Line 117: warning: cyclomatic complexity 30 of function (*Converter).convert() is high (> 15) (gocyclo)
    • alt/float.go
    • Line 19: warning: cyclomatic complexity 24 of function Float() is high (> 15) (gocyclo)
    • gen/parser.go
    • Line 190: warning: cyclomatic complexity 111 of function (*Parser).parseBuffer() is high (> 15) (gocyclo)
    • Line 105: warning: cyclomatic complexity 19 of function (*Parser).ParseReader() is high (> 15) (gocyclo)
    • oj/tokenizer.go
    • Line 142: warning: cyclomatic complexity 100 of function (*Tokenizer).tokenizeBuffer() is high (> 15) (gocyclo)
    • sen/tokenizer.go
    • Line 154: warning: cyclomatic complexity 98 of function (*Tokenizer).tokenizeBuffer() is high (> 15) (gocyclo)
    • tt/equal.go
    • Line 40: warning: cyclomatic complexity 66 of function valuesEqual() is high (> 15) (gocyclo)
    • alt/decompose.go
    • Line 82: warning: cyclomatic complexity 39 of function alter() is high (> 15) (gocyclo)
    • Line 19: warning: cyclomatic complexity 22 of function decompose() is high (> 15) (gocyclo)
    • Line 314: warning: cyclomatic complexity 19 of function condMapSet() is high (> 15) (gocyclo)
    • sen/finfo.go
    • Line 132: warning: cyclomatic complexity 32 of function newFinfo() is high (> 15) (gocyclo)
    • alt/filter.go
    • Line 63: warning: cyclomatic complexity 20 of function match() is high (> 15) (gocyclo)
    • sen/sinfo.go
    • Line 87: warning: cyclomatic complexity 17 of function buildTagFields() is high (> 15) (gocyclo)
    • jp/string.go
    • Line 25: warning: cyclomatic complexity 16 of function AppendString() is high (> 15) (gocyclo)
    • oj/finfo.go
    • Line 132: warning: cyclomatic complexity 35 of function newFinfo() is high (> 15) (gocyclo)
    • alt/generifier.go
    • Line 109: warning: cyclomatic complexity 32 of function GenAlter() is high (> 15) (gocyclo)
    • Line 26: warning: cyclomatic complexity 32 of function Generify() is high (> 15) (gocyclo)
    • alt/finfo.go
    • Line 96: warning: cyclomatic complexity 27 of function newFinfo() is high (> 15) (gocyclo)
    • alt/int.go
    • Line 19: warning: cyclomatic complexity 37 of function Int() is high (> 15) (gocyclo)
    • jp/union.go
    • Line 73: warning: cyclomatic complexity 32 of function (Union).removeOne() is high (> 15) (gocyclo)
    • Line 178: warning: cyclomatic complexity 24 of function (Union).remove() is high (> 15) (gocyclo)
    • Line 263: warning: cyclomatic complexity 23 of function (Union).locate() is high (> 15) (gocyclo)
    • jp/modify.go
    • Line 73: warning: cyclomatic complexity 297 of function (Expr).modify() is high (> 15) (gocyclo)
    • jp/get.go
    • Line 37: warning: cyclomatic complexity 261 of function (Expr).Get() is high (> 15) (gocyclo)
    • Line 863: warning: cyclomatic complexity 258 of function (Expr).FirstFound() is high (> 15) (gocyclo)
    • Line 1674: warning: cyclomatic complexity 20 of function reflectGetStructFieldByNameOrJsonTag() is high (> 15) (gocyclo)
    • jp/script.go
    • Line 443: warning: cyclomatic complexity 128 of function evalStack() is high (> 15) (gocyclo)
    • Line 182: warning: cyclomatic complexity 60 of function (*Script).evalWithRoot() is high (> 15) (gocyclo)
    • oj/validator.go
    • Line 110: warning: cyclomatic complexity 80 of function (*Validator).validateBuffer() is high (> 15) (gocyclo)
    • jp/descent.go
    • Line 26: warning: cyclomatic complexity 38 of function (Descent).locate() is high (> 15) (gocyclo)
    • oj/color.go
    • Line 154: warning: cyclomatic complexity 37 of function (*Writer).colorObject() is high (> 15) (gocyclo)
    • Line 15: warning: cyclomatic complexity 27 of function (*Writer).colorJSON() is high (> 15) (gocyclo)
    • jp/filter.go
    • Line 147: warning: cyclomatic complexity 32 of function (Filter).removeOne() is high (> 15) (gocyclo)
    • Line 60: warning: cyclomatic complexity 24 of function (Filter).remove() is high (> 15) (gocyclo)
    • sen/tight.go
    • Line 142: warning: cyclomatic complexity 25 of function (*Writer).tightStruct() is high (> 15) (gocyclo)
    • Line 269: warning: cyclomatic complexity 20 of function (*Writer).tightMap() is high (> 15) (gocyclo)
    • asm/equal.go
    • Line 43: warning: cyclomatic complexity 23 of function equalVals() is high (> 15) (gocyclo)
    • oj/sinfo.go
    • Line 87: warning: cyclomatic complexity 17 of function buildTagFields() is high (> 15) (gocyclo)
    • jp/nth.go
    • Line 42: warning: cyclomatic complexity 17 of function (Nth).remove() is high (> 15) (gocyclo)
    • alt/sinfo.go
    • Line 95: warning: cyclomatic complexity 17 of function buildTagFields() is high (> 15) (gocyclo)
    • jp/has.go
    • Line 13: warning: cyclomatic complexity 253 of function (Expr).Has() is high (> 15) (gocyclo)
    • cmd/oj/main.go
    • Line 174: warning: cyclomatic complexity 41 of function run() is high (> 15) (gocyclo)
    • Line 669: warning: cyclomatic complexity 18 of function pickColor() is high (> 15) (gocyclo)
    • Line 320: warning: cyclomatic complexity 17 of function write() is high (> 15) (gocyclo)
    • sen/color.go
    • Line 150: warning: cyclomatic complexity 39 of function (*Writer).colorObject() is high (> 15) (gocyclo)
    • Line 14: warning: cyclomatic complexity 26 of function (*Writer).colorSEN() is high (> 15) (gocyclo)
    • pretty/build.go
    • Line 17: warning: cyclomatic complexity 32 of function (*Writer).build() is high (> 15) (gocyclo)
    • string.go
    • Line 115: warning: cyclomatic complexity 25 of function AppendSENString() is high (> 15) (gocyclo)
    • Line 41: warning: cyclomatic complexity 18 of function AppendJSONString() is high (> 15) (gocyclo)
    • alt/time.go
    • Line 18: warning: cyclomatic complexity 19 of function Time() is high (> 15) (gocyclo)
    • jp/node.go
    • Line 41: warning: cyclomatic complexity 95 of function (Expr).GetNodes() is high (> 15) (gocyclo)
    • Line 353: warning: cyclomatic complexity 84 of function (Expr).FirstNode() is high (> 15) (gocyclo)
    • jp/slice.go
    • Line 384: warning: cyclomatic complexity 61 of function (Slice).locate() is high (> 15) (gocyclo)
    • Line 196: warning: cyclomatic complexity 57 of function (Slice).removeOne() is high (> 15) (gocyclo)
    • Line 51: warning: cyclomatic complexity 51 of function (Slice).remove() is high (> 15) (gocyclo)
    • oj/tight.go
    • Line 137: warning: cyclomatic complexity 25 of function (*Writer).tightStruct() is high (> 15) (gocyclo)
    • Line 265: warning: cyclomatic complexity 20 of function (*Writer).tightMap() is high (> 15) (gocyclo)
    • jp/wildcard.go
    • Line 131: warning: cyclomatic complexity 72 of function (Wildcard).locate() is high (> 15) (gocyclo)
    • alt/recomposer.go
    • Line 312: warning: cyclomatic complexity 51 of function (*Recomposer).recomp() is high (> 15) (gocyclo)
    • Line 199: warning: cyclomatic complexity 38 of function (*Recomposer).recompAny() is high (> 15) (gocyclo)
    • Line 500: warning: cyclomatic complexity 26 of function (*Recomposer).setValue() is high (> 15) (gocyclo)
    • sen/writer.go
    • Line 167: warning: cyclomatic complexity 37 of function (*Writer).appendSEN() is high (> 15) (gocyclo)
    • Line 462: warning: cyclomatic complexity 32 of function (*Writer).appendStruct() is high (> 15) (gocyclo)
    • Line 648: warning: cyclomatic complexity 24 of function (*Writer).appendMap() is high (> 15) (gocyclo)
    • Line 400: warning: cyclomatic complexity 19 of function appendSortObject() is high (> 15) (gocyclo)
    • Line 344: warning: cyclomatic complexity 18 of function appendObject() is high (> 15) (gocyclo)
    • jp/parse.go
    • Line 567: warning: cyclomatic complexity 21 of function (*parser).readEq() is high (> 15) (gocyclo)
    • Line 283: warning: cyclomatic complexity 20 of function (*parser).readNum() is high (> 15) (gocyclo)
    • Line 445: warning: cyclomatic complexity 18 of function (*parser).readEscStr() is high (> 15) (gocyclo)
    • pretty/writer.go
    • Line 143: warning: cyclomatic complexity 40 of function (*Writer).fill() is high (> 15) (gocyclo)
    • Line 350: warning: cyclomatic complexity 16 of function (*Writer).alignMap() is high (> 15) (gocyclo)
    • alt/string.go
    • Line 19: warning: cyclomatic complexity 28 of function String() is high (> 15) (gocyclo)
    • jp/equation.go
    • Line 236: warning: cyclomatic complexity 20 of function (*Equation).Append() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!