MCPcopy
hub / github.com/ossf/scorecard / NewWith

Function NewWith

finding/finding.go:129–139  ·  view source on GitHub ↗

NewWith create a finding with the desired location and outcome.

(efs embed.FS, probeID, text string, loc *Location,
	o Outcome,
)

Source from the content-addressed store, hash-verified

127
128// NewWith create a finding with the desired location and outcome.
129func NewWith(efs embed.FS, probeID, text string, loc *Location,
130 o Outcome,
131) (*Finding, error) {
132 f, err := New(efs, probeID)
133 if err != nil {
134 return nil, fmt.Errorf("finding.New: %w", err)
135 }
136
137 f = f.WithMessage(text).WithOutcome(o).WithLocation(loc)
138 return f, nil
139}
140
141// NewFalse create a false finding with the desired location.
142func NewFalse(efs embed.FS, probeID, text string, loc *Location,

Callers 15

RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
RunFunction · 0.92
codeReviewRunFunction · 0.92

Calls 4

WithLocationMethod · 0.80
WithOutcomeMethod · 0.80
WithMessageMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected