File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,6 +201,8 @@ describe('computeTowers edge cases', () => {
201201 expect ( testTower . contributionCount ) . toBe ( 60 ) ;
202202 // Assert h > 0 (not ghost despite 0 normal contributions)
203203 expect ( testTower . h ) . toBeGreaterThan ( 0 ) ;
204+ // Assert intensityLevel is calculated correctly based on lines of code (60/60 = 100%, so intensity 4)
205+ expect ( testTower . intensityLevel ) . toBe ( 4 ) ;
204206 } ) ;
205207} ) ;
206208
Original file line number Diff line number Diff line change @@ -127,9 +127,9 @@ export function computeTowers(
127127 let intensityLevel = 0 ;
128128 if ( hasCommits ) {
129129 if ( maxCommits <= 4 ) {
130- intensityLevel = Math . min ( 4 , day . contributionCount ) ;
130+ intensityLevel = Math . min ( 4 , count ) ;
131131 } else {
132- const ratio = day . contributionCount / maxCommits ;
132+ const ratio = count / maxCommits ;
133133 if ( ratio <= 0.25 ) intensityLevel = 1 ;
134134 else if ( ratio <= 0.5 ) intensityLevel = 2 ;
135135 else if ( ratio <= 0.75 ) intensityLevel = 3 ;
You can’t perform that action at this time.
0 commit comments