Preparing report...

Report for github.com/mindstand/gogm/v2

(v2.3.2)

A+    Excellent!    Found 30 issues across 47 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!


gocyclo82%

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.

    • index_v4.go
    • Line 245: warning: cyclomatic complexity 26 of function verifyAllIndexesAndConstraintsV4() is high (> 15) (gocyclo)
    • Line 175: warning: cyclomatic complexity 18 of function createAllIndexesAndConstraintsV4() is high (> 15) (gocyclo)
    • Line 96: warning: cyclomatic complexity 18 of function dropAllIndexesAndConstraintsV4() is high (> 15) (gocyclo)
    • cmd/gogmcli/gen/parse.go
    • Line 107: warning: cyclomatic complexity 24 of function parseGogmEdge() is high (> 15) (gocyclo)
    • Line 174: warning: cyclomatic complexity 19 of function parseGogmNode() is high (> 15) (gocyclo)
    • index_v3.go
    • Line 203: warning: cyclomatic complexity 18 of function verifyAllIndexesAndConstraintsV3() is high (> 15) (gocyclo)
    • Line 126: warning: cyclomatic complexity 16 of function createAllIndexesAndConstraintsV3() is high (> 15) (gocyclo)
    • util.go
    • Line 276: warning: cyclomatic complexity 17 of function (*relationConfigs).Validate() is high (> 15) (gocyclo)
    • Line 123: warning: cyclomatic complexity 17 of function toCypherParamsMap() is high (> 15) (gocyclo)
    • decorator.go
    • Line 170: warning: cyclomatic complexity 56 of function (*decoratorConfig).Validate() is high (> 15) (gocyclo)
    • Line 292: warning: cyclomatic complexity 34 of function newDecoratorConfig() is high (> 15) (gocyclo)
    • Line 500: warning: cyclomatic complexity 16 of function getStructDecoratorConfig() is high (> 15) (gocyclo)
    • decoder.go
    • Line 62: warning: cyclomatic complexity 48 of function decode() is high (> 15) (gocyclo)
    • Line 511: warning: cyclomatic complexity 34 of function convertToValue() is high (> 15) (gocyclo)
    • Line 424: warning: cyclomatic complexity 17 of function sortPaths() is high (> 15) (gocyclo)
    • cmd/gogmcli/gen/gen.go
    • Line 42: warning: cyclomatic complexity 44 of function Generate() is high (> 15) (gocyclo)
    • Line 248: warning: cyclomatic complexity 21 of function parseDirection() is high (> 15) (gocyclo)
    • save.go
    • Line 626: warning: cyclomatic complexity 34 of function parseStruct() is high (> 15) (gocyclo)
    • Line 358: warning: cyclomatic complexity 27 of function generateCurRels() is high (> 15) (gocyclo)
    • Line 506: warning: cyclomatic complexity 19 of function createNodes() is high (> 15) (gocyclo)
    • Line 58: warning: cyclomatic complexity 17 of function saveDepth() is high (> 15) (gocyclo)

golint42%

Golint is a linter for Go source code.

    • testing_/test_edge.go
    • Line 20: warning: don't use an underscore in package name (golint)
    • Line 27: warning: exported type SpecialEdge should have comment or be unexported (golint)
    • Line 36: warning: exported method SpecialEdge.GetStartNode should have comment or be unexported (golint)
    • Line 40: warning: exported method SpecialEdge.GetStartNodeType should have comment or be unexported (golint)
    • Line 44: warning: exported method SpecialEdge.SetStartNode should have comment or be unexported (golint)
    • Line 49: warning: exported method SpecialEdge.GetEndNode should have comment or be unexported (golint)
    • Line 53: warning: exported method SpecialEdge.GetEndNodeType should have comment or be unexported (golint)
    • Line 57: warning: exported method SpecialEdge.SetEndNode should have comment or be unexported (golint)
    • testing_/test_omit.go
    • Line 20: warning: don't use an underscore in package name (golint)
    • Line 22: warning: exported type OrdinaryNonGogmStruct should have comment or be unexported (golint)
    • errors.go
    • Line 29: warning: exported type InvalidDecoratorConfigError should have comment or be unexported (golint)
    • Line 34: warning: exported function NewInvalidDecoratorConfigError should have comment or be unexported (golint)
    • Line 45: warning: exported type InvalidStructConfigError should have comment or be unexported (golint)
    • Line 49: warning: exported function NewInvalidStructConfigError should have comment or be unexported (golint)
    • Line 59: warning: comment on exported var ErrNotFound should be of the form "ErrNotFound ..." (golint)
    • Line 61: warning: exported var ErrInternal should have comment or be unexported (golint)
    • Line 62: warning: exported var ErrValidation should have comment or be unexported (golint)
    • Line 63: warning: exported var ErrInvalidParams should have comment or be unexported (golint)
    • Line 64: warning: exported var ErrConfiguration should have comment or be unexported (golint)
    • Line 65: warning: exported var ErrTransaction should have comment or be unexported (golint)
    • Line 66: warning: exported var ErrConnection should have comment or be unexported (golint)
    • interfacev2.go
    • Line 29: warning: comment on exported type SessionV2 should be of the form "SessionV2 ..." (with optional leading article) (golint)
    • Line 101: warning: exported type TransactionWork should have comment or be unexported (golint)
    • load_strategy.go
    • Line 30: warning: comment on exported type LoadStrategy should be of the form "LoadStrategy ..." (with optional leading article) (golint)
    • Line 34: warning: comment on exported const PATH_LOAD_STRATEGY should be of the form "PATH_LOAD_STRATEGY ..." (golint)
    • Line 36: warning: comment on exported const SCHEMA_LOAD_STRATEGY should be of the form "SCHEMA_LOAD_STRATEGY ..." (golint)
    • log.go
    • Line 27: warning: exported type Logger should have comment or be unexported (golint)
    • Line 116: warning: exported function GetDefaultLogger should have comment or be unexported (golint)
    • pk.go
    • Line 29: warning: exported type GenerateNewIDFunc should have comment or be unexported (golint)
    • Line 31: warning: exported type PrimaryKeyStrategy should have comment or be unexported (golint)
    • Line 76: warning: exported var UUIDPrimaryKeyStrategy should have comment or be unexported (golint)
    • cmd/gogmcli/util/util.go
    • Line 43: warning: exported function RemoveFromString should have comment or be unexported (golint)
    • Line 51: warning: exported function StringSliceContains should have comment or be unexported (golint)
    • index_v3.go
    • Line 119: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • integration_test.go
    • Line 636: warning: receiver name i should be consistent with previous receiver name integrationTest for IntegrationTestSuite (golint)
    • Line 681: warning: don't use underscores in Go names; func testSchemaLoadStrategy_Setup should be testSchemaLoadStrategySetup (golint)
    • Line 733: warning: receiver name i should be consistent with previous receiver name integrationTest for IntegrationTestSuite (golint)
    • Line 760: warning: don't use underscores in Go names; func testRelationshipWithinSingleType_Setup should be testRelationshipWithinSingleTypeSetup (golint)
    • interface.go
    • Line 47: warning: comment on exported type ISession should be of the form "ISession ..." (with optional leading article) (golint)
    • testing_/test_obj.go
    • Line 20: warning: don't use an underscore in package name (golint)
    • Line 24: warning: exported type ExampleObject should have comment or be unexported (golint)
    • testing_/test_obj2.go
    • Line 20: warning: don't use an underscore in package name (golint)
    • Line 24: warning: exported type ExampleObject2 should have comment or be unexported (golint)
    • cmd/gogmcli/gen/gen.go
    • Line 20: warning: package comment should be of the form "Package gen ..." (golint)
    • Line 276: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 288: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 300: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 312: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gogm.go
    • Line 48: warning: exported type Gogm should have comment or be unexported (golint)
    • Line 62: warning: exported function New should have comment or be unexported (golint)
    • Line 66: warning: exported function NewContext should have comment or be unexported (golint)
    • Line 319: warning: exported method Gogm.Copy should have comment or be unexported (golint)
    • Line 331: warning: exported method Gogm.Close should have comment or be unexported (golint)
    • Line 339: warning: exported method Gogm.NewSession should have comment or be unexported (golint)
    • Line 347: warning: exported method Gogm.NewSessionV2 should have comment or be unexported (golint)
    • examples/movies/api/mux.go
    • Line 13: warning: exported function GetMux should have comment or be unexported (golint)
    • Line 21: warning: comment on exported function ActorHandler should be of the form "ActorHandler ..." (golint)
    • Line 59: warning: comment on exported function GetMovieHandler should be of the form "GetMovieHandler ..." (golint)
    • config.go
    • Line 128: warning: comment on exported type IndexStrategy should be of the form "IndexStrategy ..." (with optional leading article) (golint)
    • model.go
    • Line 35: warning: exported type BaseUUIDNode should have comment or be unexported (golint)
    • Line 41: warning: comment on exported type RelationType should be of the form "RelationType ..." (with optional leading article) (golint)
    • Line 45: warning: comment on exported const Single should be of the form "Single ..." (golint)
    • Line 48: warning: comment on exported const Multi should be of the form "Multi ..." (golint)
    • save.go
    • Line 386: 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)
    • pagination.go
    • Line 24: warning: comment on exported type Pagination should be of the form "Pagination ..." (with optional leading article) (golint)
    • Line 38: warning: exported method Pagination.Validate should have comment or be unexported (golint)
    • sessionv2.go
    • Line 36: warning: exported type SessionV2Impl should have comment or be unexported (golint)
    • Line 72: warning: exported method SessionV2Impl.Begin should have comment or be unexported (golint)
    • Line 98: warning: exported method SessionV2Impl.Rollback should have comment or be unexported (golint)
    • Line 129: warning: exported method SessionV2Impl.RollbackWithError should have comment or be unexported (golint)
    • Line 146: warning: exported method SessionV2Impl.Commit should have comment or be unexported (golint)
    • Line 177: warning: exported method SessionV2Impl.Load should have comment or be unexported (golint)
    • Line 189: warning: exported method SessionV2Impl.LoadDepth should have comment or be unexported (golint)
    • Line 201: warning: exported method SessionV2Impl.LoadDepthFilter should have comment or be unexported (golint)
    • Line 213: warning: exported method SessionV2Impl.LoadDepthFilterPagination should have comment or be unexported (golint)
    • Line 293: warning: exported method SessionV2Impl.LoadAll should have comment or be unexported (golint)
    • Line 304: warning: exported method SessionV2Impl.LoadAllDepth should have comment or be unexported (golint)
    • Line 315: warning: exported method SessionV2Impl.LoadAllDepthFilter should have comment or be unexported (golint)
    • Line 326: warning: exported method SessionV2Impl.LoadAllDepthFilterPagination should have comment or be unexported (golint)
    • Line 452: warning: exported method SessionV2Impl.Save should have comment or be unexported (golint)
    • Line 464: warning: exported method SessionV2Impl.SaveDepth should have comment or be unexported (golint)
    • Line 480: warning: exported method SessionV2Impl.Delete should have comment or be unexported (golint)
    • Line 506: warning: exported method SessionV2Impl.DeleteUUID should have comment or be unexported (golint)
    • Line 551: warning: exported method SessionV2Impl.Query should have comment or be unexported (golint)
    • Line 582: warning: exported method SessionV2Impl.QueryRaw should have comment or be unexported (golint)
    • Line 601: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 721: warning: exported method SessionV2Impl.ManagedTransaction should have comment or be unexported (golint)
    • Line 772: warning: exported method SessionV2Impl.Close should have comment or be unexported (golint)
    • util.go
    • Line 89: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 117: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 446: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • examples/movies/domain/model.go
    • Line 9: warning: exported type Movie should have comment or be unexported (golint)
    • Line 24: warning: exported type Person should have comment or be unexported (golint)
    • Line 37: warning: exported type ActedInEdge should have comment or be unexported (golint)
    • Line 45: warning: exported method ActedInEdge.GetStartNode should have comment or be unexported (golint)
    • Line 49: warning: exported method ActedInEdge.GetStartNodeType should have comment or be unexported (golint)
    • Line 53: warning: exported method ActedInEdge.SetStartNode should have comment or be unexported (golint)
    • Line 63: warning: exported method ActedInEdge.GetEndNode should have comment or be unexported (golint)
    • Line 67: warning: exported method ActedInEdge.GetEndNodeType should have comment or be unexported (golint)
    • Line 71: warning: exported method ActedInEdge.SetEndNode should have comment or be unexported (golint)
    • examples/example.go
    • Line 14: warning: comment on exported type VertexA should be of the form "VertexA ..." (with optional leading article) (golint)
    • Line 31: warning: exported type VertexB should have comment or be unexported (golint)
    • Line 54: warning: exported method EdgeC.GetStartNode should have comment or be unexported (golint)
    • Line 58: warning: exported method EdgeC.GetStartNodeType should have comment or be unexported (golint)
    • Line 62: warning: exported method EdgeC.SetStartNode should have comment or be unexported (golint)
    • Line 72: warning: exported method EdgeC.GetEndNode should have comment or be unexported (golint)
    • Line 76: warning: exported method EdgeC.GetEndNodeType should have comment or be unexported (golint)
    • Line 80: warning: exported method EdgeC.SetEndNode should have comment or be unexported (golint)
    • session.go
    • Line 33: warning: exported const AccessModeRead should have comment or be unexported (golint)
    • Line 34: warning: exported const AccessModeWrite should have comment or be unexported (golint)
    • Line 36: warning: exported type SessionConfig should have comment or be unexported (golint)
    • Line 38: warning: comment on exported type Session should be of the form "Session ..." (with optional leading article) (golint)
    • Line 47: warning: comment on exported function NewSession should be of the form "NewSession ..." (golint)
    • Line 88: warning: comment on exported function NewSessionWithConfig should be of the form "NewSessionWithConfig ..." (golint)
    • Line 120: warning: exported method Session.Begin should have comment or be unexported (golint)
    • Line 139: warning: exported method Session.Rollback should have comment or be unexported (golint)
    • Line 157: warning: exported method Session.RollbackWithError should have comment or be unexported (golint)
    • Line 166: warning: exported method Session.Commit should have comment or be unexported (golint)
    • Line 184: warning: exported method Session.Load should have comment or be unexported (golint)
    • Line 188: warning: exported method Session.LoadDepth should have comment or be unexported (golint)
    • Line 192: warning: exported method Session.LoadDepthFilter should have comment or be unexported (golint)
    • Line 196: warning: exported method Session.LoadDepthFilterPagination should have comment or be unexported (golint)
    • Line 266: warning: exported method Session.LoadAll should have comment or be unexported (golint)
    • Line 270: warning: exported method Session.LoadAllDepth should have comment or be unexported (golint)
    • Line 274: warning: exported method Session.LoadAllDepthFilter should have comment or be unexported (golint)
    • Line 278: warning: exported method Session.LoadAllDepthFilterPagination should have comment or be unexported (golint)
    • Line 352: warning: exported method Session.LoadAllEdgeConstraint should have comment or be unexported (golint)
    • Line 427: warning: exported method Session.Save should have comment or be unexported (golint)
    • Line 431: warning: exported method Session.SaveDepth should have comment or be unexported (golint)
    • Line 440: warning: exported method Session.Delete should have comment or be unexported (golint)
    • Line 458: warning: exported method Session.DeleteUUID should have comment or be unexported (golint)
    • Line 486: warning: exported method Session.Query should have comment or be unexported (golint)
    • Line 505: warning: exported method Session.QueryRaw should have comment or be unexported (golint)
    • Line 517: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 579: warning: exported method Session.PurgeDatabase should have comment or be unexported (golint)
    • Line 595: warning: exported method Session.Close should have comment or be unexported (golint)
    • decoder.go
    • Line 334: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.

    • sessionv2.go
    • Line 75: warning: ineffectual assignment to ctx (ineffassign)
    • Line 101: warning: ineffectual assignment to ctx (ineffassign)
    • Line 149: warning: ineffectual assignment to ctx (ineffassign)
    • Line 75: warning: ineffectual assignment to ctx (ineffassign)
    • Line 101: warning: ineffectual assignment to ctx (ineffassign)
    • Line 149: warning: ineffectual assignment to ctx (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!