Preparing report...

Report for github.com/kubernetes/gengo

A+    Excellent!    Found 51 issues across 114 files

Tweet

gofmt99%

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!


gocyclo88%

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.

    • gengo/namer/namer.go
    • Line 309: warning: cyclomatic complexity 22 of function (*rawNamer).Name() is high (> 15) (gocyclo)
    • Line 212: warning: cyclomatic complexity 18 of function (*NameStrategy).Name() is high (> 15) (gocyclo)
    • gengo/parser/parse.go
    • Line 668: warning: cyclomatic complexity 33 of function (*Builder).walkType() is high (> 15) (gocyclo)
    • Line 511: warning: cyclomatic complexity 17 of function (*Builder).findTypesIn() is high (> 15) (gocyclo)

golint61%

Golint is a linter for Go source code.

    • gengo/generator/default_package.go
    • Line 48: warning: exported method DefaultPackage.Name should have comment or be unexported (golint)
    • Line 49: warning: exported method DefaultPackage.Path should have comment or be unexported (golint)
    • Line 50: warning: exported method DefaultPackage.SourcePath should have comment or be unexported (golint)
    • Line 52: warning: exported method DefaultPackage.Filter should have comment or be unexported (golint)
    • Line 59: warning: exported method DefaultPackage.Generators should have comment or be unexported (golint)
    • Line 66: warning: exported method DefaultPackage.Header should have comment or be unexported (golint)
    • gengo/generator/snippet_writer.go
    • Line 39: warning: comment on exported function NewSnippetWriter should be of the form "NewSnippetWriter ..." (golint)
    • Line 147: warning: exported method SnippetWriter.Out should have comment or be unexported (golint)
    • gengo/examples/deepcopy-gen/output_tests/wholepkg/a.go
    • Line 21: warning: comment on exported type Struct_Empty should be of the form "Struct_Empty ..." (with optional leading article) (golint)
    • Line 22: warning: don't use underscores in Go names; type Struct_Empty should be StructEmpty (golint)
    • Line 24: warning: comment on exported type Struct_Primitives should be of the form "Struct_Primitives ..." (with optional leading article) (golint)
    • Line 25: warning: don't use underscores in Go names; type Struct_Primitives should be StructPrimitives (golint)
    • Line 31: warning: don't use underscores in Go names; type Struct_Primitives_Alias should be StructPrimitivesAlias (golint)
    • Line 31: warning: exported type Struct_Primitives_Alias should have comment or be unexported (golint)
    • Line 32: warning: don't use underscores in Go names; type Struct_Embed_Struct_Primitives should be StructEmbedStructPrimitives (golint)
    • Line 32: warning: exported type Struct_Embed_Struct_Primitives should have comment or be unexported (golint)
    • Line 35: warning: don't use underscores in Go names; type Struct_Embed_Int should be StructEmbedInt (golint)
    • Line 35: warning: exported type Struct_Embed_Int should have comment or be unexported (golint)
    • Line 38: warning: don't use underscores in Go names; type Struct_Struct_Primitives should be StructStructPrimitives (golint)
    • Line 38: warning: exported type Struct_Struct_Primitives should have comment or be unexported (golint)
    • Line 42: warning: comment on exported type ManualStruct should be of the form "ManualStruct ..." (with optional leading article) (golint)
    • Line 47: warning: exported method ManualStruct.DeepCopy should have comment or be unexported (golint)
    • Line 51: warning: don't use underscores in Go names; type ManualStruct_Alias should be ManualStructAlias (golint)
    • Line 51: warning: exported type ManualStruct_Alias should have comment or be unexported (golint)
    • Line 53: warning: don't use underscores in Go names; type Struct_Embed_ManualStruct should be StructEmbedManualStruct (golint)
    • Line 53: warning: exported type Struct_Embed_ManualStruct should have comment or be unexported (golint)
    • Line 57: warning: comment on exported type Struct_PrimitivePointers should be of the form "Struct_PrimitivePointers ..." (with optional leading article) (golint)
    • Line 58: warning: don't use underscores in Go names; type Struct_PrimitivePointers should be StructPrimitivePointers (golint)
    • Line 64: warning: don't use underscores in Go names; type Struct_PrimitivePointers_Alias should be StructPrimitivePointersAlias (golint)
    • Line 64: warning: exported type Struct_PrimitivePointers_Alias should have comment or be unexported (golint)
    • Line 65: warning: don't use underscores in Go names; type Struct_Embed_Struct_PrimitivePointers should be StructEmbedStructPrimitivePointers (golint)
    • Line 65: warning: exported type Struct_Embed_Struct_PrimitivePointers should have comment or be unexported (golint)
    • Line 68: warning: don't use underscores in Go names; type Struct_Embed_Pointer should be StructEmbedPointer (golint)
    • Line 68: warning: exported type Struct_Embed_Pointer should have comment or be unexported (golint)
    • Line 71: warning: don't use underscores in Go names; type Struct_Struct_PrimitivePointers should be StructStructPrimitivePointers (golint)
    • Line 71: warning: exported type Struct_Struct_PrimitivePointers should have comment or be unexported (golint)
    • Line 75: warning: comment on exported type ManualSlice should be of the form "ManualSlice ..." (with optional leading article) (golint)
    • Line 78: warning: exported method ManualSlice.DeepCopy should have comment or be unexported (golint)
    • Line 84: warning: comment on exported type Struct_Slices should be of the form "Struct_Slices ..." (with optional leading article) (golint)
    • Line 85: warning: don't use underscores in Go names; type Struct_Slices should be StructSlices (golint)
    • Line 99: warning: don't use underscores in Go names; type Struct_Slices_Alias should be StructSlicesAlias (golint)
    • Line 99: warning: exported type Struct_Slices_Alias should have comment or be unexported (golint)
    • Line 100: warning: don't use underscores in Go names; type Struct_Embed_Struct_Slices should be StructEmbedStructSlices (golint)
    • Line 100: warning: exported type Struct_Embed_Struct_Slices should have comment or be unexported (golint)
    • Line 103: warning: don't use underscores in Go names; type Struct_Struct_Slices should be StructStructSlices (golint)
    • Line 103: warning: exported type Struct_Struct_Slices should have comment or be unexported (golint)
    • Line 107: warning: comment on exported type Struct_Everything should be of the form "Struct_Everything ..." (with optional leading article) (golint)
    • Line 108: warning: don't use underscores in Go names; type Struct_Everything should be StructEverything (golint)
    • Line 134: warning: comment on exported type Struct_ExplicitObject should be of the form "Struct_ExplicitObject ..." (with optional leading article) (golint)
    • Line 136: warning: don't use underscores in Go names; type Struct_ExplicitObject should be StructExplicitObject (golint)
    • Line 140: warning: comment on exported type Struct_NonPointerExplicitObject should be of the form "Struct_NonPointerExplicitObject ..." (with optional leading article) (golint)
    • Line 143: warning: don't use underscores in Go names; type Struct_NonPointerExplicitObject should be StructNonPointerExplicitObject (golint)
    • Line 147: warning: comment on exported type Struct_TypeMeta should be of the form "Struct_TypeMeta ..." (with optional leading article) (golint)
    • Line 148: warning: don't use underscores in Go names; type Struct_TypeMeta should be StructTypeMeta (golint)
    • Line 151: warning: comment on exported type Struct_ObjectAndList should be of the form "Struct_ObjectAndList ..." (with optional leading article) (golint)
    • Line 153: warning: don't use underscores in Go names; type Struct_ObjectAndList should be StructObjectAndList (golint)
    • Line 156: warning: comment on exported type Struct_ObjectAndObject should be of the form "Struct_ObjectAndObject ..." (with optional leading article) (golint)
    • Line 158: warning: don't use underscores in Go names; type Struct_ObjectAndObject should be StructObjectAndObject (golint)
    • Line 161: warning: comment on exported type Struct_ExplicitSelectorExplicitObject should be of the form "Struct_ExplicitSelectorExplicitObject ..." (with optional leading article) (golint)
    • Line 163: warning: don't use underscores in Go names; type Struct_ExplicitSelectorExplicitObject should be StructExplicitSelectorExplicitObject (golint)
    • Line 167: warning: don't use underscores in Go names; type Struct_Interfaces should be StructInterfaces (golint)
    • Line 167: warning: exported type Struct_Interfaces should have comment or be unexported (golint)
    • gengo/examples/defaulter-gen/generators/defaulter.go
    • Line 229: warning: exported function Packages should have comment or be unexported (golint)
    • Line 481: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 521: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 674: warning: exported function NewGenDefaulter should have comment or be unexported (golint)
    • gengo/examples/deepcopy-gen/generators/deepcopy.go
    • Line 128: warning: exported function Packages should have comment or be unexported (golint)
    • Line 237: warning: exported function NewGenDeepCopy should have comment or be unexported (golint)
    • Line 414: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 575: warning: exported type TypeSlice should have comment or be unexported (golint)
    • Line 580: warning: exported method TypeSlice.Sort should have comment or be unexported (golint)
    • gengo/generator/default_generator.go
    • Line 27: warning: exported const GolangFileType should have comment (or a comment on this block) or be unexported (golint)
    • Line 44: warning: exported method DefaultGen.Name should have comment or be unexported (golint)
    • Line 45: warning: exported method DefaultGen.Filter should have comment or be unexported (golint)
    • Line 46: warning: exported method DefaultGen.Namers should have comment or be unexported (golint)
    • Line 47: warning: exported method DefaultGen.Imports should have comment or be unexported (golint)
    • Line 48: warning: exported method DefaultGen.PackageVars should have comment or be unexported (golint)
    • Line 49: warning: exported method DefaultGen.PackageConsts should have comment or be unexported (golint)
    • Line 50: warning: exported method DefaultGen.GenerateType should have comment or be unexported (golint)
    • Line 51: warning: exported method DefaultGen.Filename should have comment or be unexported (golint)
    • Line 52: warning: exported method DefaultGen.FileType should have comment or be unexported (golint)
    • Line 53: warning: exported method DefaultGen.Finalize should have comment or be unexported (golint)
    • Line 55: warning: exported method DefaultGen.Init should have comment or be unexported (golint)
    • gengo/namer/import_tracker.go
    • Line 25: warning: comment on exported type DefaultImportTracker should be of the form "DefaultImportTracker ..." (with optional leading article) (golint)
    • Line 45: warning: exported function NewDefaultImportTracker should have comment or be unexported (golint)
    • Line 53: warning: exported method DefaultImportTracker.AddTypes should have comment or be unexported (golint)
    • Line 58: warning: exported method DefaultImportTracker.AddType should have comment or be unexported (golint)
    • Line 88: warning: exported method DefaultImportTracker.ImportLines should have comment or be unexported (golint)
    • gengo/namer/namer.go
    • Line 37: warning: comment on exported function IsPrivateGoName should be of the form "IsPrivateGoName ..." (golint)
    • Line 211: warning: comment on exported method NameStrategy.Name should be of the form "Name ..." (golint)
    • gengo/examples/deepcopy-gen/output_tests/aliases/doc.go
    • Line 19: warning: package comment should be of the form "Package aliases ..." (golint)
    • Line 27: warning: comment on exported type Foo should be of the form "Foo ..." (with optional leading article) (golint)
    • Line 34: warning: exported type Interface should have comment or be unexported (golint)
    • Line 40: warning: exported type Builtin should have comment or be unexported (golint)
    • Line 41: warning: exported type Slice should have comment or be unexported (golint)
    • Line 42: warning: exported type Pointer should have comment or be unexported (golint)
    • Line 43: warning: exported type PointerAlias should have comment or be unexported (golint)
    • Line 44: warning: exported type Struct should have comment or be unexported (golint)
    • Line 45: warning: exported type Map should have comment or be unexported (golint)
    • Line 47: warning: exported type FooAlias should have comment or be unexported (golint)
    • Line 48: warning: exported type FooSlice should have comment or be unexported (golint)
    • Line 49: warning: exported type FooPointer should have comment or be unexported (golint)
    • Line 50: warning: exported type FooMap should have comment or be unexported (golint)
    • Line 52: warning: exported type AliasBuiltin should have comment or be unexported (golint)
    • Line 53: warning: exported type AliasSlice should have comment or be unexported (golint)
    • Line 54: warning: exported type AliasPointer should have comment or be unexported (golint)
    • Line 55: warning: exported type AliasStruct should have comment or be unexported (golint)
    • Line 56: warning: exported type AliasMap should have comment or be unexported (golint)
    • Line 58: warning: exported type AliasInterface should have comment or be unexported (golint)
    • Line 59: warning: exported type AliasAliasInterface should have comment or be unexported (golint)
    • Line 60: warning: exported type AliasInterfaceMap should have comment or be unexported (golint)
    • Line 61: warning: exported type AliasInterfaceSlice should have comment or be unexported (golint)
    • Line 63: warning: comment on exported type Ttest should be of the form "Ttest ..." (with optional leading article) (golint)
    • gengo/types/types.go
    • Line 30: warning: comment on exported type Name should be of the form "Name ..." (with optional leading article) (golint)
    • Line 62: warning: comment on exported type Kind should be of the form "Kind ..." (with optional leading article) (golint)
    • Line 68: warning: exported const Struct should have comment (or a comment on this block) or be unexported (golint)
    • Line 86: warning: comment on exported const Array should be of the form "Array ..." (golint)
    • Line 395: warning: comment on exported type Member should be of the form "Member ..." (with optional leading article) (golint)
    • Line 526: warning: exported function IsInteger should have comment or be unexported (golint)
    • gengo/generator/execute.go
    • Line 61: warning: exported type DefaultFileType should have comment or be unexported (golint)
    • Line 66: warning: exported method DefaultFileType.AssembleFile should have comment or be unexported (golint)
    • Line 87: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 93: warning: exported method DefaultFileType.VerifyFile should have comment or be unexported (golint)
    • Line 165: warning: exported function NewGolangFile should have comment 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!