Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BUG]: Overview "Language Distribution" percentages are relative to the top-7 languages, not all repos

未关闭 适合新手
#402 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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
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
  1. Explore an org with more than 7 languages (e.g. AOSSIE-Org).
  2. Open Overview → Language Distribution.
  3. 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%

Image
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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AOSSIE-Org/OrgExplorer 的其他 Issue

查看 AOSSIE-Org/OrgExplorer 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。