[BUG]: Bus Factor metric on Contributors page always evaluates to 0 (UNKNOWN) due to property mismatch
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
調査の方向性
src/services/analytics.js で computeBusFactor と buildAnalyticalModel を読むことから始め、次に scopedContributors を使用して ContributorsPage.jsx からの呼び出しを追跡します。分析済みの組織を使って /contributors でメトリクスを再現し、Bus Factor Risk カードに 0 と UNKNOWN ではなく、計算された factor と risk が表示されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Bug Description
On the Contributors page (/contributors), the Bus Factor Risk metric card always evaluates to Bus Factor: 0 with risk level UNKNOWN and subtitle 0 contributors own over 50% of total commits. Knowledge distribution is heavily skewed., regardless of the organization analyzed.
This is caused by a property name mismatch between model.contributors and computeBusFactor:
computeBusFactorinsrc/services/analytics.jsexpects contributor objects to have a.contributionsproperty:const total = contributors.reduce((s, c) => s + c.contributions, 0)- However, in
buildAnalyticalModel(src/services/analytics.js), aggregate contributor objects inmodel.contributorsstore their commit counts under.totalContribs:contributorMap[c.login] = { login: c.login, totalContribs: 0, ... } - When
ContributorsPage.jsxpassesscopedContributors(frommodel.contributors) intocomputeBusFactor(scopedContributors),c.contributionsisundefined. - As a result,
0 + undefinedresults inNaN. Since!NaNevaluates totrue,if (!total)immediately triggers and returns{ factor: 0, risk: 'unknown' }on every run.
Steps to Reproduce
- Open OrgExplorer and analyze any organization (e.g.
AOSSIE-Org). - Navigate to the Contributors page (
/contributors). - Look at the Bus Factor Risk card at the top left.
- Note that it displays
Bus Factor: 0andUNKNOWNinstead of calculating the contributor concentration.
Logs and Screenshots
Observed behavior in the UI:
- Title:
Bus Factor: 0 - Badge:
UNKNOWN - Subtitle:
0 contributors own over 50% of total commits. Knowledge distribution is heavily skewed. - Risk Level:
UNKNOWN - Progress bar:
25%
Proposed fix in src/services/analytics.js:
export function computeBusFactor(contributors = []) {
if (!contributors.length) return { factor: 0, risk: 'unknown' }
const getCount = c => (typeof c === 'number' ? c : (c.contributions ?? c.totalContribs ?? 0))
const total = contributors.reduce((s, c) => s + getCount(c), 0)
if (!total) return { factor: 0, risk: 'unknown' }
let cum = 0
for (let i = 0; i < contributors.length; i++) {
cum += getCount(contributors[i])
if (cum / total > 0.5) {
const f = i + 1
return { factor: f, risk: f <= 1 ? 'critical' : f <= 2 ? 'high' : 'healthy' }
}
}
return { factor: contributors.length, risk: 'healthy' }
}
Environment Details
- OS: macOS / Linux / Windows
- Browser: Chrome / Firefox / Safari
- Application version: 1.0.0 (main branch)
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
- スター
- 37
- フォーク
- 107
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/OrgExplorer のほかの issue
-
[BUG]: Analytics page keeps the previous organization's pull request data after exploring a new orgオープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AOSSIE-Org/OrgExplorer#272 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AOSSIE-Org/OrgExplorer#260 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
AOSSIE-Org/OrgExplorer#258 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: Rate Limit Header Coercion to `0` / False Quota Exhaustion対応中かも @Devnil434 が 7 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AOSSIE-Org/OrgExplorer#251 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: CSV exports produce malformed files when fields contain commas or quotes対応中かも @Dotify71 が 9 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/OrgExplorer#245 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
AOSSIE-Org/OrgExplorer の issue をすべて見る
似ている issue
-
新讀者走讀回報,照著一篇文章實際操作オープンdocumentation good first issue help wanted
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
automated issue report
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
lirantal/discoprint#29 ·
メンテナーはふだん 1 日以内に返信
-
feature-request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
louislam/uptime-kuma#7914 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Code Cleanup dependencies
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
ProjectSidewalk/SidewalkWebpage#5609 ·
メンテナーはふだん 1 日以内に返信
-
help wanted javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
OWASP/cornucopia#3538 ·
メンテナーはふだん 1 日以内に返信