ucpr/mongo-streamer

View on GitHub

Showing 3 of 6 total issues

Method App.Run has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
Open

func (a *App) Run(ctx context.Context) error {
col := a.mcli.Collection("tweets")
for {
select {
case <-ctx.Done():
Severity: Minor
Found in hack/tester/main.go - About 2 hrs to fix

Method App.Run has 56 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (a *App) Run(ctx context.Context) error {
col := a.mcli.Collection("tweets")
for {
select {
case <-ctx.Done():
Severity: Minor
Found in hack/tester/main.go - About 1 hr to fix

    Function NewChangeStream has 5 return statements (exceeds 4 allowed).
    Confirmed

    func NewChangeStream(ctx context.Context, params ChangeStreamParams, opts ...ChangeStreamOption) (*ChangeStream, error) {
    chopts := &options.ChangeStreamOptions{}
    for _, opt := range opts {
    opt(&ChangeStreamOptions{chopts})
    }
    Severity: Major
    Found in internal/mongo/change_stream.go - About 35 mins to fix
      Severity
      Category
      Status
      Source
      Language