Preparing report...

Report for github.com/batazor/shortlink

A+    Excellent!    Found 107 issues across 204 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!


gocyclo97%

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.

    • shortlink/pkg/csi/controller.go
    • Line 71: warning: cyclomatic complexity 30 of function (*driver).CreateVolume() is high (> 15) (gocyclo)
    • Line 473: warning: cyclomatic complexity 16 of function (*driver).ListSnapshots() is high (> 15) (gocyclo)

golint48%

Golint is a linter for Go source code.

    • shortlink/internal/pkg/db/db.go
    • Line 1: warning: package comment should be of the form "Package db ..." (golint)
    • Line 27: warning: comment on exported method Store.Use should be of the form "Use ..." (golint)
    • Line 74: warning: receiver name s should be consistent with previous receiver name store for Store (golint)
    • shortlink/internal/pkg/db/rethinkdb/rethinkdb.go
    • Line 1: warning: package comment should be of the form "Package rethinkdb ..." (golint)
    • Line 25: warning: exported type Link should have comment or be unexported (golint)
    • Line 30: warning: exported method Store.Init should have comment or be unexported (golint)
    • Line 55: warning: receiver name s should be consistent with previous receiver name r for Store (golint)
    • Line 88: warning: exported method Store.Close should have comment or be unexported (golint)
    • shortlink/internal/services/link/application/application.go
    • Line 1: warning: package comment should be of the form "Package link_application ..." (golint)
    • Line 4: warning: don't use an underscore in package name (golint)
    • Line 22: warning: exported type Service should have comment or be unexported (golint)
    • Line 32: warning: exported function New should have comment or be unexported (golint)
    • Line 54: warning: exported method Service.AddLink should have comment or be unexported (golint)
    • Line 121: warning: exported method Service.GetLink should have comment or be unexported (golint)
    • Line 162: warning: exported method Service.ListLink should have comment or be unexported (golint)
    • Line 209: warning: exported method Service.UpdateLink should have comment or be unexported (golint)
    • Line 213: warning: exported method Service.DeleteLink should have comment or be unexported (golint)
    • shortlink/pkg/saga/dag/dag.go
    • Line 10: warning: exported type Dag should have comment or be unexported (golint)
    • Line 37: warning: exported method Dag.AddEdge should have comment or be unexported (golint)
    • Line 59: warning: exported method Dag.GetVertex should have comment or be unexported (golint)
    • shortlink/internal/pkg/db/ram/ram.go
    • Line 30: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 35: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 40: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • shortlink/internal/pkg/db/mysql/mysql.go
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 11: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 13: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • shortlink/internal/pkg/mq/nats/nats.go
    • Line 11: warning: exported type Config should have comment or be unexported (golint)
    • Line 13: warning: exported type NATS should have comment or be unexported (golint)
    • Line 18: warning: exported method NATS.Init should have comment or be unexported (golint)
    • Line 27: warning: exported method NATS.Close should have comment or be unexported (golint)
    • Line 32: warning: exported method NATS.Publish should have comment or be unexported (golint)
    • Line 37: warning: exported method NATS.Subscribe should have comment or be unexported (golint)
    • Line 61: warning: exported method NATS.UnSubscribe should have comment or be unexported (golint)
    • shortlink/internal/di/internal/config/config.go
    • Line 1: warning: package comment should be of the form "Package config ..." (golint)
    • Line 12: warning: exported type Config should have comment or be unexported (golint)
    • Line 14: warning: comment on exported function New should be of the form "New ..." (golint)
    • Line 27: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • shortlink/internal/services/metadata/infrastructure/rpc/rpc.go
    • Line 3: warning: package comment should be of the form "Package metadata_rpc ..." (golint)
    • Line 6: warning: don't use an underscore in package name (golint)
    • Line 16: warning: exported type Metadata should have comment or be unexported (golint)
    • Line 23: warning: exported function New should have comment or be unexported (golint)
    • Line 36: warning: exported method Metadata.Get should have comment or be unexported (golint)
    • Line 47: warning: exported method Metadata.Set should have comment or be unexported (golint)
    • shortlink/pkg/csi/node.go
    • Line 13: warning: don't use an underscore in package name (golint)
    • Line 31: warning: exported const TopologyKeyNode should have comment or be unexported (golint)
    • Line 33: warning: exported function NewNodeServer should have comment or be unexported (golint)
    • shortlink/internal/pkg/batch/type.go
    • Line 8: warning: comment on exported type Config should be of the form "Config ..." (with optional leading article) (golint)
    • Line 21: warning: comment on exported type Item should be of the form "Item ..." (with optional leading article) (golint)
    • shortlink/internal/services/link/infrastructure/store/mongo/mongo.go
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 66: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 94: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 116: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 165: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 170: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 184: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 215: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • shortlink/pkg/saga/type.go
    • Line 7: warning: exported type StepState should have comment or be unexported (golint)
    • Line 21: warning: exported type Options should have comment or be unexported (golint)
    • Line 25: warning: exported type Option should have comment or be unexported (golint)
    • Line 27: warning: exported function Logger should have comment or be unexported (golint)
    • shortlink/pkg/saga/dag/vertex.go
    • Line 11: warning: exported method Vertex.GetId should have comment or be unexported (golint)
    • Line 15: warning: exported method Vertex.Parents should have comment or be unexported (golint)
    • Line 19: warning: exported method Vertex.Children should have comment or be unexported (golint)
    • shortlink/internal/pkg/notify/notify.go
    • Line 1: warning: package comment should be of the form "Package notify ..." (golint)
    • Line 19: warning: exported function NewEventID should have comment or be unexported (golint)
    • Line 24: warning: exported function Subscribe should have comment or be unexported (golint)
    • Line 30: warning: exported function UnSubscribe should have comment or be unexported (golint)
    • Line 73: warning: exported function Clean should have comment or be unexported (golint)
    • shortlink/internal/pkg/tool/search.go
    • Line 3: warning: comment on exported function Contains should be of the form "Contains ..." (golint)
    • Line 14: warning: comment on exported function Find should be of the form "Find ..." (golint)
    • Line 26: warning: comment on exported function Unique should be of the form "Unique ..." (golint)
    • shortlink/cmd/cli/internal/tool/tool.go
    • Line 19: warning: exported function TrimQuotes should have comment or be unexported (golint)
    • Line 28: warning: exported function GetDirectories should have comment or be unexported (golint)
    • Line 55: warning: exported function SaveToFile should have comment or be unexported (golint)
    • shortlink/internal/pkg/notify/type.go
    • Line 8: warning: exported type Publisher should have comment or be unexported (golint)
    • Line 13: warning: exported type Subscriber should have comment or be unexported (golint)
    • Line 17: warning: exported type Notify should have comment or be unexported (golint)
    • Line 22: warning: exported type Response should have comment or be unexported (golint)
    • Line 28: warning: exported type Callback should have comment or be unexported (golint)
    • shortlink/pkg/saga/step.go
    • Line 12: warning: exported type Step should have comment or be unexported (golint)
    • Line 24: warning: exported method Step.Run should have comment or be unexported (golint)
    • Line 41: warning: exported method Step.Reject should have comment or be unexported (golint)
    • shortlink/internal/services/link/infrastructure/store/redis/redis.go
    • Line 27: warning: receiver name r should be consistent with previous receiver name s for Store (golint)
    • Line 43: warning: receiver name r should be consistent with previous receiver name s for Store (golint)
    • Line 67: warning: receiver name r should be consistent with previous receiver name s for Store (golint)
    • Line 86: warning: receiver name r should be consistent with previous receiver name s for Store (golint)
    • Line 91: warning: receiver name r should be consistent with previous receiver name s for Store (golint)
    • shortlink/internal/services/link/infrastructure/store/leveldb/leveldb.go
    • Line 27: warning: receiver name l should be consistent with previous receiver name s for Store (golint)
    • Line 47: warning: receiver name l should be consistent with previous receiver name s for Store (golint)
    • Line 68: warning: receiver name l should be consistent with previous receiver name s for Store (golint)
    • Line 99: warning: receiver name l should be consistent with previous receiver name s for Store (golint)
    • Line 104: warning: receiver name l should be consistent with previous receiver name s for Store (golint)
    • shortlink/internal/services/link/infrastructure/store/rethinkdb/rethinkdb.go
    • Line 1: warning: package comment should be of the form "Package rethinkdb ..." (golint)
    • Line 20: warning: exported type Link should have comment or be unexported (golint)
    • Line 31: warning: exported method Store.Get should have comment or be unexported (golint)
    • Line 31: warning: receiver name r should be consistent with previous receiver name s for Store (golint)
    • Line 51: warning: comment on exported method Store.List should be of the form "List ..." (golint)
    • Line 52: warning: receiver name r should be consistent with previous receiver name s for Store (golint)
    • Line 58: warning: exported method Store.Add should have comment or be unexported (golint)
    • Line 58: warning: receiver name r should be consistent with previous receiver name s for Store (golint)
    • Line 77: warning: exported method Store.Update should have comment or be unexported (golint)
    • Line 81: warning: exported method Store.Delete should have comment or be unexported (golint)
    • Line 81: warning: receiver name r should be consistent with previous receiver name s for Store (golint)
    • shortlink/internal/services/link/infrastructure/store/ram/ram.go
    • Line 69: warning: receiver name ram should be consistent with previous receiver name s for Store (golint)
    • Line 84: warning: receiver name ram should be consistent with previous receiver name s for Store (golint)
    • Line 106: warning: receiver name ram should be consistent with previous receiver name s for Store (golint)
    • Line 132: warning: receiver name ram should be consistent with previous receiver name s for Store (golint)
    • Line 137: warning: receiver name ram should be consistent with previous receiver name s for Store (golint)
    • Line 142: warning: receiver name ram should be consistent with previous receiver name s for Store (golint)
    • shortlink/internal/services/link/infrastructure/store/sqlite/sqlite.go
    • Line 29: warning: receiver name lite should be consistent with previous receiver name s for Store (golint)
    • Line 55: warning: receiver name lite should be consistent with previous receiver name s for Store (golint)
    • Line 88: warning: receiver name lite should be consistent with previous receiver name s for Store (golint)
    • Line 113: warning: receiver name lite should be consistent with previous receiver name s for Store (golint)
    • Line 118: warning: receiver name lite should be consistent with previous receiver name s for Store (golint)
    • shortlink/pkg/rpc/client.go
    • Line 26: warning: don't use underscores in Go names; var grpc_port should be grpcPort (golint)
    • Line 29: warning: don't use underscores in Go names; var grpc_host should be grpcHost (golint)
    • shortlink/internal/pkg/db/dgraph/dgraph.go
    • Line 69: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • Line 74: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • Line 105: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • shortlink/pkg/saga/saga.go
    • Line 13: warning: exported type Saga should have comment or be unexported (golint)
    • Line 28: warning: exported method Saga.AddStep should have comment or be unexported (golint)
    • Line 60: warning: exported method Saga.Play should have comment or be unexported (golint)
    • Line 160: warning: exported method Saga.Reject should have comment or be unexported (golint)
    • shortlink/internal/services/link/infrastructure/store/mysql/mysql.go
    • Line 8: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 23: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 49: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 85: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 110: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • Line 115: warning: receiver name m should be consistent with previous receiver name s for Store (golint)
    • shortlink/internal/pkg/mq/rabbit/rabbitmq.go
    • Line 16: warning: exported type RabbitMQ should have comment or be unexported (golint)
    • Line 25: warning: exported method RabbitMQ.Init should have comment or be unexported (golint)
    • Line 46: warning: exported method RabbitMQ.Publish should have comment or be unexported (golint)
    • Line 90: warning: exported method RabbitMQ.Subscribe should have comment or be unexported (golint)
    • Line 165: warning: exported method RabbitMQ.UnSubscribe should have comment or be unexported (golint)
    • Line 169: warning: exported method RabbitMQ.Close should have comment or be unexported (golint)
    • shortlink/internal/pkg/batch/batch.go
    • Line 1: warning: package comment should be of the form "Package batch ..." (golint)
    • Line 11: warning: comment on exported function New should be of the form "New ..." (golint)
    • Line 22: warning: exported method Config.Push should have comment or be unexported (golint)
    • Line 33: warning: comment on exported method Config.Run should be of the form "Run ..." (golint)
    • Line 65: warning: exported function NewItem should have comment or be unexported (golint)
    • shortlink/internal/pkg/mq/query/type.go
    • Line 7: warning: exported type Message should have comment or be unexported (golint)
    • Line 12: warning: exported type ResponseMessage should have comment or be unexported (golint)
    • Line 17: warning: exported type Response should have comment or be unexported (golint)
    • shortlink/pkg/saga/step_builder.go
    • Line 7: warning: exported type BuilderStep should have comment or be unexported (golint)
    • Line 13: warning: exported method BuilderStep.Then should have comment or be unexported (golint)
    • Line 18: warning: exported method BuilderStep.Reject should have comment or be unexported (golint)
    • Line 23: warning: exported method BuilderStep.Needs should have comment or be unexported (golint)
    • Line 35: warning: exported method BuilderStep.Build should have comment or be unexported (golint)
    • shortlink/internal/services/link/infrastructure/rpc/rpc.go
    • Line 7: warning: don't use an underscore in package name (golint)
    • Line 22: warning: exported type Link should have comment or be unexported (golint)
    • Line 29: warning: exported function New should have comment or be unexported (golint)
    • Line 43: warning: exported method Link.Add should have comment or be unexported (golint)
    • Line 52: warning: exported method Link.Get should have comment or be unexported (golint)
    • Line 61: warning: exported method Link.List should have comment or be unexported (golint)
    • Line 70: warning: exported method Link.Update should have comment or be unexported (golint)
    • Line 79: warning: exported method Link.Delete should have comment or be unexported (golint)
    • shortlink/pkg/rpc/server.go
    • Line 28: warning: don't use underscores in Go names; var grpc_port should be grpcPort (golint)
    • Line 31: warning: don't use underscores in Go names; var grpc_host should be grpcHost (golint)
    • shortlink/internal/pkg/mq/kafka/kafka.go
    • Line 12: warning: exported type Config should have comment or be unexported (golint)
    • Line 17: warning: exported type Kafka should have comment or be unexported (golint)
    • Line 24: warning: exported method Kafka.Init should have comment or be unexported (golint)
    • Line 47: warning: exported method Kafka.Close should have comment or be unexported (golint)
    • Line 65: warning: exported method Kafka.Publish should have comment or be unexported (golint)
    • Line 65: warning: receiver name k should be consistent with previous receiver name mq for Kafka (golint)
    • Line 79: warning: exported method Kafka.Subscribe should have comment or be unexported (golint)
    • Line 91: warning: exported method Kafka.UnSubscribe should have comment or be unexported (golint)
    • shortlink/internal/services/link/infrastructure/store/dgraph/dgraph.go
    • Line 43: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • Line 79: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • Line 101: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • Line 137: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • Line 166: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • Line 210: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • Line 215: warning: receiver name dg should be consistent with previous receiver name s for Store (golint)
    • shortlink/pkg/saga/saga_builder.go
    • Line 9: warning: exported type SagaBuilder should have comment or be unexported (golint)
    • Line 15: warning: exported function New should have comment or be unexported (golint)
    • Line 31: warning: exported method SagaBuilder.WithContext should have comment or be unexported (golint)
    • Line 36: warning: exported method SagaBuilder.Build should have comment or be unexported (golint)
    • shortlink/internal/services/metadata/application/application.go
    • Line 1: warning: package comment should be of the form "Package metadata ..." (golint)
    • Line 16: warning: exported type Service should have comment or be unexported (golint)
    • Line 20: warning: exported function New should have comment or be unexported (golint)
    • Line 26: warning: exported method Service.Get should have comment or be unexported (golint)
    • Line 35: warning: exported method Service.Set should have comment or be unexported (golint)
    • shortlink/cmd/cli/type.go
    • Line 5: warning: exported type ENV should have comment or be unexported (golint)
    • Line 16: warning: exported type Config should have comment or be unexported (golint)
    • shortlink/internal/services/link/infrastructure/store/cassandra/cassandra.go
    • Line 27: warning: receiver name c should be consistent with previous receiver name s for Store (golint)
    • Line 49: warning: receiver name c should be consistent with previous receiver name s for Store (golint)
    • Line 72: warning: receiver name c should be consistent with previous receiver name s for Store (golint)
    • Line 86: warning: receiver name c should be consistent with previous receiver name s for Store (golint)
    • Line 91: warning: receiver name c should be consistent with previous receiver name s for Store (golint)
    • shortlink/internal/services/link/infrastructure/store/postgres/postgres.go
    • Line 1: warning: package comment should be of the form "Package postgres ..." (golint)
    • Line 12: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 73: warning: receiver name p should be consistent with previous receiver name s for Store (golint)
    • Line 108: warning: receiver name p should be consistent with previous receiver name s for Store (golint)
    • Line 130: warning: don't use underscores in Go names; var created_ad should be createdAd (golint)
    • Line 131: warning: don't use underscores in Go names; var updated_at should be updatedAt (golint)
    • Line 147: warning: receiver name p should be consistent with previous receiver name s for Store (golint)
    • Line 173: warning: receiver name p should be consistent with previous receiver name s for Store (golint)
    • Line 178: warning: receiver name p should be consistent with previous receiver name s for Store (golint)
    • Line 195: warning: receiver name p should be consistent with previous receiver name s for Store (golint)
    • Line 230: warning: receiver name p should be consistent with previous receiver name s for Store (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!