Preparing report...

Report for github.com/dgraph-io/gqlparser

A    Great!    Found 55 issues across 74 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


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.

    • gqlparser/lexer/token.go
    • Line 34: warning: cyclomatic complexity 23 of function (Type).Name() is high (> 15) (gocyclo)
    • Line 84: warning: cyclomatic complexity 23 of function (Type).String() is high (> 15) (gocyclo)
    • gqlparser/validator/schema.go
    • Line 22: warning: cyclomatic complexity 37 of function ValidateSchemaDocument() is high (> 15) (gocyclo)
    • Line 178: warning: cyclomatic complexity 28 of function validateDefinition() is high (> 15) (gocyclo)
    • gqlparser/lexer/lexer.go
    • Line 77: warning: cyclomatic complexity 29 of function (*Lexer).ReadToken() is high (> 15) (gocyclo)
    • Line 302: warning: cyclomatic complexity 24 of function (*Lexer).readString() is high (> 15) (gocyclo)
    • Line 412: warning: cyclomatic complexity 16 of function (*Lexer).readBlockString() is high (> 15) (gocyclo)

golint28%

Golint is a linter for Go source code.

    • gqlparser/validator/messaging.go
    • Line 5: warning: comment on exported function QuotedOrList should be of the form "QuotedOrList ..." (golint)
    • Line 14: warning: comment on exported function OrList should be of the form "OrList ..." (golint)
    • gqlparser/validator/walk.go
    • Line 10: warning: exported type Events should have comment or be unexported (golint)
    • Line 21: warning: exported method Events.OnOperation should have comment or be unexported (golint)
    • Line 24: warning: exported method Events.OnField should have comment or be unexported (golint)
    • Line 27: warning: exported method Events.OnFragment should have comment or be unexported (golint)
    • Line 30: warning: exported method Events.OnInlineFragment should have comment or be unexported (golint)
    • Line 33: warning: exported method Events.OnFragmentSpread should have comment or be unexported (golint)
    • Line 36: warning: exported method Events.OnDirective should have comment or be unexported (golint)
    • Line 39: warning: exported method Events.OnDirectiveList should have comment or be unexported (golint)
    • Line 42: warning: exported method Events.OnValue should have comment or be unexported (golint)
    • Line 46: warning: exported function Walk should have comment or be unexported (golint)
    • Line 57: warning: exported type Walker should have comment or be unexported (golint)
    • gqlparser/lexer/token.go
    • Line 10: warning: exported const Invalid should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported method Type.Name should have comment or be unexported (golint)
    • Line 134: warning: comment on exported type Type should be of the form "Type ..." (with optional leading article) (golint)
    • Line 137: warning: exported type Token should have comment or be unexported (golint)
    • gqlparser/ast/selection.go
    • Line 3: warning: exported type SelectionSet should have comment or be unexported (golint)
    • Line 5: warning: exported type Selection should have comment or be unexported (golint)
    • Line 14: warning: exported method Field.GetPosition should have comment or be unexported (golint)
    • Line 15: warning: exported method FragmentSpread.GetPosition should have comment or be unexported (golint)
    • Line 16: warning: exported method InlineFragment.GetPosition should have comment or be unexported (golint)
    • Line 18: warning: exported type Field should have comment or be unexported (golint)
    • Line 31: warning: exported type Argument should have comment or be unexported (golint)
    • Line 37: warning: exported method Field.ArgumentMap should have comment or be unexported (golint)
    • Line 37: warning: receiver name f should be consistent with previous receiver name s for Field (golint)
    • gqlparser/validator/error.go
    • Line 10: warning: exported type ErrorOption should have comment or be unexported (golint)
    • Line 12: warning: exported function Message should have comment or be unexported (golint)
    • Line 18: warning: exported function At should have comment or be unexported (golint)
    • Line 33: warning: exported function SuggestListQuoted should have comment or be unexported (golint)
    • Line 42: warning: exported function SuggestListUnquoted should have comment or be unexported (golint)
    • Line 51: warning: exported function Suggestf should have comment or be unexported (golint)
    • gqlparser/ast/operation.go
    • Line 3: warning: exported type Operation should have comment or be unexported (golint)
    • Line 6: warning: exported const Query should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported type OperationDefinition should have comment or be unexported (golint)
    • Line 20: warning: exported type VariableDefinition should have comment or be unexported (golint)
    • gqlparser/ast/value.go
    • Line 9: warning: exported type ValueKind should have comment or be unexported (golint)
    • Line 12: warning: exported const Variable should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported type Value should have comment or be unexported (golint)
    • Line 36: warning: exported type ChildValue should have comment or be unexported (golint)
    • Line 42: warning: exported method Value.Value should have comment or be unexported (golint)
    • Line 118: warning: exported method Value.Dump should have comment or be unexported (golint)
    • gqlparser/gqlerror/error.go
    • Line 21: warning: exported method Error.SetFile should have comment or be unexported (golint)
    • Line 32: warning: exported type Location should have comment or be unexported (golint)
    • Line 37: warning: exported type List should have comment or be unexported (golint)
    • Line 83: warning: exported function WrapPath should have comment or be unexported (golint)
    • Line 91: warning: exported function Errorf should have comment or be unexported (golint)
    • Line 97: warning: exported function ErrorPathf should have comment or be unexported (golint)
    • Line 104: warning: exported function ErrorPosf should have comment or be unexported (golint)
    • Line 114: warning: exported function ErrorLocf should have comment or be unexported (golint)
    • gqlparser/ast/document.go
    • Line 3: warning: exported type QueryDocument should have comment or be unexported (golint)
    • Line 9: warning: exported type SchemaDocument should have comment or be unexported (golint)
    • Line 18: warning: exported method SchemaDocument.Merge should have comment or be unexported (golint)
    • Line 26: warning: exported type Schema should have comment or be unexported (golint)
    • Line 38: warning: exported method Schema.AddPossibleType should have comment or be unexported (golint)
    • Line 47: warning: exported method Schema.AddImplements should have comment or be unexported (golint)
    • Line 56: warning: exported type SchemaDefinition should have comment or be unexported (golint)
    • Line 63: warning: exported type OperationTypeDefinition should have comment or be unexported (golint)
    • gqlparser/ast/fragment.go
    • Line 3: warning: exported type FragmentSpread should have comment or be unexported (golint)
    • Line 14: warning: exported type InlineFragment should have comment or be unexported (golint)
    • Line 25: warning: exported type FragmentDefinition should have comment or be unexported (golint)
    • gqlparser/lexer/lexer.go
    • Line 28: warning: exported function New should have comment or be unexported (golint)
    • Line 257: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gqlparser/gqlparser.go
    • Line 8: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 11: warning: exported function LoadSchema should have comment or be unexported (golint)
    • Line 15: warning: exported function MustLoadSchema should have comment or be unexported (golint)
    • Line 23: warning: exported function LoadQuery should have comment or be unexported (golint)
    • Line 36: warning: exported function MustLoadQuery should have comment or be unexported (golint)
    • gqlparser/ast/path.go
    • Line 11: warning: exported type Path should have comment or be unexported (golint)
    • Line 13: warning: exported type PathElement should have comment or be unexported (golint)
    • Line 38: warning: exported method Path.UnmarshalJSON should have comment or be unexported (golint)
    • Line 61: warning: exported type PathIndex should have comment or be unexported (golint)
    • Line 63: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 65: warning: exported type PathName should have comment or be unexported (golint)
    • Line 67: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • gqlparser/validator/schema.go
    • Line 9: warning: should not use dot imports (golint)
    • Line 14: warning: exported function LoadSchema should have comment or be unexported (golint)
    • Line 22: warning: exported function ValidateSchemaDocument should have comment or be unexported (golint)
    • gqlparser/parser/testrunner/runner.go
    • Line 14: warning: exported type Features should have comment or be unexported (golint)
    • Line 16: warning: exported type Spec should have comment or be unexported (golint)
    • Line 24: warning: exported type Token should have comment or be unexported (golint)
    • Line 38: warning: exported function Test should have comment or be unexported (golint)
    • gqlparser/ast/collections.go
    • Line 3: warning: exported type FieldList should have comment or be unexported (golint)
    • Line 5: warning: exported method FieldList.ForName should have comment or be unexported (golint)
    • Line 14: warning: exported type EnumValueList should have comment or be unexported (golint)
    • Line 16: warning: exported method EnumValueList.ForName should have comment or be unexported (golint)
    • Line 25: warning: exported type DirectiveList should have comment or be unexported (golint)
    • Line 27: warning: exported method DirectiveList.ForName should have comment or be unexported (golint)
    • Line 36: warning: exported method DirectiveList.ForNames should have comment or be unexported (golint)
    • Line 46: warning: exported type OperationList should have comment or be unexported (golint)
    • Line 48: warning: exported method OperationList.ForName should have comment or be unexported (golint)
    • Line 60: warning: exported type FragmentDefinitionList should have comment or be unexported (golint)
    • Line 62: warning: exported method FragmentDefinitionList.ForName should have comment or be unexported (golint)
    • Line 71: warning: exported type VariableDefinitionList should have comment or be unexported (golint)
    • Line 73: warning: exported method VariableDefinitionList.ForName should have comment or be unexported (golint)
    • Line 82: warning: exported type ArgumentList should have comment or be unexported (golint)
    • Line 84: warning: exported method ArgumentList.ForName should have comment or be unexported (golint)
    • Line 93: warning: exported type ArgumentDefinitionList should have comment or be unexported (golint)
    • Line 95: warning: exported method ArgumentDefinitionList.ForName should have comment or be unexported (golint)
    • Line 104: warning: exported type SchemaDefinitionList should have comment or be unexported (golint)
    • Line 106: warning: exported type DirectiveDefinitionList should have comment or be unexported (golint)
    • Line 108: warning: exported method DirectiveDefinitionList.ForName should have comment or be unexported (golint)
    • Line 117: warning: exported type DefinitionList should have comment or be unexported (golint)
    • Line 119: warning: exported method DefinitionList.ForName should have comment or be unexported (golint)
    • Line 128: warning: exported type OperationTypeDefinitionList should have comment or be unexported (golint)
    • Line 130: warning: exported method OperationTypeDefinitionList.ForType should have comment or be unexported (golint)
    • Line 139: warning: exported type ChildValueList should have comment or be unexported (golint)
    • Line 141: warning: exported method ChildValueList.ForName should have comment or be unexported (golint)
    • gqlparser/validator/validator.go
    • Line 4: warning: should not use dot imports (golint)
    • Line 8: warning: exported type AddErrFunc should have comment or be unexported (golint)
    • Line 19: warning: comment on exported function AddRule should be of the form "AddRule ..." (golint)
    • Line 25: warning: exported function Validate should have comment or be unexported (golint)
    • gqlparser/ast/definition.go
    • Line 3: warning: exported type DefinitionKind should have comment or be unexported (golint)
    • Line 6: warning: exported const Scalar should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: comment on exported type Definition should be of the form "Definition ..." (with optional leading article) (golint)
    • Line 36: warning: exported method Definition.IsLeafType should have comment or be unexported (golint)
    • Line 40: warning: exported method Definition.IsAbstractType should have comment or be unexported (golint)
    • Line 44: warning: exported method Definition.IsCompositeType should have comment or be unexported (golint)
    • Line 48: warning: exported method Definition.IsInputType should have comment or be unexported (golint)
    • Line 52: warning: exported method Definition.OneOf should have comment or be unexported (golint)
    • Line 61: warning: exported type FieldDefinition should have comment or be unexported (golint)
    • Line 71: warning: exported type ArgumentDefinition should have comment or be unexported (golint)
    • Line 80: warning: exported type EnumValueDefinition should have comment or be unexported (golint)
    • Line 87: warning: exported type DirectiveDefinition should have comment or be unexported (golint)
    • gqlparser/ast/type.go
    • Line 3: warning: exported function NonNullNamedType should have comment or be unexported (golint)
    • Line 7: warning: exported function NamedType should have comment or be unexported (golint)
    • Line 11: warning: exported function NonNullListType should have comment or be unexported (golint)
    • Line 15: warning: exported function ListType should have comment or be unexported (golint)
    • Line 19: warning: exported type Type should have comment or be unexported (golint)
    • Line 26: warning: exported method Type.Name should have comment or be unexported (golint)
    • Line 46: warning: exported method Type.IsCompatible should have comment or be unexported (golint)
    • Line 66: warning: exported method Type.Dump should have comment or be unexported (golint)
    • Line 66: warning: receiver name v should be consistent with previous receiver name t for Type (golint)
    • gqlparser/parser/schema.go
    • Line 4: warning: should not use dot imports (golint)
    • Line 9: warning: exported function ParseSchema should have comment or be unexported (golint)
    • Line 28: warning: exported function ParseSchemas should have comment or be unexported (golint)
    • gqlparser/ast/directive.go
    • Line 3: warning: exported type DirectiveLocation should have comment or be unexported (golint)
    • Line 6: warning: comment on exported const LocationQuery should be of the form "LocationQuery ..." (golint)
    • Line 8: warning: exported const LocationMutation should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: comment on exported const LocationSchema should be of the form "LocationSchema ..." (golint)
    • Line 29: warning: exported type Directive should have comment or be unexported (golint)
    • Line 40: warning: exported method Directive.ArgumentMap 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!