Commit d67b08e
authored
refactor: remove dead hourlyData and Night Owl from generateCoderProfile (JhaSourav07#3165)
## Description
Fixes JhaSourav07#2107
Removed dead `hourlyData` code and unreachable Night Owl classification
logic from `generateCoderProfile`. The `hourlyData` parameter was never
fetched from the backend API or passed to the function, resulting in
dead code that made nocturnal developers always misclassified as "Early
Builder".
**Why this change:**
- GitHub REST API only provides daily contribution granularity
- Hourly data would require querying individual commits (100s-1000s of
REST calls per user)
- Infeasible within 10-second serverless timeout constraints
- Not required for daily contribution visualization use cases
**Changes made:**
- Removed `hourlyData` from ProfileMetrics interface
- Removed dead `isNightOwl` logic block (was unreachable)
- Simplified from 4 to 3 profile types: Early Builder ☀ | Weekend
Warrior 🚀 | Consistent Runner 🏃♂️
- Added comprehensive JSDoc explaining why hourly data cannot be
implemented
- Updated badge logic to remove "Night Coder 🌙"
- All 14 DashboardClient tests passing
## Pillar
- [ ] 🎨 Pillar 1 — New Theme Design
- [ ] 📐 Pillar 2 — Geometric SVG Improvement
- [ ] 🕐 Pillar 3 — Timezone Logic Optimization
- [x] 🛠️ Other (Bug fix, refactoring, docs)
## Visual Preview
No UI changes — profile badge system now displays only 3 types instead
of 4 (removed Night Owl 🌙). Nocturnal developers now correctly
classified as "Consistent Runner 🏃♂️" instead of "Early Builder".
## Checklist before requesting a review:
- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally (dashboard compare mode with
multiple users).
- [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors.
- [x] My commits follow the Conventional Commits format
(`refactor(dashboard): ...`).
- [x] I have started the repo.
- [x] I have made sure that I have only one commit to merge in this PR.
- [x] All 14 DashboardClient tests pass with no regressions.
- [ ] (Recommended) I joined the CommitPulse Discord community for
contributor discussions, mentorship, and faster PR support.1 file changed
Lines changed: 23 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | 89 | | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
100 | 114 | | |
101 | | - | |
| 115 | + | |
102 | 116 | | |
103 | 117 | | |
104 | 118 | | |
| |||
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | 134 | | |
137 | 135 | | |
138 | | - | |
| 136 | + | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
144 | 142 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 143 | + | |
154 | 144 | | |
155 | 145 | | |
156 | 146 | | |
| |||
309 | 299 | | |
310 | 300 | | |
311 | 301 | | |
312 | | - | |
313 | | - | |
314 | | - | |
| 302 | + | |
315 | 303 | | |
316 | 304 | | |
317 | 305 | | |
| 306 | + | |
| 307 | + | |
318 | 308 | | |
319 | 309 | | |
320 | 310 | | |
| |||
0 commit comments