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

[BUG]: Top-repository scoring double-counts stars via watchers_count

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

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
github, javascript, node.js
領域
analytics, backend

調査の方向性

src/services/analytics.js の194〜198行あたりから、getTopRepositories() がスコアを計算し、上位10件を選択する方法を追ってください。レポートでは、watchers_count の寄与が重複していることを指摘し、f2_watchers.mjs に Node.js での再現コードを示しています。これを実行してランキングを比較してください。重複したスターの重み付けを削除し、修正後の上位10件を選択すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Bug Description

getTopRepositories() scores repos with:

score = stargazers_count + forks_count*2 + watchers_count*1.5 + activityBonus
(src/services/analytics.js, ~lines 194-198)

On the GitHub REST API, watchers_count is a duplicate of stargazers_count (both are the
star count); the real watcher/subscriber count is subscribers_count, which the repos list
endpoint doesn't even return. So the formula is effectively stars2.5 + forks2 + ... —
stars are silently weighted 2.5x, and the intended "watchers" signal contributes nothing.

This matters because getTopRepositories(..., 10) selects the top 10 repos per org in standard
(no-PAT) mode, and that selection feeds Repositories, Contributors, Network, Governance and
Analytics (AppContext.jsx lines 227, 282).

Live proof (2026-10-22):

  • GET api.github.com/repos/facebook/react -> stargazers_count 251692, watchers_count 251692
    (identical), subscribers_count 6610.
  • Running the real getTopRepositories on AOSSIE-Org's 87 repos, the buggy top-10 includes
    "Devr.AI" where a stars-only (corrected) top-10 picks "BabyNest" — the duplicate-stars term
    actually changes which repos are selected.
Steps to Reproduce
  1. Open api.github.com/repos/facebook/react and note watchers_count == stargazers_count,
    while subscribers_count is much smaller.

  2. Run the repro (imports the project's real getTopRepositories):

    node f2_watchers.mjs

    watchers_count === stargazers_count : true

    current top-10: [...,"OrgExplorer","Devr.AI"]

    corrected top-10: [...,"OrgExplorer","BabyNest"] <- ranking changes

Logs and Screenshots

=== F2.1 GitHub API fact (facebook/react) ===
stargazers_count : 251692
watchers_count : 251692 <-- identical to stars
subscribers_count: 6610 <-- the REAL watcher count
watchers_count === stargazers_count : true

=== F2.2 Top-10 selection for AOSSIE-Org (87 repos) ===
current (with watchers_count*1.5): [...,"OrgExplorer","Devr.AI"]
corrected(watchers term removed) : [...,"OrgExplorer","BabyNest"]
positions that differ: ["Devr.AI"]
📎 Image file:

Image
Environment Details
  • OS: macOS (API behaviour is platform-independent)
  • Browser: Chrome
  • Repo: main @ d91d2b8, src/services/analytics.js getTopRepositories()
  • Node.js: v20 (for the repro script)
  • Suggested fix: drop the watchers_count term (it duplicates stars). subscribers_count would
    be the real signal but isn't on the list endpoint, so removing the term is the simplest fix.
Impact

Medium - Feature works but has issues

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時間
マージ済み PR(30日)
27

環境構築

はじめの一歩

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

AOSSIE-Org/OrgExplorer のほかの issue

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

似ている issue

JavaScript の issue をもっと見る

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

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