Last analyzed 18feb92 9 days ago
Default analysis branch is
Currently analyzing run
Function call can be replaced with helper function CRT-A0010
Anti-pattern
a year ago2 years old
use strings.ReplaceAll method in strings.Replace(it.line, lineValue, "((redacted))", -1)
455		lineValue = strings.TrimSpace(lineValue)
456		// Don't consider a single char as a secret.
457		if len(lineValue) > 1 {
458			it.line = strings.Replace(it.line, lineValue, "((redacted))", -1)459		}
460	}
461}
use strings.ReplaceAll method in strings.Replace(strings.ToLower(event.Name), " ", "_", -1)
63var specialChars = regexp.MustCompile("[^a-zA-Z0-9_]+")
64
65func (emitter *DogstatsdEmitter) Emit(logger lager.Logger, event metric.Event) {
66	name := specialChars.ReplaceAllString(strings.Replace(strings.ToLower(event.Name), " ", "_", -1), "")67
68	tags := []string{
69		fmt.Sprintf("event_host:%s", event.Host),
use strings.ReplaceAll method in strings.Replace(event.Name, " ", "_", -1)
168func (emitter *NewRelicEmitter) transformToNewRelicEvent(event metric.Event, nameOverride string) NewRelicEvent {
169	name := nameOverride
170	if name == "" {
171		name = strings.Replace(event.Name, " ", "_", -1)172	}
173
174	eventType := emitter.prefix + name
use strings.ReplaceAll method in strings.Replace(strings.ToLower(env), "_", "-", -1)
196}
197
198func flagify(env string) string {
199	return strings.Replace(strings.ToLower(env), "_", "-", -1)200}
201
202func getGdnFlagsFromConfig(configPath string) (GdnBinaryFlags, error) {
use strings.ReplaceAll method in strings.Replace(k, "_", "-", -1)
32
33	for k, v := range event.Attributes {
34		// normalize on foo-bar rather than foo_bar
35		lagerKey := strings.Replace(k, "_", "-", -1)36		data[lagerKey] = v
37	}
38