diff --git a/checks/evaluation/maintained.go b/checks/evaluation/maintained.go index bf4daeee897..3be51d577cb 100644 --- a/checks/evaluation/maintained.go +++ b/checks/evaluation/maintained.go @@ -67,9 +67,9 @@ func Maintained(name string, if f.Outcome == finding.OutcomePositive { switch f.Probe { case issueActivityByProjectMember.Probe: - numberOfIssuesUpdatedWithinThreshold = f.Values["numberOfIssuesUpdatedWithinThreshold"] + numberOfIssuesUpdatedWithinThreshold = f.Values[issueActivityByProjectMember.NoOfIssuesValue] case hasRecentCommits.Probe: - commitsWithinThreshold = f.Values["commitsWithinThreshold"] + commitsWithinThreshold = f.Values[hasRecentCommits.CommitsValue] } } } diff --git a/probes/hasRecentCommits/impl.go b/probes/hasRecentCommits/impl.go index fbd3abbd28e..8b4fb866003 100644 --- a/probes/hasRecentCommits/impl.go +++ b/probes/hasRecentCommits/impl.go @@ -29,7 +29,9 @@ import ( var fs embed.FS const ( - lookBackDays = 90 + lookBackDays = 90 + CommitsValue = "commitsWithinThreshold" + LookBackValue = "lookBackDays" ) const Probe = "hasRecentCommits" @@ -60,8 +62,8 @@ func Run(raw *checker.RawResults) ([]finding.Finding, string, error) { return nil, Probe, fmt.Errorf("create finding: %w", err) } f = f.WithValues(map[string]int{ - "commitsWithinThreshold": commitsWithinThreshold, - "lookBackDays": 90, + CommitsValue: commitsWithinThreshold, + LookBackValue: lookBackDays, }) findings = append(findings, *f) } else { diff --git a/probes/issueActivityByProjectMember/impl.go b/probes/issueActivityByProjectMember/impl.go index 493c075ac74..04d000cd4f2 100644 --- a/probes/issueActivityByProjectMember/impl.go +++ b/probes/issueActivityByProjectMember/impl.go @@ -30,7 +30,8 @@ import ( var fs embed.FS const ( - lookBackDays = 90 + lookBackDays = 90 + NoOfIssuesValue = "numberOfIssuesUpdatedWithinThreshold" ) const Probe = "issueActivityByProjectMember" @@ -60,7 +61,7 @@ func Run(raw *checker.RawResults) ([]finding.Finding, string, error) { return nil, Probe, fmt.Errorf("create finding: %w", err) } f = f.WithValues(map[string]int{ - "numberOfIssuesUpdatedWithinThreshold": numberOfIssuesUpdatedWithinThreshold, + NoOfIssuesValue: numberOfIssuesUpdatedWithinThreshold, }) findings = append(findings, *f) } else {