Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto Apto para principiantes
#399 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
github, javascript, node.js

Línea de trabajo

Empieza en src/services/analytics.js, alrededor de las líneas 194–198, y sigue cómo getTopRepositories() calcula las puntuaciones y selecciona los 10 primeros. El informe señala la contribución duplicada de watchers_count e incluye una reproducción en Node.js en f2_watchers.mjs; ejecútala para comparar las clasificaciones. El trabajo estará terminado cuando se elimine la ponderación duplicada de estrellas y se seleccione la lista corregida de los 10 primeros.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
JavaScript
Estrellas
45
Forks
148
Merge medio
5 d 20 h
PR fusionados (30 d)
27

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de AOSSIE-Org/OrgExplorer

Todos los issues de AOSSIE-Org/OrgExplorer

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.