Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG]: Bus Factor metric on Contributors page always evaluates to 0 (UNKNOWN) due to property mismatch

オープン 初心者向け
#230 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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
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:

  • computeBusFactor in src/services/analytics.js expects contributor objects to have a .contributions property:
    const total = contributors.reduce((s, c) => s + c.contributions, 0)
    
  • However, in buildAnalyticalModel (src/services/analytics.js), aggregate contributor objects in model.contributors store their commit counts under .totalContribs:
    contributorMap[c.login] = {
      login: c.login,
      totalContribs: 0,
      ...
    }
    
  • When ContributorsPage.jsx passes scopedContributors (from model.contributors) into computeBusFactor(scopedContributors), c.contributions is undefined.
  • As a result, 0 + undefined results in NaN. Since !NaN evaluates to true, if (!total) immediately triggers and returns { factor: 0, risk: 'unknown' } on every run.
Steps to Reproduce
  1. Open OrgExplorer and analyze any organization (e.g. AOSSIE-Org).
  2. Navigate to the Contributors page (/contributors).
  3. Look at the Bus Factor Risk card at the top left.
  4. Note that it displays Bus Factor: 0 and UNKNOWN instead 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AOSSIE-Org/OrgExplorer のほかの issue

AOSSIE-Org/OrgExplorer の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。