Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 make maintained values keys constants #3700

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions checks/evaluation/maintained.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions probes/hasRecentCommits/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import (
var fs embed.FS

const (
lookBackDays = 90
lookBackDays = 90
CommitsValue = "commitsWithinThreshold"
LookBackValue = "lookBackDays"
)

const Probe = "hasRecentCommits"
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions probes/issueActivityByProjectMember/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import (
var fs embed.FS

const (
lookBackDays = 90
lookBackDays = 90
NoOfIssuesValue = "numberOfIssuesUpdatedWithinThreshold"
)

const Probe = "issueActivityByProjectMember"
Expand Down Expand Up @@ -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 {
Expand Down
Loading