[BUG]: Overview "Language Distribution" percentages are relative to the top-7 languages, not all repos
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, react
调研方向
检查 src/pages/OverviewPage.jsx 中 langMap、前七项列表和 langTotal 如何用于渲染 Language Distribution 的百分比。先阅读该组件并检查仓库数据的结构。issue 在 f5_language_pct.mjs 中包含一个确定性复现。完成标准是:显示的百分比以整个组织的仓库数量为分母,并与报告中的示例一致。
由索引模型根据 Issue 内容生成。
描述
Bug Description
On the Overview page, the Language Distribution bar/legend shows each language's percentage,
but the denominator is the sum of only the top-7 languages — not the total repo count — so
every percentage is overstated.
src/pages/OverviewPage.jsx:
const langs = Object.entries(langMap).sort((a,b)=>b[1]-a[1]).slice(0, 7) // top 7 only
const langTotal = langs.reduce((s,[,c])=>s+c, 0) // sum of top-7 ONLY
...
{Math.round(count / langTotal * 100)}%
Languages ranked 8th and beyond, and repos with no detected language, are excluded from
langTotal, so the shown percentages sum to 100% but represent share among the top 7, not
share of the organization.
Live example (AOSSIE-Org, 87 repos, 15 distinct languages + 14 repos with no language):
language UI shows true share (of 87)
JavaScript 30% 22%
TypeScript 24% 17%
Dart 17% 13%
Python 11% 8%
The top-7 denominator is 63, but it should be 87.
Steps to Reproduce
- Explore an org with more than 7 languages (e.g. AOSSIE-Org).
- Open Overview → Language Distribution.
- The percentages sum to 100% and overstate each language (JavaScript shows 30% vs a true 22%).
Deterministic check (replicates OverviewPage.jsx:59-62 on live data):
node f5_language_pct.mjs
Logs and Screenshots — drag in f5_evidence.png
=== F5 Overview Language Distribution — AOSSIE-Org ===
total repos : 87
distinct languages : 15 (repos with NO language: 14)
UI denominator (top-7 sum): 63 <-- should be 87 (all repos)
language UI shows true share
JavaScript 30% 22%
TypeScript 24% 17%
Dart 17% 13%
Python 11% 8%
Logs and Screenshots
=== F5 Overview Language Distribution — AOSSIE-Org ===
total repos : 87
distinct languages : 15 (repos with NO language: 14)
UI denominator (top-7 sum): 63 <-- should be 87 (all repos)
language UI shows true share
JavaScript 30% 22%
TypeScript 24% 17%
Dart 17% 13%
Python 11% 8%
Environment Details
- OS: macOS - Browser: Chrome - Repo: main @ d91d2b8
- File: src/pages/OverviewPage.jsx (lines 59-62 and ~249)
- Suggested fix: compute percentages against the total repo count (or the sum of ALL language
counts incl. a "no language" bucket), not the top-7 sum — or label the chart as
"share among top languages" so it isn't read as org-wide share.
Impact
Low - Minor inconvenience
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- 主要语言
- JavaScript
- 星标
- 45
- 派生
- 148
- 平均合并
- 5 天 20 小时
- 30 天内合并 PR
- 27
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AOSSIE-Org/OrgExplorer 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
AOSSIE-Org/OrgExplorer#401 ·
维护者通常 3 天内回复
-
[BUG]: Overview wrongly lists a successfully-loaded org as "could not be loaded" (case / duplicate)未关闭bug
难度 2/5 1-3 小时 新手友好度 82/100
AOSSIE-Org/OrgExplorer#400 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
AOSSIE-Org/OrgExplorer#399 ·
维护者通常 3 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 86/100
AOSSIE-Org/OrgExplorer#398 ·
维护者通常 3 天内回复
-
[BUG]: Eliminate render-blocking CDN stylesheet for SocialShareButton in index.html可能已有人在做 @garv3143 于 1 天前认领。 未关闭bug enhancement
难度 1/5 1-3 小时 新手友好度 72/100
AOSSIE-Org/OrgExplorer#395 · 1 条评论 ·
维护者通常 3 天内回复
查看 AOSSIE-Org/OrgExplorer 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
rescript-lang/rescript#8996 ·
维护者通常 1 天内回复
-
check:passed logos:add
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 1/5 1-3 小时 新手友好度 88/100
fossasia/visdom-dev#69 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 74/100
-
建议写成 1949-未关闭
难度 1/5 1 小时以内 新手友好度 62/100
DeanChensj/jiangshan-map#133 ·
维护者通常 1 天内回复