Skip to content

Commit 1e36377

Browse files
ismoilovdevmlclaude
andcommitted
fix: Add explicit type annotations to resolve TypeScript errors
- Add type annotations to array methods in dora-metrics.ts - Add return type annotation to map function in trend-analysis.ts - Fix implicit 'any' type errors for CI/CD type checking This resolves all TypeScript compilation errors in GitHub Actions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 6faa708 commit 1e36377

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/lib/dora-metrics.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,19 @@ export async function calculateDoraMetrics(
128128
},
129129
});
130130

131-
const successfulDeployments = deployments.filter(d => d.status === 'success');
132-
const failedDeployments = deployments.filter(d => d.status === 'failed');
131+
const successfulDeployments = deployments.filter((d) => d.status === 'success');
132+
const failedDeployments = deployments.filter((d) => d.status === 'failed');
133133

134134
const daysDiff = Math.max(1, (endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24));
135135
const deploymentsPerDay = deployments.length / daysDiff;
136136

137137
// Calculate lead time for changes (commit to deployment time)
138138
const leadTimes = successfulDeployments
139-
.filter(d => d.duration)
140-
.map(d => d.duration!);
139+
.filter((d) => d.duration)
140+
.map((d) => d.duration!);
141141

142142
const avgLeadTime = leadTimes.length > 0
143-
? leadTimes.reduce((sum, val) => sum + val, 0) / leadTimes.length
143+
? leadTimes.reduce((sum: number, val: number) => sum + val, 0) / leadTimes.length
144144
: 0;
145145

146146
const medianLeadTime = calculateMedian(leadTimes);
@@ -161,11 +161,11 @@ export async function calculateDoraMetrics(
161161
});
162162

163163
const recoveryTimes = incidents
164-
.filter(i => i.duration)
165-
.map(i => i.duration!);
164+
.filter((i) => i.duration)
165+
.map((i) => i.duration!);
166166

167167
const avgMttr = recoveryTimes.length > 0
168-
? recoveryTimes.reduce((sum, val) => sum + val, 0) / recoveryTimes.length
168+
? recoveryTimes.reduce((sum: number, val: number) => sum + val, 0) / recoveryTimes.length
169169
: 0;
170170

171171
// Calculate change failure rate

src/lib/trend-analysis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export async function getTrendAnalysis(
110110
take: limit,
111111
});
112112

113-
const points: TrendPoint[] = data.map((d) => ({
113+
const points: TrendPoint[] = data.map((d): TrendPoint => ({
114114
timestamp: d.timestamp,
115115
value: d.value,
116116
metadata: d.metadata as Record<string, unknown>,

0 commit comments

Comments
 (0)