Skip to content

AnalyticsService and ReputationService have zero test files between them #140

Description

@chonilius

There is no analytics.service.spec.ts, analytics.controller.spec.ts, reputation.service.spec.ts, or reputation.controller.spec.ts anywhere in the repository — a full find across src/ confirms neither the analytics nor reputation module has a single spec file, stub or otherwise. This is distinct from #21 (which is about reputation snapshots being vulnerable to gaming, a specific exploit concern) and from #56/#20 (auth module coverage, general near-zero-coverage framing) — this is the narrower, concrete fact that two entire modules containing non-trivial aggregation logic (heatmap bucketing, top-client ranking, completion-rate/on-time-delivery percentage math, org/language extraction) have literally no automated test of any kind.

Given both services independently reimplement similar bounty-filtering-and-aggregation logic (forContributor and computeAndSave compute overlapping stats — merge rate/completion rate, avg review time — from slightly different code paths), the lack of tests means these two implementations can silently drift apart with no test to catch the divergence.

Fix: add baseline spec files for both services covering at minimum the merge-rate/completion-rate math, the heatmap date-bucketing, and the empty-input (zero bounties) edge cases where both currently short-circuit to 0.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarchitectureArchitecture/design issuesecuritySecurity-related issuetestingTesting/QA infrastructurevery hardVery difficult task, expert-level effort required

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions