btwiuse / k0s

Function call can be replaced with helper function CRT-A0010
Anti-pattern
3 months ago3 years old
use strings.ReplaceAll method in strings.Replace(masked, "+:", string([]rune{escapedPlus, ':'}), -1)
 681	})
 682	masked = strings.Replace(masked, "::", string([]rune{escapedColon, ':'}), -1)
 683	masked = strings.Replace(masked, ",:", string([]rune{escapedComma, ':'}), -1)
 684	masked = strings.Replace(masked, "+:", string([]rune{escapedPlus, ':'}), -1) 685
 686	idx := 0
 687	for _, pairStr := range strings.Split(masked, ",") {
use strings.ReplaceAll method in strings.Replace(masked, ",:", string([]rune{escapedComma, ':'}), -1)
 680		return prefix + "(" + strings.Repeat(" ", len(src)-len(prefix)-2) + ")"
 681	})
 682	masked = strings.Replace(masked, "::", string([]rune{escapedColon, ':'}), -1)
 683	masked = strings.Replace(masked, ",:", string([]rune{escapedComma, ':'}), -1) 684	masked = strings.Replace(masked, "+:", string([]rune{escapedPlus, ':'}), -1)
 685
 686	idx := 0
use strings.ReplaceAll method in strings.Replace(masked, "::", string([]rune{escapedColon, ':'}), -1)
 679		}
 680		return prefix + "(" + strings.Repeat(" ", len(src)-len(prefix)-2) + ")"
 681	})
 682	masked = strings.Replace(masked, "::", string([]rune{escapedColon, ':'}), -1) 683	masked = strings.Replace(masked, ",:", string([]rune{escapedComma, ':'}), -1)
 684	masked = strings.Replace(masked, "+:", string([]rune{escapedPlus, ':'}), -1)
 685
use strings.ReplaceAll method in strings.Replace(str, "\\t", "\t", -1)
 360
 361func delimiterRegexp(str string) Delimiter {
 362	// Special handling of \t
 363	str = strings.Replace(str, "\\t", "\t", -1) 364
 365	// 1. Pattern does not contain any special character
 366	if regexp.QuoteMeta(str) == str {
use strings.ReplaceAll method in strings.Replace(token, "\t", " ", -1)
169	switchSet := false
170	afterBar := false
171	for _, token := range tokens {
172		typ, inv, text := termFuzzy, false, strings.Replace(token, "\t", " ", -1)173		lowerText := strings.ToLower(text)
174		caseSensitive := caseMode == CaseRespect ||
175			caseMode == CaseSmart && text != lowerText