Skip to content

[GOOD FIRST ISSUE] Show total lines of code changed (additions + deletions) in PR Analytics widget #2454

@vbarik317-droid

Description

@vbarik317-droid

Summary
The PR Analytics widget is missing a "Lines Changed" stat — a simple but useful productivity signal. This task adds it as a new stat tile.

What needs to be done

  • Fetch additions and deletions from GitHub GraphQL API for merged PRs
  • Extend /api/metrics/prs response to include totalAdditions and totalDeletions
  • Add a new stat tile in the PR Analytics widget showing: +1,240 / -380
  • Color additions green and deletions red (matching GitHub's diff style)

Files to touch

  • src/app/api/metrics/prs/ (extend GraphQL query + API response)
  • PR Analytics widget component inside src/components/

Hints

  • GitHub GraphQL field: pullRequest { additions deletions }
  • Only sum values for merged PRs within the selected date range
  • Use toLocaleString() to format large numbers nicely

Good for
Someone comfortable with GraphQL and React looking to extend an existing feature.

Metadata

Metadata

Labels

gssoc:assignedGSSoC: Issue assigned to a contributor

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions