[BUG]: computeHealthScore: NaN when repo.open_issues_count is missing and computeHealthScore: NaN when repo.pushed_at is missing or invalid
维护者通常 4 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- analytics
调研方向
从 analytics.js 中的 computeHealthScore 开始,跟踪 repo.open_issues_count 和 repo.pushed_at 在分数计算中的完整路径。使用这些字段的缺失值、null 值和无效值测试该函数,然后验证它返回的是有效整数而不是 NaN,并确认按 health-score 排序以及显示的值仍然可用。
由索引模型根据 Issue 内容生成。
描述
Bug Description
First Issue
In analytics.js
- the code guards against missing values with (repo.open_issues_count || 0)
- but the Next line it uses the raw repo.open_issues_count
- If open_issues_count is undefined or null: undefined / 10 evaluates to NaN, poisoning issueHealth and causing computeHealthScore to return NaN.
Second Issue
In analytics.js
- If repo.pushed_at is null, undefined, or invalid, new Date(repo.pushed_at) produces Invalid Date.
- Date.now() - NaN is NaN, causing activity and the entire score to become NaN.
Why it's a Problem?
- Silent Data Corruption: When open_issues_count is undefined or null (e.g., partial API responses, synthetic repos, or mock data), computeHealthScore returns NaN instead of an integer.
- Breaks Sorting & UI: In JavaScript, NaN in array sorting (b.healthScore - a.healthScore) yields NaN, which breaks the sort order across the table. In the UI, the repository health bar and cards render broken NaN% values.
- Clear Logical Defect: The author intended to guard against this on line 6 ((repo.open_issues_count || 0)), but accidentally bypassed the guard on line 7.
(It is not "Critical" only because it doesn't cause a fatal app crash or server downtime, but for the feature itself, it's a high-impact defect).
Environment Details
- OS: Windows 11
- Browser: Microsoft Edge
Impact
High - Major feature is broken
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- 主要语言
- JavaScript
- 星标
- 48
- 派生
- 169
- 平均合并
- 4 天 13 小时
- 30 天内合并 PR
- 25
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AOSSIE-Org/OrgExplorer 的其他 Issue
-
[BUG]: `fetchWithCache` crashes with `SyntaxError: Unexpected end of JSON input` when encountering empty repositories (HTTP 204 No Content)可能已有人在做 @Devnil434 于 6 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
AOSSIE-Org/OrgExplorer#433 · 1 条评论 ·
维护者通常 4 天内回复
-
[BUG]: Table sort headers can't be used from the keyboard and don't announce sort order可能已有人在做 @Simran-Sobhani 于 7 天前认领。 未关闭bug enhancement
难度 2/5 1-3 小时 新手友好度 78/100
AOSSIE-Org/OrgExplorer#419 · 2 条评论 ·
维护者通常 4 天内回复
-
[BUG]: Connect PAT modal saves invalid GitHub tokens without validation可能重新可做 @Prince-ES 于 10 天前认领,目前没有进行中的 PR。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
AOSSIE-Org/OrgExplorer#416 · 1 条评论 ·
维护者通常 4 天内回复
-
[BUG]: Avoid triggering Release Drafter for closed, unmerged pull requests可能已有人在做 @Praveena2809 于 7 天前认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 82/100
AOSSIE-Org/OrgExplorer#414 · 2 条评论 ·
维护者通常 4 天内回复
-
[BUG]: Overview "Language Distribution" percentages are relative to the top-7 languages, not all repos可能已有人在做 @Rohit270406 于 12 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
AOSSIE-Org/OrgExplorer#402 · 1 条评论 ·
维护者通常 4 天内回复
查看 AOSSIE-Org/OrgExplorer 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
help wanted Idea 💡 wdio-cli
难度 2/5 1-3 小时 新手友好度 66/100
webdriverio/webdriverio#16361 · 2 条评论 ·
维护者通常 1 天内回复
-
bug new-client
难度 1/5 1-3 小时 新手友好度 88/100
NUWCDIVNPT/stig-manager#2285 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
Fei2411/DeepSeek-Bot#922 · 1 个 reaction ·