Preparing report...

Report for github.com/ory/keto

A+    Excellent!    Found 43 issues across 90 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!


gocyclo98%

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.


golint52%

Golint is a linter for Go source code.

    • keto/internal/expand/tree.go
    • Line 15: warning: comment on exported type NodeType should be of the form "NodeType ..." (with optional leading article) (golint)
    • Line 19: warning: exported const Union should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: comment on exported type Tree should be of the form "Tree ..." (with optional leading article) (golint)
    • Line 35: warning: exported var ErrUnknownNodeType should have comment or be unexported (golint)
    • Line 42: warning: exported method NodeType.UnmarshalJSON should have comment or be unexported (golint)
    • Line 58: warning: exported method NodeType.ToProto should have comment or be unexported (golint)
    • Line 72: warning: exported function NodeTypeFromProto should have comment or be unexported (golint)
    • Line 86: warning: exported method Tree.UnmarshalJSON should have comment or be unexported (golint)
    • Line 110: warning: comment on exported method Tree.ToProto should be of the form "ToProto ..." (golint)
    • Line 135: warning: comment on exported function TreeFromProto should be of the form "TreeFromProto ..." (golint)
    • keto/cmd/namespace/root.go
    • Line 11: warning: exported function NewNamespaceCmd should have comment or be unexported (golint)
    • Line 18: warning: exported function NewMigrateCmd should have comment or be unexported (golint)
    • Line 25: warning: exported function RegisterCommandsRecursive should have comment or be unexported (golint)
    • keto/internal/driver/registry_default.go
    • Line 48: warning: exported type RegistryDefault should have comment or be unexported (golint)
    • Line 62: warning: exported type Handler should have comment or be unexported (golint)
    • Line 70: warning: exported method RegistryDefault.BuildVersion should have comment or be unexported (golint)
    • Line 74: warning: exported method RegistryDefault.BuildDate should have comment or be unexported (golint)
    • Line 78: warning: exported method RegistryDefault.BuildHash should have comment or be unexported (golint)
    • Line 82: warning: exported method RegistryDefault.Config should have comment or be unexported (golint)
    • Line 86: warning: exported method RegistryDefault.HealthHandler should have comment or be unexported (golint)
    • Line 94: warning: exported method RegistryDefault.HealthServer should have comment or be unexported (golint)
    • Line 102: warning: exported method RegistryDefault.GetVersion should have comment or be unexported (golint)
    • Line 106: warning: exported method RegistryDefault.Tracer should have comment or be unexported (golint)
    • Line 119: warning: exported method RegistryDefault.Logger should have comment or be unexported (golint)
    • Line 126: warning: exported method RegistryDefault.Writer should have comment or be unexported (golint)
    • Line 133: warning: exported method RegistryDefault.RelationTupleManager should have comment or be unexported (golint)
    • Line 137: warning: exported method RegistryDefault.NamespaceMigrator should have comment or be unexported (golint)
    • Line 141: warning: exported method RegistryDefault.PermissionEngine should have comment or be unexported (golint)
    • Line 148: warning: exported method RegistryDefault.ExpandEngine should have comment or be unexported (golint)
    • Line 155: warning: exported method RegistryDefault.Persister should have comment or be unexported (golint)
    • Line 159: warning: exported method RegistryDefault.Migrator should have comment or be unexported (golint)
    • Line 163: warning: exported method RegistryDefault.Init should have comment or be unexported (golint)
    • Line 224: warning: exported method RegistryDefault.ReadRouter should have comment or be unexported (golint)
    • Line 248: warning: exported method RegistryDefault.WriteRouter should have comment or be unexported (golint)
    • Line 298: warning: exported method RegistryDefault.ReadGRPCServer should have comment or be unexported (golint)
    • Line 315: warning: exported method RegistryDefault.WriteGRPCServer should have comment or be unexported (golint)
    • keto/internal/relationtuple/handler.go
    • Line 22: warning: comment on exported type GetResponse should be of the form "GetResponse ..." (with optional leading article) (golint)
    • Line 32: warning: exported const RouteBase should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported function NewHandler should have comment or be unexported (golint)
    • keto/internal/check/handler.go
    • Line 28: warning: exported type Handler should have comment or be unexported (golint)
    • Line 35: warning: exported function NewHandler should have comment or be unexported (golint)
    • Line 39: warning: exported const RouteBase should have comment or be unexported (golint)
    • Line 41: warning: exported method Handler.RegisterReadRoutes should have comment or be unexported (golint)
    • Line 46: warning: exported method Handler.RegisterWriteRoutes should have comment or be unexported (golint)
    • Line 48: warning: exported method Handler.RegisterReadGRPC should have comment or be unexported (golint)
    • Line 52: warning: exported method Handler.RegisterWriteGRPC should have comment or be unexported (golint)
    • Line 54: warning: comment on exported type RESTResponse should be of the form "RESTResponse ..." (with optional leading article) (golint)
    • Line 150: warning: exported method Handler.Check should have comment or be unexported (golint)
    • keto/cmd/client/test_helpers.go
    • Line 18: warning: exported type TestServer should have comment or be unexported (golint)
    • Line 28: warning: exported type ServerType should have comment or be unexported (golint)
    • Line 32: warning: exported const WriteServer should have comment (or a comment on this block) or be unexported (golint)
    • Line 36: warning: exported function NewTestServer should have comment or be unexported (golint)
    • Line 72: warning: exported method TestServer.Shutdown should have comment or be unexported (golint)
    • keto/cmd/status/root.go
    • Line 18: warning: exported const FlagBlock should have comment (or a comment on this block) or be unexported (golint)
    • Line 121: warning: exported function RegisterCommandRecursive should have comment or be unexported (golint)
    • keto/internal/driver/daemon.go
    • Line 57: warning: exported method RegistryDefault.ServeAllSQA should have comment or be unexported (golint)
    • Line 62: warning: exported method RegistryDefault.ServeAll should have comment or be unexported (golint)
    • Line 71: warning: exported method RegistryDefault.ServeRead should have comment or be unexported (golint)
    • Line 79: warning: exported method RegistryDefault.ServeWrite should have comment or be unexported (golint)
    • keto/internal/driver/config/namespace_watcher.go
    • Line 25: warning: exported type NamespaceWatcher should have comment or be unexported (golint)
    • Line 36: warning: exported function NewNamespaceWatcher should have comment or be unexported (golint)
    • Line 153: warning: exported method NamespaceWatcher.GetNamespace should have comment or be unexported (golint)
    • Line 166: warning: exported method NamespaceWatcher.Namespaces should have comment or be unexported (golint)
    • keto/internal/expand/engine.go
    • Line 12: warning: exported type EngineDependencies should have comment or be unexported (golint)
    • Line 15: warning: exported type Engine should have comment or be unexported (golint)
    • Line 18: warning: exported type EngineProvider should have comment or be unexported (golint)
    • Line 23: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 27: warning: exported method Engine.BuildTree should have comment or be unexported (golint)
    • keto/internal/persistence/sql/persister.go
    • Line 30: warning: exported type Persister should have comment or be unexported (golint)
    • Line 58: warning: exported function NewPersister should have comment or be unexported (golint)
    • Line 125: warning: exported method Persister.MigrationBox should have comment or be unexported (golint)
    • keto/internal/relationtuple/definitions.go
    • Line 25: warning: exported type ManagerProvider should have comment or be unexported (golint)
    • Line 28: warning: exported type Manager should have comment or be unexported (golint)
    • Line 35: warning: exported type RelationCollection should have comment or be unexported (golint)
    • Line 39: warning: exported type SubjectID should have comment or be unexported (golint)
    • Line 44: warning: exported type RelationQuery should have comment or be unexported (golint)
    • Line 52: warning: comment on exported type TupleData should be of the form "TupleData ..." (with optional leading article) (golint)
    • Line 61: warning: comment on exported type Subject should be of the form "Subject ..." (with optional leading article) (golint)
    • Line 77: warning: comment on exported type InternalRelationTuple should be of the form "InternalRelationTuple ..." (with optional leading article) (golint)
    • Line 110: warning: comment on exported type SubjectSet should be of the form "SubjectSet ..." (with optional leading article) (golint)
    • Line 134: warning: exported var ErrMalformedInput should have comment or be unexported (golint)
    • Line 142: warning: exported const ActionInsert should have comment (or a comment on this block) or be unexported (golint)
    • Line 155: warning: exported type PatchDelta should have comment or be unexported (golint)
    • Line 160: warning: exported function SubjectFromString should have comment or be unexported (golint)
    • Line 167: warning: comment on exported function SubjectFromProto should be of the form "SubjectFromProto ..." (golint)
    • Line 194: warning: exported method SubjectID.FromString should have comment or be unexported (golint)
    • Line 199: warning: exported method SubjectSet.FromString should have comment or be unexported (golint)
    • Line 217: warning: exported method SubjectSet.FromURLQuery should have comment or be unexported (golint)
    • Line 229: warning: exported method SubjectSet.ToURLQuery should have comment or be unexported (golint)
    • Line 237: warning: comment on exported method SubjectID.ToProto should be of the form "ToProto ..." (golint)
    • Line 246: warning: comment on exported method SubjectSet.ToProto should be of the form "ToProto ..." (golint)
    • Line 259: warning: exported method SubjectID.Equals should have comment or be unexported (golint)
    • Line 267: warning: exported method SubjectSet.Equals should have comment or be unexported (golint)
    • Line 275: warning: exported method SubjectID.MarshalJSON should have comment or be unexported (golint)
    • Line 279: warning: exported method SubjectSet.MarshalJSON should have comment or be unexported (golint)
    • Line 287: warning: exported method InternalRelationTuple.FromString should have comment or be unexported (golint)
    • Line 318: warning: exported method InternalRelationTuple.DeriveSubject should have comment or be unexported (golint)
    • Line 326: warning: exported method InternalRelationTuple.UnmarshalJSON should have comment or be unexported (golint)
    • Line 342: warning: exported method InternalRelationTuple.MarshalJSON should have comment or be unexported (golint)
    • Line 353: warning: exported method InternalRelationTuple.FromDataProvider should have comment or be unexported (golint)
    • Line 367: warning: exported method InternalRelationTuple.ToProto should have comment or be unexported (golint)
    • Line 376: warning: exported method InternalRelationTuple.FromURLQuery should have comment or be unexported (golint)
    • Line 392: warning: exported method InternalRelationTuple.ToURLQuery should have comment or be unexported (golint)
    • Line 404: warning: exported method InternalRelationTuple.ToLoggerFields should have comment or be unexported (golint)
    • Line 413: warning: exported method RelationQuery.FromProto should have comment or be unexported (golint)
    • Line 423: warning: exported method RelationQuery.FromURLQuery should have comment or be unexported (golint)
    • Line 443: warning: exported method RelationQuery.ToURLQuery should have comment or be unexported (golint)
    • Line 466: warning: exported method InternalRelationTuple.Header should have comment or be unexported (golint)
    • Line 475: warning: exported method InternalRelationTuple.Columns should have comment or be unexported (golint)
    • Line 484: warning: exported method InternalRelationTuple.Interface should have comment or be unexported (golint)
    • Line 488: warning: exported function NewProtoRelationCollection should have comment or be unexported (golint)
    • Line 494: warning: exported function NewRelationCollection should have comment or be unexported (golint)
    • Line 500: warning: exported method RelationCollection.Header should have comment or be unexported (golint)
    • Line 509: warning: exported method RelationCollection.Table should have comment or be unexported (golint)
    • Line 523: warning: exported method RelationCollection.ToInternal should have comment or be unexported (golint)
    • Line 537: warning: exported method RelationCollection.Interface should have comment or be unexported (golint)
    • Line 545: warning: exported method RelationCollection.MarshalJSON should have comment or be unexported (golint)
    • Line 553: warning: exported method RelationCollection.UnmarshalJSON should have comment or be unexported (golint)
    • Line 557: warning: exported method RelationCollection.Len should have comment or be unexported (golint)
    • Line 564: warning: exported method RelationCollection.IDs should have comment or be unexported (golint)
    • Line 577: warning: exported type ManagerWrapper should have comment or be unexported (golint)
    • Line 588: warning: exported function NewManagerWrapper should have comment or be unexported (golint)
    • Line 595: warning: exported method ManagerWrapper.GetRelationTuples should have comment or be unexported (golint)
    • Line 601: warning: exported method ManagerWrapper.WriteRelationTuples should have comment or be unexported (golint)
    • Line 605: warning: exported method ManagerWrapper.DeleteRelationTuples should have comment or be unexported (golint)
    • Line 609: warning: exported method ManagerWrapper.TransactRelationTuples should have comment or be unexported (golint)
    • Line 613: warning: exported method ManagerWrapper.RelationTupleManager should have comment or be unexported (golint)
    • keto/cmd/migrate/up.go
    • Line 21: warning: exported const FlagYes should have comment (or a comment on this block) or be unexported (golint)
    • Line 92: warning: exported function RegisterYesFlag should have comment or be unexported (golint)
    • Line 96: warning: exported function BoxUp should have comment or be unexported (golint)
    • keto/internal/x/dsn_testutils.go
    • Line 16: warning: exported type DsnT should have comment or be unexported (golint)
    • Line 21: warning: exported function GetDSNs should have comment or be unexported (golint)
    • Line 65: warning: exported function ConfigFile should have comment or be unexported (golint)
    • keto/internal/x/pagination.go
    • Line 4: warning: exported type PaginationOptions should have comment or be unexported (golint)
    • Line 8: warning: exported type PaginationOptionSetter should have comment or be unexported (golint)
    • Line 11: warning: exported function WithToken should have comment or be unexported (golint)
    • Line 18: warning: exported function WithSize should have comment or be unexported (golint)
    • Line 25: warning: exported function GetPaginationOptions should have comment or be unexported (golint)
    • keto/cmd/client/grpc_client.go
    • Line 19: warning: exported const FlagReadRemote should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported function GetReadConn should have comment or be unexported (golint)
    • Line 45: warning: exported function GetWriteConn should have comment or be unexported (golint)
    • Line 49: warning: exported function Conn should have comment or be unexported (golint)
    • Line 60: warning: exported function RegisterRemoteURLFlags should have comment or be unexported (golint)
    • keto/internal/persistence/sql/relationtuples.go
    • Line 101: warning: exported method Persister.DeleteRelationTuples should have comment or be unexported (golint)
    • Line 127: warning: exported method Persister.GetRelationTuples should have comment or be unexported (golint)
    • Line 181: warning: exported method Persister.WriteRelationTuples should have comment or be unexported (golint)
    • Line 192: warning: exported method Persister.TransactRelationTuples should have comment or be unexported (golint)
    • keto/cmd/expand/root.go
    • Line 16: warning: exported const FlagMaxDepth should have comment or be unexported (golint)
    • Line 18: warning: exported function NewExpandCmd should have comment or be unexported (golint)
    • Line 76: warning: exported function RegisterCommandsRecursive should have comment or be unexported (golint)
    • keto/internal/check/engine.go
    • Line 14: warning: exported type EngineProvider should have comment or be unexported (golint)
    • Line 17: warning: exported type Engine should have comment or be unexported (golint)
    • Line 20: warning: exported type EngineDependencies should have comment or be unexported (golint)
    • Line 25: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 86: warning: exported method Engine.SubjectIsAllowed should have comment or be unexported (golint)
    • keto/internal/x/registry.go
    • Line 8: warning: exported type LoggerProvider should have comment or be unexported (golint)
    • Line 12: warning: exported type WriterProvider should have comment or be unexported (golint)
    • keto/internal/x/router.go
    • Line 8: warning: exported type ReadRouter should have comment or be unexported (golint)
    • Line 11: warning: exported type WriteRouter should have comment or be unexported (golint)
    • keto/internal/persistence/definitions.go
    • Line 15: warning: exported type Persister should have comment or be unexported (golint)
    • Line 19: warning: exported type Migrator should have comment or be unexported (golint)
    • Line 22: warning: exported type MigratorProvider should have comment or be unexported (golint)
    • Line 25: warning: exported type Provider should have comment or be unexported (golint)
    • Line 31: warning: exported var ErrNamespaceUnknown should have comment or be unexported (golint)
    • keto/internal/namespace/definitons.go
    • Line 11: warning: exported type Namespace should have comment or be unexported (golint)
    • Line 16: warning: exported type Migrator should have comment or be unexported (golint)
    • Line 19: warning: exported type Manager should have comment or be unexported (golint)
    • Line 23: warning: exported type ManagerProvider should have comment or be unexported (golint)
    • Line 26: warning: exported type MigratorProvider should have comment or be unexported (golint)
    • keto/cmd/root.go
    • Line 44: warning: comment on exported function NewRootCmd should be of the form "NewRootCmd ..." (golint)
    • keto/internal/driver/config/provider.go
    • Line 5: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 14: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 24: warning: comment on exported var Schema should be of the form "Schema ..." (golint)
    • Line 28: warning: exported const KeyDSN should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type Provider should have comment or be unexported (golint)
    • Line 52: warning: exported function New should have comment or be unexported (golint)
    • Line 80: warning: exported method Provider.Source should have comment or be unexported (golint)
    • Line 98: warning: exported method Provider.Set should have comment or be unexported (golint)
    • Line 109: warning: exported method Provider.ReadAPIListenOn should have comment or be unexported (golint)
    • Line 117: warning: exported method Provider.WriteAPIListenOn should have comment or be unexported (golint)
    • Line 125: warning: exported method Provider.CORS should have comment or be unexported (golint)
    • Line 134: warning: exported method Provider.DSN should have comment or be unexported (golint)
    • Line 142: warning: exported method Provider.TracingServiceName should have comment or be unexported (golint)
    • Line 146: warning: exported method Provider.TracingProvider should have comment or be unexported (golint)
    • Line 150: warning: exported method Provider.TracingConfig should have comment or be unexported (golint)
    • Line 154: warning: exported method Provider.NamespaceManager 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!