MCPcopy
hub / github.com/github/git-sizer / levelOfConcern

Method levelOfConcern

sizes/output.go:176–189  ·  view source on GitHub ↗

If this item's alert level is at least as high as the threshold, return the string that should be used as its "level of concern" and `true`; otherwise, return `"", false`.

(threshold Threshold)

Source from the content-addressed store, hash-verified

174// return the string that should be used as its "level of concern" and
175// `true`; otherwise, return `"", false`.
176func (i *item) levelOfConcern(threshold Threshold) (string, bool) {
177 value, overflow := i.value.ToUint64()
178 if overflow {
179 return "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", true
180 }
181 alert := Threshold(float64(value) / i.scale)
182 if alert < threshold {
183 return "", false
184 }
185 if alert > 30 {
186 return "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", true
187 }
188 return stars[:int(alert)], true
189}
190
191func (i *item) CollectItems(items map[string]*item) {
192 items[i.symbol] = i

Callers 1

EmitMethod · 0.95

Calls 2

ThresholdTypeAlias · 0.85
ToUint64Method · 0.65

Tested by

no test coverage detected