-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fixed [Codacy] coverage examples and improved unknown coverage handling #2102
Conversation
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cheers for having a look at this
badgeData.text[1] = res | ||
badgeData.colorscheme = coveragePercentageColor(parseInt(res)) | ||
const coverage = parseInt(res) | ||
if (isNaN(coverage)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a case where it is better to use Number.isNaN() in preference to isNaN()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! 👍
The project used on the homepage doesn't have any relevant coverage data:
I've switched it to one that does:
As you can see above the unknown coverage case is handled pretty poorly, with the exclamation mark and the bright green colour. From now on, such a badge would render as: