Preparing report...

Report for github.com/moira-alert/moira

A+    Excellent!    Found 61 issues across 363 files

Tweet

gofmt94%

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


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!


golint89%

Golint is a linter for Go source code.

    • moira/api/dto/subscription.go
    • Line 1: warning: package comment should be of the form "Package dto ..." (golint)
    • Line 45: warning: exported type SubscriptionList should have comment or be unexported (golint)
    • Line 49: warning: exported method SubscriptionList.Render should have comment or be unexported (golint)
    • Line 53: warning: exported type Subscription should have comment or be unexported (golint)
    • Line 55: warning: exported method Subscription.Render should have comment or be unexported (golint)
    • Line 59: warning: exported method Subscription.Bind should have comment or be unexported (golint)
    • moira/api/dto/triggers.go
    • Line 1: warning: package comment should be of the form "Package dto ..." (golint)
    • Line 25: warning: exported type TriggersList should have comment or be unexported (golint)
    • Line 33: warning: exported method TriggersList.Render should have comment or be unexported (golint)
    • Line 37: warning: exported type Trigger should have comment or be unexported (golint)
    • Line 122: warning: exported method Trigger.Bind should have comment or be unexported (golint)
    • Line 319: warning: exported method Trigger.Render should have comment or be unexported (golint)
    • Line 323: warning: exported method Trigger.PopulatedDescription should have comment or be unexported (golint)
    • Line 339: warning: exported type TriggerCheckResponse should have comment or be unexported (golint)
    • Line 344: warning: exported type TriggerCheck should have comment or be unexported (golint)
    • Line 349: warning: exported method TriggerCheck.Render should have comment or be unexported (golint)
    • Line 353: warning: exported type MetricsMaintenance should have comment or be unexported (golint)
    • Line 355: warning: exported method MetricsMaintenance.Bind should have comment or be unexported (golint)
    • Line 359: warning: exported type TriggerMaintenance should have comment or be unexported (golint)
    • Line 364: warning: exported method TriggerMaintenance.Bind should have comment or be unexported (golint)
    • Line 368: warning: exported type ThrottlingResponse should have comment or be unexported (golint)
    • Line 372: warning: exported method ThrottlingResponse.Render should have comment or be unexported (golint)
    • Line 376: warning: exported type SaveTriggerResponse should have comment or be unexported (golint)
    • Line 381: warning: exported method SaveTriggerResponse.Render should have comment or be unexported (golint)
    • Line 385: warning: exported type TriggerMetrics should have comment or be unexported (golint)
    • Line 387: warning: exported method TriggerMetrics.Render should have comment or be unexported (golint)
    • Line 391: warning: exported type PatternMetrics should have comment or be unexported (golint)
    • Line 397: warning: exported type TriggerDump should have comment or be unexported (golint)
    • Line 404: warning: exported type TriggersSearchResultDeleteResponse should have comment or be unexported (golint)
    • Line 408: warning: exported method TriggersSearchResultDeleteResponse.Render should have comment or be unexported (golint)
    • moira/support/trigger.go
    • Line 14: warning: exported function HandlePullTrigger should have comment or be unexported (golint)
    • Line 24: warning: exported function HandlePullTriggerMetrics should have comment or be unexported (golint)
    • Line 72: warning: exported function HandlePushTrigger should have comment or be unexported (golint)
    • Line 82: warning: exported function HandlePushTriggerMetrics should have comment or be unexported (golint)
    • Line 117: warning: exported function HandlePushTriggerLastCheck should have comment or be unexported (golint)
    • moira/metrics/graphite.go
    • Line 16: warning: exported type GraphiteRegistryConfig should have comment or be unexported (golint)
    • Line 24: warning: exported type GraphiteRegistry should have comment or be unexported (golint)
    • Line 28: warning: exported function NewGraphiteRegistry should have comment or be unexported (golint)
    • Line 48: warning: exported method GraphiteRegistry.NewTimer should have comment or be unexported (golint)
    • Line 52: warning: exported method GraphiteRegistry.NewMeter should have comment or be unexported (golint)
    • Line 56: warning: exported method GraphiteRegistry.NewCounter should have comment or be unexported (golint)
    • Line 60: warning: exported method GraphiteRegistry.NewHistogram should have comment or be unexported (golint)
    • moira/helpers.go
    • Line 195: warning: exported function RoundToNearestRetention should have comment or be unexported (golint)
    • Line 199: warning: exported function MaxInt64 should have comment or be unexported (golint)
    • moira/api/dto/tag.go
    • Line 1: warning: package comment should be of the form "Package dto ..." (golint)
    • Line 10: warning: exported type TagsData should have comment or be unexported (golint)
    • Line 14: warning: exported method TagsData.Render should have comment or be unexported (golint)
    • Line 18: warning: exported type MessageResponse should have comment or be unexported (golint)
    • Line 22: warning: exported method MessageResponse.Render should have comment or be unexported (golint)
    • Line 26: warning: exported type TagsStatistics should have comment or be unexported (golint)
    • Line 30: warning: exported type TagStatistics should have comment or be unexported (golint)
    • Line 36: warning: exported method TagsStatistics.Render should have comment or be unexported (golint)
    • moira/metrics/composite.go
    • Line 7: warning: exported type CompositeRegistry should have comment or be unexported (golint)
    • Line 11: warning: exported function NewCompositeRegistry should have comment or be unexported (golint)
    • Line 15: warning: exported method CompositeRegistry.NewMeter should have comment or be unexported (golint)
    • Line 23: warning: exported method CompositeRegistry.NewTimer should have comment or be unexported (golint)
    • Line 31: warning: exported method CompositeRegistry.NewHistogram should have comment or be unexported (golint)
    • Line 39: warning: exported method CompositeRegistry.NewCounter should have comment or be unexported (golint)
    • moira/metrics/interfaces.go
    • Line 47: warning: exported function NewMetersCollection should have comment or be unexported (golint)
    • Line 58: warning: exported method DefaultMetersCollection.RegisterMeter should have comment or be unexported (golint)
    • Line 66: warning: exported method DefaultMetersCollection.GetRegisteredMeter should have comment or be unexported (golint)
    • moira/errors.go
    • Line 9: warning: exported function NewSenderBrokenContactError should have comment or be unexported (golint)
    • moira/api/dto/events.go
    • Line 1: warning: package comment should be of the form "Package dto ..." (golint)
    • Line 10: warning: exported type EventsList should have comment or be unexported (golint)
    • Line 17: warning: exported method EventsList.Render should have comment or be unexported (golint)
    • moira/log_fields.go
    • Line 4: warning: exported const LogFieldNameCheckpoint should have comment (or a comment on this block) or be unexported (golint)
    • moira/api/dto/contact.go
    • Line 1: warning: package comment should be of the form "Package dto ..." (golint)
    • Line 11: warning: exported type ContactList should have comment or be unexported (golint)
    • Line 15: warning: exported method ContactList.Render should have comment or be unexported (golint)
    • Line 19: warning: exported type Contact should have comment or be unexported (golint)
    • Line 27: warning: exported method Contact.Render should have comment or be unexported (golint)
    • Line 31: warning: exported method Contact.Bind should have comment or be unexported (golint)
    • moira/api/dto/pattern.go
    • Line 1: warning: package comment should be of the form "Package dto ..." (golint)
    • Line 8: warning: exported type PatternList should have comment or be unexported (golint)
    • Line 12: warning: exported method PatternList.Render should have comment or be unexported (golint)
    • Line 16: warning: exported type PatternData should have comment or be unexported (golint)
    • moira/senders/msteams/datatypes.go
    • Line 3: warning: exported const Green should have comment or be unexported (golint)
    • Line 4: warning: exported const Orange should have comment or be unexported (golint)
    • Line 5: warning: exported const Red should have comment or be unexported (golint)
    • Line 6: warning: exported const Black should have comment or be unexported (golint)
    • Line 7: warning: exported const White should have comment or be unexported (golint)
    • moira/datatypes.go
    • Line 110: warning: exported method TriggerData.PopulatedDescription should have comment or be unexported (golint)
    • Line 122: warning: exported function NotificationEventsToTemplatingEvents should have comment or be unexported (golint)
    • moira/api/dto/notification.go
    • Line 1: warning: package comment should be of the form "Package dto ..." (golint)
    • Line 10: warning: exported type NotificationsList should have comment or be unexported (golint)
    • Line 15: warning: exported method NotificationsList.Render should have comment or be unexported (golint)
    • Line 19: warning: exported type NotificationDeleteResponse should have comment or be unexported (golint)
    • Line 23: warning: exported method NotificationDeleteResponse.Render should have comment or be unexported (golint)
    • moira/api/dto/user.go
    • Line 1: warning: package comment should be of the form "Package dto ..." (golint)
    • Line 10: warning: exported type UserSettings should have comment or be unexported (golint)
    • Line 16: warning: exported method UserSettings.Render should have comment or be unexported (golint)
    • Line 20: warning: exported type User should have comment or be unexported (golint)
    • Line 24: warning: exported method User.Render should have comment or be unexported (golint)
    • moira/logging/zerolog_adapter/logger.go
    • Line 14: warning: exported type Logger should have comment or be unexported (golint)
    • Line 19: warning: exported const ModuleFieldName should have comment (or a comment on this block) or be unexported (golint)
    • Line 74: warning: exported method Logger.Debug should have comment or be unexported (golint)
    • Line 82: warning: exported method Logger.Debugf should have comment or be unexported (golint)
    • Line 90: warning: exported method Logger.Info should have comment or be unexported (golint)
    • Line 98: warning: exported method Logger.Infof should have comment or be unexported (golint)
    • Line 114: warning: exported method Logger.Errorf should have comment or be unexported (golint)
    • Line 122: warning: exported method Logger.Fatal should have comment or be unexported (golint)
    • Line 130: warning: exported method Logger.Fatalf should have comment or be unexported (golint)
    • Line 138: warning: exported method Logger.Warning should have comment or be unexported (golint)
    • Line 146: warning: exported method Logger.Warningf should have comment or be unexported (golint)
    • Line 159: warning: exported method Logger.Int should have comment or be unexported (golint)
    • Line 164: warning: exported method Logger.Int64 should have comment or be unexported (golint)
    • Line 169: warning: exported method Logger.Fields should have comment or be unexported (golint)
    • Line 174: warning: exported method Logger.Level should have comment or be unexported (golint)
    • Line 183: warning: exported method Logger.Clone should have comment or be unexported (golint)
    • moira/api/dto/target.go
    • Line 111: warning: exported type TreeOfProblems should have comment or be unexported (golint)
    • Line 116: warning: exported function TargetVerification should have comment or be unexported (golint)
    • moira/api/dto/team.go
    • Line 98: warning: exported type TeamSettings should have comment or be unexported (golint)
    • Line 104: warning: exported method TeamSettings.Render should have comment or be unexported (golint)
    • moira/senders/slack/slack.go
    • Line 28: warning: comment on exported const ErrorTextChannelArchived should be of the form "ErrorTextChannelArchived ..." (golint)
    • Line 30: warning: exported const ErrorTextChannelNotFound should have comment (or a comment on this block) or be unexported (golint)
    • moira/cmd/telemetry.go
    • Line 17: warning: exported type Telemetry should have comment or be unexported (golint)
    • Line 22: warning: exported method Telemetry.Stop should have comment or be unexported (golint)
    • Line 26: warning: exported function ConfigureTelemetry should have comment or be unexported (golint)
    • moira/templating/templating.go
    • Line 18: warning: exported type Event should have comment or be unexported (golint)
    • Line 34: warning: exported method Event.TimestampDecrease should have comment or be unexported (golint)
    • Line 38: warning: exported method Event.TimestampIncrease should have comment or be unexported (golint)
    • Line 46: warning: exported function Populate should have comment or be unexported (golint)
    • moira/metrics/prometheus.go
    • Line 13: warning: exported function NewPrometheusRegistry should have comment or be unexported (golint)
    • Line 19: warning: exported type PrometheusRegistryAdapter should have comment or be unexported (golint)
    • Line 24: warning: exported function NewPrometheusRegistryAdapter should have comment or be unexported (golint)
    • Line 28: warning: exported method PrometheusRegistryAdapter.NewTimer should have comment or be unexported (golint)
    • Line 35: warning: exported method PrometheusRegistryAdapter.NewMeter should have comment or be unexported (golint)
    • Line 42: warning: exported method PrometheusRegistryAdapter.NewCounter should have comment or be unexported (golint)
    • Line 49: warning: exported method PrometheusRegistryAdapter.NewHistogram should have comment or be unexported (golint)
    • moira/api/dto/health.go
    • Line 1: warning: package comment should be of the form "Package dto ..." (golint)
    • Line 12: warning: exported const ErrorMessage should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported type NotifierState should have comment or be unexported (golint)
    • Line 20: warning: exported method NotifierState.Render should have comment or be unexported (golint)
    • Line 24: warning: exported method NotifierState.Bind should have comment or be unexported (golint)

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.

    • moira/datatypes.go
    • Line 56: warning: cyclomatic complexity 16 of function (*NotificationEvent).CreateMessage() is high (> 15) (gocyclo)
    • moira/api/dto/triggers.go
    • Line 235: warning: cyclomatic complexity 32 of function checkWarnErrorExpression() is high (> 15) (gocyclo)
    • Line 122: warning: cyclomatic complexity 17 of function (*Trigger).Bind() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!