Preparing report...

Report for github.com/mylxsw/adanos-alert

A    Great!    Found 94 issues across 132 files

Tweet

gofmt90%

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!


gocyclo95%

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.


golint33%

Golint is a linter for Go source code.

    • adanos-alert/internal/job/aggregation.go
    • Line 20: warning: exported const AggregationJobName should have comment or be unexported (golint)
    • Line 22: warning: exported type AggregationJob should have comment or be unexported (golint)
    • Line 27: warning: exported function NewAggregationJob should have comment or be unexported (golint)
    • Line 229: warning: exported function BuildEventFinger should have comment or be unexported (golint)
    • Line 248: warning: exported type MatchedRule should have comment or be unexported (golint)
    • adanos-alert/test/mock/action/http.go
    • Line 7: warning: exported type HttpAction should have comment or be unexported (golint)
    • Line 11: warning: exported method HttpAction.Validate should have comment or be unexported (golint)
    • Line 15: warning: exported function NewHttpAction should have comment or be unexported (golint)
    • Line 19: warning: exported method HttpAction.Handle should have comment or be unexported (golint)
    • adanos-alert/test/mock/repository/message.go
    • Line 13: warning: exported type MessageRepo should have comment or be unexported (golint)
    • Line 17: warning: exported method MessageRepo.FindIDs should have comment or be unexported (golint)
    • Line 21: warning: exported method MessageRepo.CountByDatetime should have comment or be unexported (golint)
    • Line 25: warning: exported method MessageRepo.AddWithContext should have comment or be unexported (golint)
    • Line 29: warning: exported function NewMessageRepo should have comment or be unexported (golint)
    • Line 33: warning: exported method MessageRepo.Add should have comment or be unexported (golint)
    • Line 41: warning: exported method MessageRepo.Get should have comment or be unexported (golint)
    • Line 51: warning: exported method MessageRepo.Find should have comment or be unexported (golint)
    • Line 55: warning: exported method MessageRepo.Paginate should have comment or be unexported (golint)
    • Line 59: warning: exported method MessageRepo.Delete should have comment or be unexported (golint)
    • Line 64: warning: exported method MessageRepo.DeleteID should have comment or be unexported (golint)
    • Line 68: warning: exported method MessageRepo.Traverse should have comment or be unexported (golint)
    • Line 78: warning: exported method MessageRepo.UpdateID should have comment or be unexported (golint)
    • Line 89: warning: exported method MessageRepo.Count should have comment or be unexported (golint)
    • adanos-alert/pkg/messager/aliyun_voice/voice.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 12: warning: exported type VoiceCall should have comment or be unexported (golint)
    • Line 16: warning: exported function NewVoiceCall should have comment or be unexported (golint)
    • Line 20: warning: exported method VoiceCall.Send should have comment or be unexported (golint)
    • adanos-alert/api/controller/jira.go
    • Line 18: warning: exported type JiraController should have comment or be unexported (golint)
    • Line 22: warning: exported function NewJiraController should have comment or be unexported (golint)
    • Line 26: warning: exported method JiraController.Register should have comment or be unexported (golint)
    • Line 35: warning: exported method JiraController.IssueOptions should have comment or be unexported (golint)
    • Line 100: warning: exported method JiraController.Priorities should have comment or be unexported (golint)
    • Line 121: warning: exported method JiraController.IssueTypes should have comment or be unexported (golint)
    • Line 147: warning: exported method JiraController.CustomFields should have comment or be unexported (golint)
    • adanos-alert/api/controller/rule.go
    • Line 27: warning: exported type RuleController should have comment or be unexported (golint)
    • Line 31: warning: exported function NewRuleController should have comment or be unexported (golint)
    • Line 35: warning: exported method RuleController.Register should have comment or be unexported (golint)
    • Line 246: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 267: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 294: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 539: warning: exported type RulesResp should have comment or be unexported (golint)
    • Line 547: warning: exported type RuleSearch should have comment or be unexported (golint)
    • Line 769: warning: exported type EvalSampleReq should have comment or be unexported (golint)
    • Line 775: warning: exported method RuleController.EvaluateExpressionSample should have comment or be unexported (golint)
    • adanos-alert/internal/repository/template.go
    • Line 10: warning: exported type TemplateType should have comment or be unexported (golint)
    • Line 13: warning: exported const TemplateTypeMatchRule should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported function AllTemplateTypes should have comment or be unexported (golint)
    • Line 30: warning: exported type Template should have comment or be unexported (golint)
    • Line 42: warning: exported type TemplateRepo should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/event.go
    • Line 15: warning: exported type EventRepo should have comment or be unexported (golint)
    • Line 20: warning: exported function NewEventRepo should have comment or be unexported (golint)
    • Line 47: warning: exported method EventRepo.AddWithContext should have comment or be unexported (golint)
    • Line 70: warning: exported method EventRepo.Add should have comment or be unexported (golint)
    • Line 74: warning: exported method EventRepo.Get should have comment or be unexported (golint)
    • Line 83: warning: exported method EventRepo.Find should have comment or be unexported (golint)
    • Line 103: warning: exported method EventRepo.FindIDs should have comment or be unexported (golint)
    • Line 123: warning: exported method EventRepo.Paginate should have comment or be unexported (golint)
    • Line 147: warning: exported method EventRepo.Delete should have comment or be unexported (golint)
    • Line 152: warning: exported method EventRepo.DeleteID should have comment or be unexported (golint)
    • Line 156: warning: exported method EventRepo.Traverse should have comment or be unexported (golint)
    • Line 177: warning: exported method EventRepo.UpdateID should have comment or be unexported (golint)
    • Line 182: warning: exported method EventRepo.Count should have comment or be unexported (golint)
    • Line 186: warning: exported method EventRepo.CountByDatetime should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/event_relation.go
    • Line 15: warning: exported type EventRelationRepo should have comment or be unexported (golint)
    • Line 19: warning: exported function NewEventRelationRepo should have comment or be unexported (golint)
    • Line 31: warning: exported method EventRelationRepo.AddOrUpdateEventRelation should have comment or be unexported (golint)
    • Line 50: warning: exported method EventRelationRepo.Get should have comment or be unexported (golint)
    • Line 59: warning: exported method EventRelationRepo.Paginate should have comment or be unexported (golint)
    • Line 83: warning: exported method EventRelationRepo.Count should have comment or be unexported (golint)
    • adanos-alert/test/mock/repository/rule.go
    • Line 13: warning: exported type RuleRepo should have comment or be unexported (golint)
    • Line 17: warning: exported method RuleRepo.Tags should have comment or be unexported (golint)
    • Line 21: warning: exported method RuleRepo.Paginate should have comment or be unexported (golint)
    • Line 25: warning: exported function NewRuleRepo should have comment or be unexported (golint)
    • Line 29: warning: exported method RuleRepo.Add should have comment or be unexported (golint)
    • Line 43: warning: exported method RuleRepo.Get should have comment or be unexported (golint)
    • Line 47: warning: exported method RuleRepo.Find should have comment or be unexported (golint)
    • Line 51: warning: exported method RuleRepo.Traverse should have comment or be unexported (golint)
    • Line 55: warning: exported method RuleRepo.UpdateID should have comment or be unexported (golint)
    • Line 59: warning: exported method RuleRepo.Count should have comment or be unexported (golint)
    • Line 63: warning: exported method RuleRepo.Delete should have comment or be unexported (golint)
    • Line 68: warning: exported method RuleRepo.DeleteID should have comment or be unexported (golint)
    • adanos-alert/internal/action/sms_yunxin.go
    • Line 7: warning: exported type SmsYunxin should have comment or be unexported (golint)
    • Line 11: warning: exported method SmsYunxin.Validate should have comment or be unexported (golint)
    • Line 15: warning: exported function NewSmsYunxinAction should have comment or be unexported (golint)
    • Line 19: warning: exported method SmsYunxin.Handle should have comment or be unexported (golint)
    • adanos-alert/agent/store/provider.go
    • Line 7: warning: exported type Provider should have comment or be unexported (golint)
    • Line 9: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 13: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • adanos-alert/configs/config.go
    • Line 10: warning: exported type Config should have comment or be unexported (golint)
    • Line 42: warning: exported type EmailSMTP should have comment or be unexported (golint)
    • Line 49: warning: exported type AliyunVoiceCall should have comment or be unexported (golint)
    • Line 58: warning: exported type Jira should have comment or be unexported (golint)
    • Line 64: warning: exported method Config.Serialize should have comment or be unexported (golint)
    • adanos-alert/api/controller/queue.go
    • Line 18: warning: exported type QueueController should have comment or be unexported (golint)
    • Line 22: warning: exported function NewQueueController should have comment or be unexported (golint)
    • Line 26: warning: exported method QueueController.Register should have comment or be unexported (golint)
    • Line 57: warning: exported type QueueJobsResp should have comment or be unexported (golint)
    • Line 62: warning: exported type QueueJob should have comment or be unexported (golint)
    • Line 67: warning: exported method QueueController.Jobs should have comment or be unexported (golint)
    • Line 93: warning: exported method QueueController.Job should have comment or be unexported (golint)
    • Line 111: warning: exported method QueueController.Delete should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/recovery.go
    • Line 15: warning: exported type RecoveryRepo should have comment or be unexported (golint)
    • Line 19: warning: exported function NewRecoveryRepo should have comment or be unexported (golint)
    • Line 23: warning: exported method RecoveryRepo.Register should have comment or be unexported (golint)
    • Line 64: warning: exported method RecoveryRepo.RecoverableEvents should have comment or be unexported (golint)
    • Line 85: warning: exported method RecoveryRepo.Delete should have comment or be unexported (golint)
    • adanos-alert/api/controller/dingding_robot.go
    • Line 19: warning: exported type DingdingRobotController should have comment or be unexported (golint)
    • Line 23: warning: exported function NewDingdingRobotController should have comment or be unexported (golint)
    • Line 27: warning: exported method DingdingRobotController.Register should have comment or be unexported (golint)
    • Line 41: warning: exported type DingdingRobotForm should have comment or be unexported (golint)
    • Line 48: warning: exported method DingdingRobotForm.Validate should have comment or be unexported (golint)
    • Line 60: warning: exported type DingdingRobotNameResp should have comment or be unexported (golint)
    • Line 85: warning: exported method DingdingRobotController.Add should have comment or be unexported (golint)
    • Line 119: warning: exported method DingdingRobotController.Update should have comment or be unexported (golint)
    • Line 159: warning: exported method DingdingRobotController.Delete should have comment or be unexported (golint)
    • Line 179: warning: exported method DingdingRobotController.DingdingRobot should have comment or be unexported (golint)
    • Line 197: warning: exported method DingdingRobotController.DingdingRobots should have comment or be unexported (golint)
    • adanos-alert/pubsub/provider.go
    • Line 15: warning: exported type Provider should have comment or be unexported (golint)
    • Line 17: warning: exported method Provider.Aggregates should have comment or be unexported (golint)
    • Line 65: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 66: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • adanos-alert/api/controller/events.go
    • Line 24: warning: exported type EventController should have comment or be unexported (golint)
    • Line 28: warning: exported function NewEventController should have comment or be unexported (golint)
    • Line 32: warning: exported method EventController.Register should have comment or be unexported (golint)
    • Line 206: warning: exported method EventController.ReproduceEvent should have comment or be unexported (golint)
    • Line 239: warning: exported method EventController.AddCommonEvent should have comment or be unexported (golint)
    • Line 303: warning: comment on exported method EventController.AddOpenFalconEvent should be of the form "AddOpenFalconEvent ..." (golint)
    • adanos-alert/api/provider.go
    • Line 11: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 31: warning: comment on exported type Provider should be of the form "Provider ..." (with optional leading article) (golint)
    • Line 35: warning: exported method Provider.Aggregates should have comment or be unexported (golint)
    • Line 104: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 105: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/dingding_robot.go
    • Line 14: warning: exported type DingdingRobotRepo should have comment or be unexported (golint)
    • Line 18: warning: exported function NewDingdingRobotRepo should have comment or be unexported (golint)
    • Line 22: warning: exported method DingdingRobotRepo.Add should have comment or be unexported (golint)
    • Line 34: warning: exported method DingdingRobotRepo.Get should have comment or be unexported (golint)
    • Line 43: warning: exported method DingdingRobotRepo.Find should have comment or be unexported (golint)
    • Line 63: warning: exported method DingdingRobotRepo.Paginate should have comment or be unexported (golint)
    • Line 87: warning: exported method DingdingRobotRepo.DeleteID should have comment or be unexported (golint)
    • Line 91: warning: exported method DingdingRobotRepo.Delete should have comment or be unexported (golint)
    • Line 96: warning: exported method DingdingRobotRepo.Update should have comment or be unexported (golint)
    • Line 102: warning: exported method DingdingRobotRepo.Count should have comment or be unexported (golint)
    • adanos-alert/api/controller/audit.go
    • Line 13: warning: exported type AuditController should have comment or be unexported (golint)
    • Line 17: warning: exported function NewAuditController should have comment or be unexported (golint)
    • Line 21: warning: exported method AuditController.Register should have comment or be unexported (golint)
    • Line 27: warning: exported method AuditController.Logs should have comment or be unexported (golint)
    • adanos-alert/internal/action/provider.go
    • Line 11: warning: exported type Provider should have comment or be unexported (golint)
    • Line 13: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 17: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • adanos-alert/service/event.go
    • Line 15: warning: exported type EventService should have comment or be unexported (golint)
    • Line 26: warning: exported function NewEventService should have comment or be unexported (golint)
    • adanos-alert/api/controller/user.go
    • Line 20: warning: exported type UserController should have comment or be unexported (golint)
    • Line 24: warning: exported function NewUserController should have comment or be unexported (golint)
    • Line 28: warning: exported method UserController.Register should have comment or be unexported (golint)
    • Line 42: warning: exported type UserForm should have comment or be unexported (golint)
    • Line 57: warning: exported method UserForm.GetMetas should have comment or be unexported (golint)
    • Line 68: warning: exported method UserForm.Init should have comment or be unexported (golint)
    • Line 73: warning: exported method UserForm.Validate should have comment or be unexported (golint)
    • Line 118: warning: exported type UserNameResp should have comment or be unexported (golint)
    • Line 141: warning: exported method UserController.Add should have comment or be unexported (golint)
    • Line 179: warning: exported method UserController.Update should have comment or be unexported (golint)
    • Line 226: warning: exported method UserController.Delete should have comment or be unexported (golint)
    • Line 246: warning: exported method UserController.User should have comment or be unexported (golint)
    • Line 266: warning: exported method UserController.Users should have comment or be unexported (golint)
    • adanos-alert/internal/job/trigger.go
    • Line 12: warning: exported const TriggerJobName should have comment or be unexported (golint)
    • Line 14: warning: exported type TriggerJob should have comment or be unexported (golint)
    • Line 19: warning: exported function NewTrigger should have comment or be unexported (golint)
    • Line 23: warning: exported method TriggerJob.Handle should have comment or be unexported (golint)
    • adanos-alert/cmd/server/main.go
    • Line 38: warning: exported var Version should have comment or be unexported (golint)
    • Line 39: warning: exported var GitCommit should have comment or be unexported (golint)
    • Line 330: warning: exported type ErrorCollectorWriter should have comment or be unexported (golint)
    • Line 334: warning: exported function NewErrorCollectorWriter should have comment or be unexported (golint)
    • Line 365: warning: exported method ErrorCollectorWriter.ReOpen should have comment or be unexported (golint)
    • Line 369: warning: exported method ErrorCollectorWriter.Close should have comment or be unexported (golint)
    • adanos-alert/internal/repository/queue.go
    • Line 11: warning: exported type QueueItemStatus should have comment or be unexported (golint)
    • Line 14: warning: exported const QueueItemStatusWait should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported type QueueJob should have comment or be unexported (golint)
    • Line 34: warning: exported type QueueRepo should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/sequence.go
    • Line 12: warning: exported type SequenceRepo should have comment or be unexported (golint)
    • Line 16: warning: exported function NewSequenceRepo should have comment or be unexported (golint)
    • Line 20: warning: exported method SequenceRepo.Next should have comment or be unexported (golint)
    • Line 34: warning: exported method SequenceRepo.Truncate should have comment or be unexported (golint)
    • adanos-alert/agent/api/provider.go
    • Line 14: warning: exported type Provider should have comment or be unexported (golint)
    • Line 16: warning: exported method Provider.Aggregates should have comment or be unexported (golint)
    • Line 40: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 41: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • adanos-alert/internal/queue/provider.go
    • Line 12: warning: exported type Provider should have comment or be unexported (golint)
    • Line 14: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 18: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • Line 20: warning: exported method Provider.Daemon should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/lock.go
    • Line 15: warning: exported type LockRepo should have comment or be unexported (golint)
    • Line 62: warning: exported method LockRepo.UnLock should have comment or be unexported (golint)
    • Line 91: warning: exported method LockRepo.Renew should have comment or be unexported (golint)
    • Line 121: warning: exported method LockRepo.Remove should have comment or be unexported (golint)
    • Line 130: warning: exported function NewLockRepo should have comment or be unexported (golint)
    • adanos-alert/internal/repository/rule.go
    • Line 14: warning: exported type RuleStatus should have comment or be unexported (golint)
    • Line 17: warning: exported const RuleStatusEnabled should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported const ReadyTypeInterval should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported type Tag should have comment or be unexported (golint)
    • Line 32: warning: exported type TimeRange should have comment or be unexported (golint)
    • Line 109: warning: exported type RuleRepo should have comment or be unexported (golint)
    • Line 122: warning: exported function ExpectReadyAt should have comment or be unexported (golint)
    • Line 142: warning: exported type Times should have comment or be unexported (golint)
    • adanos-alert/internal/action/phone_call_aliyun.go
    • Line 14: warning: exported type AliyunVoiceCallAction should have comment or be unexported (golint)
    • Line 18: warning: exported method AliyunVoiceCallAction.Validate should have comment or be unexported (golint)
    • Line 26: warning: exported function NewPhoneCallAliyunAction should have comment or be unexported (golint)
    • Line 30: warning: exported type VoiceCallMeta should have comment or be unexported (golint)
    • Line 34: warning: exported method AliyunVoiceCallAction.Handle should have comment or be unexported (golint)
    • adanos-alert/internal/repository/event_group.go
    • Line 11: warning: exported type EventGroupStatus should have comment or be unexported (golint)
    • Line 14: warning: exported const EventGroupStatusCollecting should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported type EventGroupRule should have comment or be unexported (golint)
    • Line 42: warning: exported type EventGroup should have comment or be unexported (golint)
    • Line 64: warning: exported type EventGroupByRuleCount should have comment or be unexported (golint)
    • Line 71: warning: exported type EventGroupByUserCount should have comment or be unexported (golint)
    • Line 78: warning: exported type EventGroupByDatetimeCount should have comment or be unexported (golint)
    • Line 98: warning: exported type EventGroupRepo should have comment or be unexported (golint)
    • adanos-alert/api/controller/public.go
    • Line 14: warning: exported type PublicController should have comment or be unexported (golint)
    • Line 18: warning: exported function NewPublicController should have comment or be unexported (golint)
    • Line 22: warning: exported method PublicController.Register should have comment or be unexported (golint)
    • adanos-alert/api/controller/statistics.go
    • Line 127: warning: exported type EventGroupByUserCounts should have comment or be unexported (golint)
    • Line 168: warning: exported type EventGroupByRuleCounts should have comment or be unexported (golint)
    • Line 281: warning: exported type EventGroupAggByDatetimeCountResp should have comment or be unexported (golint)
    • Line 286: warning: comment on exported method StatisticsController.EventGroupAggInPeriod should be of the form "EventGroupAggInPeriod ..." (golint)
    • adanos-alert/internal/job/provider.go
    • Line 18: warning: exported type Provider should have comment or be unexported (golint)
    • Line 20: warning: exported method Provider.Aggregates should have comment or be unexported (golint)
    • Line 45: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 51: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • Line 53: warning: exported type DistributeLockManager should have comment or be unexported (golint)
    • Line 61: warning: exported function NewDistributeLockManager should have comment or be unexported (golint)
    • Line 67: warning: exported method DistributeLockManager.TryLock should have comment or be unexported (golint)
    • Line 112: warning: exported method DistributeLockManager.TryUnLock should have comment or be unexported (golint)
    • Line 134: warning: exported method DistributeLockManager.HasLock should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/queue.go
    • Line 15: warning: exported type QueueRepo should have comment or be unexported (golint)
    • Line 19: warning: exported function NewQueueRepo should have comment or be unexported (golint)
    • Line 32: warning: exported method QueueRepo.Enqueue should have comment or be unexported (golint)
    • Line 64: warning: exported method QueueRepo.Dequeue should have comment or be unexported (golint)
    • Line 83: warning: exported method QueueRepo.Paginate should have comment or be unexported (golint)
    • Line 114: warning: exported method QueueRepo.Delete should have comment or be unexported (golint)
    • Line 119: warning: exported method QueueRepo.DeleteID should have comment or be unexported (golint)
    • Line 123: warning: exported method QueueRepo.Get should have comment or be unexported (golint)
    • Line 136: warning: exported method QueueRepo.Count should have comment or be unexported (golint)
    • Line 140: warning: exported method QueueRepo.Update should have comment or be unexported (golint)
    • Line 147: warning: exported method QueueRepo.UpdateID should have comment or be unexported (golint)
    • adanos-alert/pkg/messager/dingding/dinding.go
    • Line 27: warning: exported method DingdingMessage.Encode should have comment or be unexported (golint)
    • Line 32: warning: exported method DingdingMessage.Decode should have comment or be unexported (golint)
    • Line 75: warning: exported function ExtractAtSomeones should have comment or be unexported (golint)
    • Line 97: warning: exported type Dingding should have comment or be unexported (golint)
    • Line 103: warning: exported function NewDingding should have comment or be unexported (golint)
    • Line 107: warning: exported type Message should have comment or be unexported (golint)
    • Line 117: warning: exported method Dingding.Send should have comment or be unexported (golint)
    • adanos-alert/internal/template/template.go
    • Line 40: warning: exported type SimpleContainer should have comment or be unexported (golint)
    • Line 58: warning: comment on exported function CreateParser should be of the form "CreateParser ..." (golint)
    • Line 183: warning: exported function LineFilterInclude should have comment or be unexported (golint)
    • Line 194: warning: exported function LineFilterExclude should have comment or be unexported (golint)
    • Line 264: warning: exported type KvPairs should have comment or be unexported (golint)
    • Line 395: warning: comment on exported function MetaFilterPrefix should be of the form "MetaFilterPrefix ..." (golint)
    • Line 429: warning: exported type KVPair should have comment or be unexported (golint)
    • Line 434: warning: exported type Keys should have comment or be unexported (golint)
    • Line 455: warning: exported function SortMapByKeyHuman should have comment or be unexported (golint)
    • Line 474: warning: exported function Implode should have comment or be unexported (golint)
    • adanos-alert/internal/repository/user.go
    • Line 10: warning: exported type UserStatus should have comment or be unexported (golint)
    • Line 13: warning: exported const UserStatusEnabled should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type UserMeta should have comment or be unexported (golint)
    • Line 22: warning: exported type UserMetas should have comment or be unexported (golint)
    • Line 24: warning: exported method UserMetas.Get should have comment or be unexported (golint)
    • Line 34: warning: exported type User should have comment or be unexported (golint)
    • Line 52: warning: exported type UserRepo should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/event_group.go
    • Line 15: warning: exported type EventGroupRepo should have comment or be unexported (golint)
    • Line 20: warning: exported function NewEventGroupRepo should have comment or be unexported (golint)
    • Line 33: warning: exported method EventGroupRepo.Add should have comment or be unexported (golint)
    • Line 49: warning: exported method EventGroupRepo.Get should have comment or be unexported (golint)
    • Line 57: warning: exported method EventGroupRepo.Find should have comment or be unexported (golint)
    • Line 77: warning: exported method EventGroupRepo.Paginate should have comment or be unexported (golint)
    • Line 108: warning: exported method EventGroupRepo.Traverse should have comment or be unexported (golint)
    • Line 129: warning: exported method EventGroupRepo.UpdateID should have comment or be unexported (golint)
    • Line 135: warning: exported method EventGroupRepo.Delete should have comment or be unexported (golint)
    • Line 140: warning: exported method EventGroupRepo.DeleteID should have comment or be unexported (golint)
    • Line 144: warning: exported method EventGroupRepo.Count should have comment or be unexported (golint)
    • Line 148: warning: exported method EventGroupRepo.CollectingGroup should have comment or be unexported (golint)
    • Line 175: warning: exported method EventGroupRepo.LastGroup should have comment or be unexported (golint)
    • Line 184: warning: exported method EventGroupRepo.StatByRuleCount should have comment or be unexported (golint)
    • Line 221: warning: exported method EventGroupRepo.StatByUserCount should have comment or be unexported (golint)
    • Line 277: warning: exported method EventGroupRepo.StatByDatetimeCount should have comment or be unexported (golint)
    • Line 326: warning: exported method EventGroupRepo.StatByAggCountInPeriod should have comment or be unexported (golint)
    • Line 378: warning: exported method EventGroupRepo.StatByAggCount should have comment or be unexported (golint)
    • adanos-alert/internal/action/sms_aliyun.go
    • Line 7: warning: exported type SmsAliyun should have comment or be unexported (golint)
    • Line 11: warning: exported method SmsAliyun.Validate should have comment or be unexported (golint)
    • Line 15: warning: exported function NewSmsAliyunAction should have comment or be unexported (golint)
    • Line 19: warning: exported method SmsAliyun.Handle should have comment or be unexported (golint)
    • adanos-alert/api/controller/agent.go
    • Line 11: warning: exported type AgentController should have comment or be unexported (golint)
    • Line 15: warning: exported function NewAgentController should have comment or be unexported (golint)
    • Line 19: warning: exported method AgentController.Register should have comment or be unexported (golint)
    • Line 26: warning: exported type AgentResp should have comment or be unexported (golint)
    • Line 31: warning: exported method AgentController.All should have comment or be unexported (golint)
    • Line 50: warning: exported method AgentController.Remove should have comment or be unexported (golint)
    • adanos-alert/internal/extension/extension.go
    • Line 17: warning: exported type CommonEvent should have comment or be unexported (golint)
    • Line 26: warning: exported type EventControl should have comment or be unexported (golint)
    • Line 32: warning: exported method EventControl.GetInhibitInterval should have comment or be unexported (golint)
    • Line 41: warning: exported method EventControl.GetRecoveryAfter should have comment or be unexported (golint)
    • Line 50: warning: exported method CommonEvent.Serialize should have comment or be unexported (golint)
    • Line 55: warning: exported method CommonEvent.CreateRepoEvent should have comment or be unexported (golint)
    • Line 69: warning: exported method CommonEvent.GetControl should have comment or be unexported (golint)
    • Line 73: warning: exported type RepoEvent should have comment or be unexported (golint)
    • Line 78: warning: exported function LogstashToCommonEvent should have comment or be unexported (golint)
    • Line 132: warning: exported type GrafanaEvent should have comment or be unexported (golint)
    • Line 143: warning: exported method GrafanaEvent.ToRepo should have comment or be unexported (golint)
    • Line 159: warning: exported type GrafanaEvalMatch should have comment or be unexported (golint)
    • Line 165: warning: exported function GrafanaToCommonEvent should have comment or be unexported (golint)
    • Line 180: warning: exported type PrometheusEvent should have comment or be unexported (golint)
    • Line 189: warning: exported method PrometheusEvent.CreateRepoEvent should have comment or be unexported (golint)
    • Line 199: warning: exported method PrometheusEvent.GetControl should have comment or be unexported (golint)
    • Line 226: warning: exported function PrometheusToCommonEvents should have comment or be unexported (golint)
    • Line 247: warning: exported type PrometheusAlertEvent should have comment or be unexported (golint)
    • Line 262: warning: exported method PrometheusAlertEvent.ToRepo should have comment or be unexported (golint)
    • Line 283: warning: exported function PrometheusAlertToCommonEvent should have comment or be unexported (golint)
    • Line 298: warning: exported function OpenFalconToCommonEvent should have comment or be unexported (golint)
    • adanos-alert/rpc/heartbeat.go
    • Line 19: warning: exported function NewHeartbeatService should have comment or be unexported (golint)
    • Line 23: warning: exported method HeartbeatService.Ping should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/rule.go
    • Line 14: warning: exported type RuleRepo should have comment or be unexported (golint)
    • Line 18: warning: exported function NewRuleRepo should have comment or be unexported (golint)
    • Line 22: warning: exported method RuleRepo.Tags should have comment or be unexported (golint)
    • Line 49: warning: exported method RuleRepo.Add should have comment or be unexported (golint)
    • Line 67: warning: exported method RuleRepo.Get should have comment or be unexported (golint)
    • Line 72: warning: exported method RuleRepo.Paginate should have comment or be unexported (golint)
    • Line 96: warning: exported method RuleRepo.Find should have comment or be unexported (golint)
    • Line 116: warning: exported method RuleRepo.Traverse should have comment or be unexported (golint)
    • Line 137: warning: exported method RuleRepo.UpdateID should have comment or be unexported (golint)
    • Line 150: warning: exported method RuleRepo.Count should have comment or be unexported (golint)
    • Line 154: warning: exported method RuleRepo.Delete should have comment or be unexported (golint)
    • Line 159: warning: exported method RuleRepo.DeleteID should have comment or be unexported (golint)
    • adanos-alert/test/mock/repository/message_group.go
    • Line 13: warning: exported type EventGroupRepo should have comment or be unexported (golint)
    • Line 17: warning: exported method EventGroupRepo.StatByDatetimeCount should have comment or be unexported (golint)
    • Line 21: warning: exported method EventGroupRepo.StatByAggCountInPeriod should have comment or be unexported (golint)
    • Line 25: warning: exported method EventGroupRepo.StatByAggCount should have comment or be unexported (golint)
    • Line 29: warning: exported method EventGroupRepo.StatByRuleCount should have comment or be unexported (golint)
    • Line 33: warning: exported method EventGroupRepo.StatByUserCount should have comment or be unexported (golint)
    • Line 38: warning: exported method EventGroupRepo.LastGroup should have comment or be unexported (golint)
    • Line 42: warning: exported function NewMessageGroupRepo should have comment or be unexported (golint)
    • Line 46: warning: exported method EventGroupRepo.Add should have comment or be unexported (golint)
    • Line 50: warning: exported method EventGroupRepo.Get should have comment or be unexported (golint)
    • Line 54: warning: exported method EventGroupRepo.Find should have comment or be unexported (golint)
    • Line 58: warning: exported method EventGroupRepo.Paginate should have comment or be unexported (golint)
    • Line 62: warning: exported method EventGroupRepo.Delete should have comment or be unexported (golint)
    • Line 67: warning: exported method EventGroupRepo.DeleteID should have comment or be unexported (golint)
    • Line 71: warning: exported method EventGroupRepo.Traverse should have comment or be unexported (golint)
    • Line 81: warning: exported method EventGroupRepo.UpdateID should have comment or be unexported (golint)
    • Line 92: warning: exported method EventGroupRepo.Count should have comment or be unexported (golint)
    • Line 96: warning: exported method EventGroupRepo.CollectingGroup should have comment or be unexported (golint)
    • adanos-alert/rpc/provider.go
    • Line 19: warning: exported type Provider should have comment or be unexported (golint)
    • Line 21: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 38: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • Line 45: warning: exported method Provider.Daemon should have comment or be unexported (golint)
    • adanos-alert/pkg/connector/connector.go
    • Line 42: warning: exported type EventControl should have comment or be unexported (golint)
    • Line 61: warning: exported method Event.WithTags should have comment or be unexported (golint)
    • Line 66: warning: exported method Event.WithOrigin should have comment or be unexported (golint)
    • Line 71: warning: exported method Event.WithCtl should have comment or be unexported (golint)
    • Line 76: warning: exported method Event.WithMetas should have comment or be unexported (golint)
    • Line 83: warning: exported method Event.WithMeta should have comment or be unexported (golint)
    • adanos-alert/api/controller/group.go
    • Line 20: warning: exported type GroupController should have comment or be unexported (golint)
    • Line 24: warning: exported function NewGroupController should have comment or be unexported (golint)
    • Line 28: warning: exported method GroupController.Register should have comment or be unexported (golint)
    • Line 40: warning: exported type GroupsResp should have comment or be unexported (golint)
    • Line 46: warning: exported type GroupsGroupResp should have comment or be unexported (golint)
    • Line 118: warning: exported type GroupResp should have comment or be unexported (golint)
    • Line 124: warning: exported method GroupController.Group should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/event_relation_note.go
    • Line 15: warning: exported type EventRelationNoteRepo should have comment or be unexported (golint)
    • Line 19: warning: exported function NewEventRelationNoteRepo should have comment or be unexported (golint)
    • Line 31: warning: exported method EventRelationNoteRepo.AddNote should have comment or be unexported (golint)
    • Line 44: warning: exported method EventRelationNoteRepo.PaginateNotes should have comment or be unexported (golint)
    • Line 70: warning: exported method EventRelationNoteRepo.DeleteNote should have comment or be unexported (golint)
    • adanos-alert/agent/api/event.go
    • Line 17: warning: exported type EventController should have comment or be unexported (golint)
    • Line 21: warning: exported function NewEventController should have comment or be unexported (golint)
    • Line 25: warning: exported method EventController.Register should have comment or be unexported (golint)
    • Line 72: warning: exported method EventController.AddCommonEvent should have comment or be unexported (golint)
    • Line 91: warning: comment on exported method EventController.AddGrafanaEvent should be of the form "AddGrafanaEvent ..." (golint)
    • Line 101: warning: comment on exported method EventController.AddPrometheusEvent should be of the form "AddPrometheusEvent ..." (golint)
    • Line 120: warning: comment on exported method EventController.AddPrometheusAlertEvent should be of the form "AddPrometheusAlertEvent ..." (golint)
    • Line 130: warning: comment on exported method EventController.AddOpenFalconEvent should be of the form "AddOpenFalconEvent ..." (golint)
    • adanos-alert/internal/action/wechat.go
    • Line 7: warning: exported type WechatAction should have comment or be unexported (golint)
    • Line 11: warning: exported method WechatAction.Validate should have comment or be unexported (golint)
    • Line 15: warning: exported function NewWechatAction should have comment or be unexported (golint)
    • Line 19: warning: exported method WechatAction.Handle should have comment or be unexported (golint)
    • adanos-alert/api/controller/template.go
    • Line 16: warning: exported type TemplateController should have comment or be unexported (golint)
    • Line 20: warning: exported function NewTemplateController should have comment or be unexported (golint)
    • Line 24: warning: exported method TemplateController.Register should have comment or be unexported (golint)
    • Line 34: warning: exported method TemplateController.Get should have comment or be unexported (golint)
    • Line 52: warning: exported method TemplateController.Templates should have comment or be unexported (golint)
    • Line 63: warning: exported type TemplateForm should have comment or be unexported (golint)
    • Line 70: warning: exported method TemplateForm.Validate should have comment or be unexported (golint)
    • Line 85: warning: exported method TemplateController.Add should have comment or be unexported (golint)
    • Line 111: warning: exported method TemplateController.Update should have comment or be unexported (golint)
    • Line 149: warning: exported method TemplateController.Delete should have comment or be unexported (golint)
    • adanos-alert/api/controller/welcome.go
    • Line 8: warning: exported type WelcomeController should have comment or be unexported (golint)
    • Line 12: warning: exported function NewWelcomeController should have comment or be unexported (golint)
    • Line 16: warning: exported method WelcomeController.Register should have comment or be unexported (golint)
    • Line 20: warning: exported type WelcomeMessage should have comment or be unexported (golint)
    • adanos-alert/agent/job/provider.go
    • Line 9: warning: exported type Provider should have comment or be unexported (golint)
    • Line 11: warning: exported method Provider.Aggregates should have comment or be unexported (golint)
    • Line 20: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 25: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/agent.go
    • Line 16: warning: exported type AgentRepo should have comment or be unexported (golint)
    • Line 20: warning: exported function NewAgentRepo should have comment or be unexported (golint)
    • Line 25: warning: exported method AgentRepo.Update should have comment or be unexported (golint)
    • Line 53: warning: exported method AgentRepo.Get should have comment or be unexported (golint)
    • Line 63: warning: exported method AgentRepo.Find should have comment or be unexported (golint)
    • Line 83: warning: exported method AgentRepo.Delete should have comment or be unexported (golint)
    • Line 88: warning: exported method AgentRepo.DeleteID should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/kv.go
    • Line 12: warning: exported type KVRepo should have comment or be unexported (golint)
    • Line 16: warning: exported function NewKVRepo should have comment or be unexported (golint)
    • Line 20: warning: exported method KVRepo.Set should have comment or be unexported (golint)
    • Line 24: warning: exported method KVRepo.SetWithTTL should have comment or be unexported (golint)
    • Line 43: warning: exported method KVRepo.Get should have comment or be unexported (golint)
    • Line 61: warning: exported method KVRepo.Remove should have comment or be unexported (golint)
    • Line 70: warning: exported method KVRepo.All should have comment or be unexported (golint)
    • Line 94: warning: exported method KVRepo.GC should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/template.go
    • Line 14: warning: exported type TemplateRepo should have comment or be unexported (golint)
    • Line 18: warning: exported function NewTemplateRepo should have comment or be unexported (golint)
    • Line 22: warning: exported method TemplateRepo.Add should have comment or be unexported (golint)
    • Line 34: warning: exported method TemplateRepo.Get should have comment or be unexported (golint)
    • Line 43: warning: exported method TemplateRepo.Find should have comment or be unexported (golint)
    • Line 63: warning: exported method TemplateRepo.Paginate should have comment or be unexported (golint)
    • Line 87: warning: exported method TemplateRepo.DeleteID should have comment or be unexported (golint)
    • Line 91: warning: exported method TemplateRepo.Delete should have comment or be unexported (golint)
    • Line 96: warning: exported method TemplateRepo.Update should have comment or be unexported (golint)
    • Line 102: warning: exported method TemplateRepo.Count should have comment or be unexported (golint)
    • adanos-alert/internal/repository/impl/user.go
    • Line 16: warning: exported type UserRepo should have comment or be unexported (golint)
    • Line 20: warning: exported function NewUserRepo should have comment or be unexported (golint)
    • Line 24: warning: exported method UserRepo.Add should have comment or be unexported (golint)
    • Line 39: warning: exported method UserRepo.Get should have comment or be unexported (golint)
    • Line 48: warning: exported method UserRepo.GetByEmail should have comment or be unexported (golint)
    • Line 57: warning: exported method UserRepo.Find should have comment or be unexported (golint)
    • Line 77: warning: exported method UserRepo.Paginate should have comment or be unexported (golint)
    • Line 101: warning: exported method UserRepo.DeleteID should have comment or be unexported (golint)
    • Line 105: warning: exported method UserRepo.Delete should have comment or be unexported (golint)
    • Line 110: warning: exported method UserRepo.Update should have comment or be unexported (golint)
    • Line 125: warning: exported method UserRepo.Count should have comment or be unexported (golint)
    • Line 129: warning: exported method UserRepo.GetUserMetas should have comment or be unexported (golint)
    • adanos-alert/service/provider.go
    • Line 7: warning: exported type Provider should have comment or be unexported (golint)
    • Line 9: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 14: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • adanos-alert/migrate/provider.go
    • Line 7: warning: exported type Provider should have comment or be unexported (golint)
    • Line 10: warning: exported method Provider.Register should have comment or be unexported (golint)
    • Line 13: warning: exported method Provider.Boot should have comment or be unexported (golint)
    • adanos-alert/cmd/agent/main.go
    • Line 37: warning: exported var GitCommit should have comment or be unexported (golint)
    • Line 177: warning: exported method ErrorCollectorWriter.ReOpen should have comment or be unexported (golint)
    • Line 181: warning: exported method ErrorCollectorWriter.Close should have comment or be unexported (golint)
    • Line 195: warning: exported method AuthAPI.GetRequestMetadata should have comment or be unexported (golint)
    • Line 201: warning: exported method AuthAPI.RequireTransportSecurity should have comment or be unexported (golint)
    • adanos-alert/internal/job/recovery.go
    • Line 14: warning: exported const RecoveryJobName should have comment or be unexported (golint)
    • Line 16: warning: exported type RecoveryJob should have comment or be unexported (golint)
    • Line 21: warning: exported function NewRecoveryJob should have comment or be unexported (golint)
    • Line 25: warning: exported method RecoveryJob.Handle should have comment or be unexported (golint)
    • adanos-alert/internal/action/email.go
    • Line 9: warning: exported type EmailAction should have comment or be unexported (golint)
    • Line 13: warning: exported method EmailAction.Validate should have comment or be unexported (golint)
    • Line 17: warning: exported function NewEmailAction should have comment or be unexported (golint)
    • Line 21: warning: exported method EmailAction.Handle should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign0%

IneffAssign detects ineffectual assignments in Go code.

An error occurred while running this test (exit status 2)


misspell0%

Misspell Finds commonly misspelled English words

An error occurred while running this test (exit status 2)