divideprojects / Alita_Robot

Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
2 months ago2 months old
func GetNoteAndFilterType has a cyclomatic complexity of 17 with "high" risk
 582// NOTE: NoteWelcomeFilter helper functions
 583
 584// GetNoteAndFilterType is a helper function to get the note and filter type from a *gotgbot.Message object.
 585func GetNoteAndFilterType(msg *gotgbot.Message, isFilter bool) (keyWord, fileid, text string, dataType int, buttons []db.Button, pvtOnly, grpOnly, adminOnly, webPrev, isProtected, noNotif bool, errorMsg string) { 586	dataType = -1 // not defined datatype; invalid note
 587	if isFilter {
 588		errorMsg = "You need to give the filter some content!"
func ExtractUserAndText has a cyclomatic complexity of 22 with "high" risk
 64}
 65
 66// ExtractUserAndText extracts the user and text from the message.
 67func ExtractUserAndText(b *gotgbot.Bot, ctx *ext.Context) (int64, string) { 68	msg := ctx.EffectiveMessage
 69	args := ctx.Args()
 70	prevMessage := msg.ReplyToMessage
func warnThisUser has a cyclomatic complexity of 18 with "high" risk
 70	return ext.EndGroups
 71}
 72
 73func (moduleStruct) warnThisUser(b *gotgbot.Bot, ctx *ext.Context, userId int64, reason, warnType string) (err error) { 74	var (
 75		reply    string
 76		keyboard gotgbot.InlineKeyboardMarkup
func reports has a cyclomatic complexity of 25 with "high" risk
191	return ext.EndGroups
192}
193
194func (moduleStruct) reports(b *gotgbot.Bot, ctx *ext.Context) error {195	// connection status
196	connectedChat := helpers.IsUserConnected(b, ctx, true, true)
197	if connectedChat == nil {
func report has a cyclomatic complexity of 22 with "high" risk
 27	handlerGroup: 8,
 28}
 29
 30func (moduleStruct) report(b *gotgbot.Bot, ctx *ext.Context) error { 31	chat := ctx.EffectiveChat
 32	user := ctx.EffectiveSender.User
 33	msg := ctx.EffectiveMessage