Preparing report...

Report for github.com/goccy/go-yaml

A+    Excellent!    Found 14 issues across 28 files

Tweet

gofmt92%

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!


gocyclo71%

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-yaml/parser/parser.go
    • Line 203: warning: cyclomatic complexity 20 of function (*parser).parseMappingValue() is high (> 15) (gocyclo)
    • Line 567: warning: cyclomatic complexity 16 of function (*parser).createNodeFromToken() is high (> 15) (gocyclo)
    • go-yaml/decode.go
    • Line 970: warning: cyclomatic complexity 45 of function (*Decoder).decodeStruct() is high (> 15) (gocyclo)
    • Line 641: warning: cyclomatic complexity 41 of function (*Decoder).decodeValue() is high (> 15) (gocyclo)
    • Line 176: warning: cyclomatic complexity 30 of function (*Decoder).nodeToValue() is high (> 15) (gocyclo)
    • Line 553: warning: cyclomatic complexity 22 of function (*Decoder).decodeByUnmarshaler() is high (> 15) (gocyclo)
    • Line 1296: warning: cyclomatic complexity 18 of function (*Decoder).decodeMap() is high (> 15) (gocyclo)
    • go-yaml/decode_test.go
    • Line 1059: warning: cyclomatic complexity 35 of function TestDecoder_TypeConversionError() is high (> 15) (gocyclo)
    • Line 1303: warning: cyclomatic complexity 27 of function TestDecodeWithMergeKey() is high (> 15) (gocyclo)
    • Line 1930: warning: cyclomatic complexity 21 of function TestUnmarshalableString() is high (> 15) (gocyclo)
    • go-yaml/encode.go
    • Line 601: warning: cyclomatic complexity 34 of function (*Encoder).encodeStruct() is high (> 15) (gocyclo)
    • Line 296: warning: cyclomatic complexity 22 of function (*Encoder).encodeValue() is high (> 15) (gocyclo)
    • Line 212: warning: cyclomatic complexity 21 of function (*Encoder).encodeByMarshaler() is high (> 15) (gocyclo)
    • Line 527: warning: cyclomatic complexity 17 of function (*Encoder).isZeroValue() is high (> 15) (gocyclo)
    • go-yaml/scanner/scanner.go
    • Line 595: warning: cyclomatic complexity 72 of function (*Scanner).scan() is high (> 15) (gocyclo)
    • Line 260: warning: cyclomatic complexity 26 of function (*Scanner).scanDoubleQuote() is high (> 15) (gocyclo)
    • go-yaml/ast/ast.go
    • Line 2020: warning: cyclomatic complexity 27 of function (*parentFinder).walk() is high (> 15) (gocyclo)
    • Line 1932: warning: cyclomatic complexity 23 of function Walk() is high (> 15) (gocyclo)
    • Line 69: warning: cyclomatic complexity 22 of function (NodeType).String() is high (> 15) (gocyclo)
    • Line 119: warning: cyclomatic complexity 22 of function (NodeType).YAMLName() is high (> 15) (gocyclo)
    • go-yaml/token/token.go
    • Line 483: warning: cyclomatic complexity 57 of function getNumberStat() is high (> 15) (gocyclo)
    • Line 123: warning: cyclomatic complexity 33 of function (Type).String() is high (> 15) (gocyclo)

golint71%

Golint is a linter for Go source code.

    • go-yaml/path.go
    • Line 338: warning: comment on exported method Path.ReplaceWithNode should be of the form "ReplaceWithNode ..." (golint)
    • go-yaml/internal/errors/error.go
    • Line 18: warning: exported var ErrDecodeRequiredPointerType should have comment or be unexported (golint)
    • Line 201: warning: exported type PrettyPrinter should have comment or be unexported (golint)
    • Line 204: warning: exported type Sink should have comment or be unexported (golint)
    • Line 206: warning: exported method Sink.Print should have comment or be unexported (golint)
    • Line 210: warning: exported method Sink.Printf should have comment or be unexported (golint)
    • Line 214: warning: exported method Sink.Detail should have comment or be unexported (golint)
    • go-yaml/printer/printer.go
    • Line 192: warning: exported method Printer.PrintErrorMessage should have comment or be unexported (golint)
    • Line 330: warning: exported method Printer.PrintErrorToken should have comment or be unexported (golint)
    • go-yaml/parser/parser.go
    • Line 630: warning: exported type Mode should have comment or be unexported (golint)
    • Line 633: warning: exported const ParseComments should have comment (or a comment on this block) or be unexported (golint)
    • Line 656: warning: comment on exported function ParseFile should be of the form "ParseFile ..." (golint)
    • go-yaml/ast/ast.go
    • Line 15: warning: exported var ErrInvalidTokenType should have comment or be unexported (golint)
    • Line 117: warning: comment on exported method NodeType.YAMLName should be of the form "YAMLName ..." (golint)
    • Line 204: warning: exported type BaseNode should have comment or be unexported (golint)
    • Line 438: warning: exported function CommentGroup should have comment or be unexported (golint)
    • Line 497: warning: exported function Anchor should have comment or be unexported (golint)
    • Line 504: warning: exported function Alias should have comment or be unexported (golint)
    • Line 511: warning: exported function Document should have comment or be unexported (golint)
    • Line 519: warning: exported function Directive should have comment or be unexported (golint)
    • Line 526: warning: exported function Literal should have comment or be unexported (golint)
    • Line 533: warning: exported function Tag should have comment or be unexported (golint)
    • Line 1630: warning: exported method AnchorNode.SetName should have comment or be unexported (golint)
    • Line 1695: warning: exported method AliasNode.SetName should have comment or be unexported (golint)
    • Line 1902: warning: exported method CommentGroupNode.StringWithSpace should have comment or be unexported (golint)
    • Line 2105: warning: exported type ErrInvalidMergeType should have comment or be unexported (golint)
    • go-yaml/error.go
    • Line 9: warning: exported var ErrInvalidQuery should have comment or be unexported (golint)
    • Line 17: warning: exported function ErrUnsupportedHeadPositionType should have comment or be unexported (golint)
    • go-yaml/option.go
    • Line 164: warning: exported const CommentLinePosition should have comment (or a comment on this block) or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell96%

Misspell Finds commonly misspelled English words

    • go-yaml/decode_test.go
    • Line 1878: warning: "complecated" is a misspelling of "complicated" (misspell)
    • Line 1884: warning: "complecated" is a misspelling of "complicated" (misspell)
    • Line 1887: warning: "complecated" is a misspelling of "complicated" (misspell)