Created
April 10, 2020 08:35
-
-
Save AvdLee/fa2bf376795b02c8ad59066355fecfff to your computer and use it in GitHub Desktop.
A quality check for a repository issues count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct IssuesCountQualityCheck: RepositoryQualityCheck { | |
let id: String = UUID().uuidString | |
let title = "Issues count" | |
let score: Int | |
init(repository: Repository) { | |
switch repository.issuesCount { | |
case 0..<10: | |
score = 100 | |
case 10..<20: | |
score = 75 | |
case 20..<30: | |
score = 50 | |
case 30..<40: | |
score = 25 | |
default: | |
score = 0 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
ClosedRange
Or using maximum count: