MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / calculateTrend

Function calculateTrend

src/utils/git-dates.ts:93–104  ·  view source on GitHub ↗
(
  newestDate: Date | undefined
)

Source from the content-addressed store, hash-verified

91 * @returns Trend classification
92 */
93export function calculateTrend(
94 newestDate: Date | undefined
95): 'Rising' | 'Declining' | 'Stable' | undefined {
96 if (!newestDate) return undefined;
97
98 const now = new Date();
99 const daysDiff = Math.floor((now.getTime() - newestDate.getTime()) / (1000 * 60 * 60 * 24));
100
101 if (daysDiff <= 60) return 'Rising';
102 if (daysDiff >= 180) return 'Declining';
103 return 'Stable';
104}

Callers 1

getConsensusMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected