Contributor login constructor crashes analytical model construction

Open
#417 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Shubham-Padkonde is already working on this.

Since Oct 26, 2026.

  • #418 by @Shubham-Padkonde — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript, node.js
Domain
analytics, backend

Research direction

Start in src/services/analytics.js at buildAnalyticalModel() and read the existing analytical-model tests. Reproduce with the supplied input containing the login constructor, then add coverage for inherited-property names and aggregation across repositories. Done when construction returns the contributor with the expected contribution and the existing output shape and sorting remain intact.

Written by the indexing model from the issue text.

Description

bug
Bug Description

buildAnalyticalModel() crashes when a repository has a contributor whose login is constructor (a valid GitHub username). The contributor accumulator is a plain object, so contributorMap[login] finds an inherited property and skips initializing the contributor record. It then fails at entry.repos.push(...), aborting the analysis.

Steps to Reproduce

Run from the repository root with Node:

import { buildAnalyticalModel } from './src/services/analytics.js'
const repos = { demo: [{ name: 'repo', pushed_at: '2026-10-01T00:00:00Z', open_issues_count: 0 }] }
buildAnalyticalModel(
  [{ login: 'demo' }],
  repos,
  { 'demo/repo': [{ login: 'constructor', contributions: 1 }] },
  repos,
)

Expected: one contributor named constructor with one contribution.
Actual: TypeError: Cannot read properties of undefined (reading 'push').

Proposed fix

I plan to use a null-prototype object for this accumulator and extend the existing analytical-model tests to cover inherited-property names, including aggregation across repositories. This keeps the existing output shape and sorting behavior.

Environment: Windows, Node 24.15.0, current main. No browser credentials or live repository writes are needed to reproduce this.

AI disclosure: Codex (GPT-6) investigated and reproduced this issue and drafted this report on my behalf. This text has not had prior human review.

Dominant language
JavaScript
Stars
53
Forks
187
Avg merge
18m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/OrgExplorer

All issues in AOSSIE-Org/OrgExplorer

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.