@aiready/cli 0.10.3 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -87,11 +87,13 @@ async function analyzeUnified(options) {
87
87
  if (options.progressCallback) {
88
88
  options.progressCallback({ tool: "patterns", data: patternResult });
89
89
  }
90
- result.patternDetect = {
90
+ const output = {
91
91
  results: sortBySeverity(patternResult.results),
92
92
  summary: patternResult.summary || {},
93
93
  duplicates: patternResult.duplicates || []
94
94
  };
95
+ result[import_core.ToolName.PatternDetect] = output;
96
+ result.patternDetect = output;
95
97
  result.summary.totalIssues += patternResult.results.reduce(
96
98
  (sum, file) => sum + file.issues.length,
97
99
  0
@@ -109,10 +111,12 @@ async function analyzeUnified(options) {
109
111
  return b.fragmentationScore - a.fragmentationScore;
110
112
  });
111
113
  const { generateSummary: genContextSummary } = await import("@aiready/context-analyzer");
112
- result.contextAnalyzer = {
114
+ const output = {
113
115
  results: sorted,
114
116
  summary: genContextSummary(sorted)
115
117
  };
118
+ result[import_core.ToolName.ContextAnalyzer] = output;
119
+ result.contextAnalyzer = output;
116
120
  result.summary.totalIssues += sorted.length;
117
121
  }
118
122
  if (tools.includes("consistency")) {
@@ -126,7 +130,7 @@ async function analyzeUnified(options) {
126
130
  if (options.progressCallback) {
127
131
  options.progressCallback({ tool: "consistency", data: report });
128
132
  }
129
- result.consistency = {
133
+ result[import_core.ToolName.NamingConsistency] = {
130
134
  results: report.results ? sortBySeverity(report.results) : [],
131
135
  summary: report.summary
132
136
  };
@@ -143,11 +147,12 @@ async function analyzeUnified(options) {
143
147
  if (options.progressCallback) {
144
148
  options.progressCallback({ tool: "doc-drift", data: report });
145
149
  }
146
- result.docDrift = {
147
- results: report.results || [],
150
+ result[import_core.ToolName.DocDrift] = {
151
+ results: report.results || report.issues || [],
148
152
  summary: report.summary || {}
149
153
  };
150
- result.summary.totalIssues += report.issues?.length || 0;
154
+ const issueCount = report.issues?.length || (report.results ? report.results.length : 0);
155
+ result.summary.totalIssues += issueCount;
151
156
  }
152
157
  if (tools.includes("deps-health")) {
153
158
  const { analyzeDeps } = await import("@aiready/deps");
@@ -160,11 +165,12 @@ async function analyzeUnified(options) {
160
165
  if (options.progressCallback) {
161
166
  options.progressCallback({ tool: "deps-health", data: report });
162
167
  }
163
- result.dependencyHealth = {
164
- results: report.results || [],
168
+ result[import_core.ToolName.DependencyHealth] = {
169
+ results: report.results || report.issues || [],
165
170
  summary: report.summary || {}
166
171
  };
167
- result.summary.totalIssues += report.issues?.length || 0;
172
+ const issueCount = report.issues?.length || (report.results ? report.results.length : 0);
173
+ result.summary.totalIssues += issueCount;
168
174
  }
169
175
  if (tools.includes("ai-signal-clarity")) {
170
176
  const { analyzeAiSignalClarity } = await import("@aiready/ai-signal-clarity");
@@ -177,13 +183,13 @@ async function analyzeUnified(options) {
177
183
  if (options.progressCallback) {
178
184
  options.progressCallback({ tool: "ai-signal-clarity", data: report });
179
185
  }
180
- result.aiSignalClarity = {
186
+ result[import_core.ToolName.AiSignalClarity] = {
181
187
  ...report,
182
- results: report.results || [],
188
+ results: report.results || report.issues || [],
183
189
  summary: report.summary || {}
184
190
  };
185
- result.summary.totalIssues += report.results?.reduce(
186
- (sum, r) => sum + (r.issues?.length || 0),
191
+ result.summary.totalIssues += (report.results || report.issues)?.reduce(
192
+ (sum, r) => sum + (r.issues?.length || 1),
187
193
  0
188
194
  ) || 0;
189
195
  }
@@ -198,12 +204,12 @@ async function analyzeUnified(options) {
198
204
  if (options.progressCallback) {
199
205
  options.progressCallback({ tool: "agent-grounding", data: report });
200
206
  }
201
- result.agentGrounding = {
207
+ result[import_core.ToolName.AgentGrounding] = {
202
208
  ...report,
203
- results: report.results || [],
209
+ results: report.results || report.issues || [],
204
210
  summary: report.summary || {}
205
211
  };
206
- result.summary.totalIssues += report.issues?.length || 0;
212
+ result.summary.totalIssues += (report.issues || report.results || []).length;
207
213
  }
208
214
  if (tools.includes("testability")) {
209
215
  const { analyzeTestability } = await import("@aiready/testability");
@@ -216,12 +222,12 @@ async function analyzeUnified(options) {
216
222
  if (options.progressCallback) {
217
223
  options.progressCallback({ tool: "testability", data: report });
218
224
  }
219
- result.testability = {
225
+ result[import_core.ToolName.TestabilityIndex] = {
220
226
  ...report,
221
- results: report.results || [],
227
+ results: report.results || report.issues || [],
222
228
  summary: report.summary || {}
223
229
  };
224
- result.summary.totalIssues += report.issues?.length || 0;
230
+ result.summary.totalIssues += (report.issues || report.results || []).length;
225
231
  }
226
232
  if (tools.includes("change-amplification")) {
227
233
  const { analyzeChangeAmplification } = await import("@aiready/change-amplification");
@@ -234,7 +240,7 @@ async function analyzeUnified(options) {
234
240
  if (options.progressCallback) {
235
241
  options.progressCallback({ tool: "change-amplification", data: report });
236
242
  }
237
- result.changeAmplification = {
243
+ result[import_core.ToolName.ChangeAmplification] = {
238
244
  results: report.results || [],
239
245
  summary: report.summary || {}
240
246
  };
@@ -245,14 +251,15 @@ async function analyzeUnified(options) {
245
251
  }
246
252
  async function scoreUnified(results, options) {
247
253
  const toolScores = /* @__PURE__ */ new Map();
248
- if (results.patternDetect) {
254
+ if (results[import_core.ToolName.PatternDetect]) {
255
+ const data = results[import_core.ToolName.PatternDetect];
249
256
  const { calculatePatternScore } = await import("@aiready/pattern-detect");
250
257
  try {
251
258
  const patternScore = calculatePatternScore(
252
- results.patternDetect.duplicates,
253
- results.patternDetect.results?.length || 0
259
+ data.duplicates,
260
+ data.results?.length || 0
254
261
  );
255
- const wastedTokens = results.patternDetect.duplicates.reduce(
262
+ const wastedTokens = data.duplicates.reduce(
256
263
  (sum, d) => sum + (d.tokenCost || 0),
257
264
  0
258
265
  );
@@ -265,15 +272,16 @@ async function scoreUnified(results, options) {
265
272
  chattiness: 0
266
273
  }
267
274
  });
268
- toolScores.set("pattern-detect", patternScore);
275
+ toolScores.set(import_core.ToolName.PatternDetect, patternScore);
269
276
  } catch (err) {
270
277
  void err;
271
278
  }
272
279
  }
273
- if (results.contextAnalyzer) {
280
+ if (results[import_core.ToolName.ContextAnalyzer]) {
281
+ const data = results[import_core.ToolName.ContextAnalyzer];
274
282
  const { calculateContextScore } = await import("@aiready/context-analyzer");
275
283
  try {
276
- const ctxSummary = results.contextAnalyzer.summary;
284
+ const ctxSummary = data.summary;
277
285
  const contextScore = calculateContextScore(ctxSummary);
278
286
  contextScore.tokenBudget = (0, import_core.calculateTokenBudget)({
279
287
  totalContextTokens: ctxSummary.totalTokens,
@@ -283,56 +291,62 @@ async function scoreUnified(results, options) {
283
291
  chattiness: 0
284
292
  }
285
293
  });
286
- toolScores.set("context-analyzer", contextScore);
294
+ toolScores.set(import_core.ToolName.ContextAnalyzer, contextScore);
287
295
  } catch (err) {
288
296
  void err;
289
297
  }
290
298
  }
291
- if (results.consistency) {
299
+ if (results[import_core.ToolName.NamingConsistency]) {
300
+ const data = results[import_core.ToolName.NamingConsistency];
292
301
  const { calculateConsistencyScore } = await import("@aiready/consistency");
293
302
  try {
294
- const issues = results.consistency.results?.flatMap((r) => r.issues) || [];
295
- const totalFiles = results.consistency.summary?.filesAnalyzed || 0;
303
+ const issues = data.results?.flatMap((r) => r.issues) || [];
304
+ const totalFiles = data.summary?.filesAnalyzed || 0;
296
305
  const consistencyScore = calculateConsistencyScore(issues, totalFiles);
297
- toolScores.set("consistency", consistencyScore);
306
+ toolScores.set(import_core.ToolName.NamingConsistency, consistencyScore);
298
307
  } catch (err) {
299
308
  void err;
300
309
  }
301
310
  }
302
- if (results.aiSignalClarity) {
311
+ if (results[import_core.ToolName.AiSignalClarity]) {
303
312
  const { calculateAiSignalClarityScore } = await import("@aiready/ai-signal-clarity");
304
313
  try {
305
- const hrScore = calculateAiSignalClarityScore(results.aiSignalClarity);
306
- toolScores.set("ai-signal-clarity", hrScore);
314
+ const hrScore = calculateAiSignalClarityScore(
315
+ results[import_core.ToolName.AiSignalClarity]
316
+ );
317
+ toolScores.set(import_core.ToolName.AiSignalClarity, hrScore);
307
318
  } catch (err) {
308
319
  void err;
309
320
  }
310
321
  }
311
- if (results.agentGrounding) {
322
+ if (results[import_core.ToolName.AgentGrounding]) {
312
323
  const { calculateGroundingScore } = await import("@aiready/agent-grounding");
313
324
  try {
314
- const agScore = calculateGroundingScore(results.agentGrounding);
315
- toolScores.set("agent-grounding", agScore);
325
+ const agScore = calculateGroundingScore(results[import_core.ToolName.AgentGrounding]);
326
+ toolScores.set(import_core.ToolName.AgentGrounding, agScore);
316
327
  } catch (err) {
317
328
  void err;
318
329
  }
319
330
  }
320
- if (results.testability) {
331
+ if (results[import_core.ToolName.TestabilityIndex]) {
321
332
  const { calculateTestabilityScore } = await import("@aiready/testability");
322
333
  try {
323
- const tbScore = calculateTestabilityScore(results.testability);
324
- toolScores.set("testability", tbScore);
334
+ const tbScore = calculateTestabilityScore(
335
+ results[import_core.ToolName.TestabilityIndex]
336
+ );
337
+ toolScores.set(import_core.ToolName.TestabilityIndex, tbScore);
325
338
  } catch (err) {
326
339
  void err;
327
340
  }
328
341
  }
329
- if (results.docDrift) {
330
- toolScores.set("doc-drift", {
331
- toolName: "doc-drift",
332
- score: results.docDrift.summary.score || results.docDrift.summary.totalScore || 0,
333
- rawMetrics: results.docDrift.summary,
342
+ if (results[import_core.ToolName.DocDrift]) {
343
+ const data = results[import_core.ToolName.DocDrift];
344
+ toolScores.set(import_core.ToolName.DocDrift, {
345
+ toolName: import_core.ToolName.DocDrift,
346
+ score: data.summary.score || data.summary.totalScore || 0,
347
+ rawMetrics: data.summary,
334
348
  factors: [],
335
- recommendations: (results.docDrift.summary.recommendations || []).map(
349
+ recommendations: (data.summary.recommendations || []).map(
336
350
  (action) => ({
337
351
  action,
338
352
  estimatedImpact: 5,
@@ -341,30 +355,36 @@ async function scoreUnified(results, options) {
341
355
  )
342
356
  });
343
357
  }
344
- if (results.dependencyHealth) {
345
- toolScores.set("dependency-health", {
346
- toolName: "dependency-health",
347
- score: results.dependencyHealth.summary.score || 0,
348
- rawMetrics: results.dependencyHealth.summary,
358
+ if (results[import_core.ToolName.DependencyHealth]) {
359
+ const data = results[import_core.ToolName.DependencyHealth];
360
+ toolScores.set(import_core.ToolName.DependencyHealth, {
361
+ toolName: import_core.ToolName.DependencyHealth,
362
+ score: data.summary.score || 0,
363
+ rawMetrics: data.summary,
349
364
  factors: [],
350
- recommendations: (results.dependencyHealth.summary.recommendations || []).map((action) => ({
351
- action,
352
- estimatedImpact: 5,
353
- priority: "medium"
354
- }))
365
+ recommendations: (data.summary.recommendations || []).map(
366
+ (action) => ({
367
+ action,
368
+ estimatedImpact: 5,
369
+ priority: "medium"
370
+ })
371
+ )
355
372
  });
356
373
  }
357
- if (results.changeAmplification) {
358
- toolScores.set("change-amplification", {
359
- toolName: "change-amplification",
360
- score: results.changeAmplification.summary.score || 0,
361
- rawMetrics: results.changeAmplification.summary,
374
+ if (results[import_core.ToolName.ChangeAmplification]) {
375
+ const data = results[import_core.ToolName.ChangeAmplification];
376
+ toolScores.set(import_core.ToolName.ChangeAmplification, {
377
+ toolName: import_core.ToolName.ChangeAmplification,
378
+ score: data.summary.score || 0,
379
+ rawMetrics: data.summary,
362
380
  factors: [],
363
- recommendations: (results.changeAmplification.summary.recommendations || []).map((action) => ({
364
- action,
365
- estimatedImpact: 5,
366
- priority: "medium"
367
- }))
381
+ recommendations: (data.summary.recommendations || []).map(
382
+ (action) => ({
383
+ action,
384
+ estimatedImpact: 5,
385
+ priority: "medium"
386
+ })
387
+ )
368
388
  });
369
389
  }
370
390
  if (toolScores.size === 0) {
@@ -886,18 +906,18 @@ async function scanAction(directory, options) {
886
906
  topFiles.forEach(([file, issues], idx) => {
887
907
  const counts = issues.reduce(
888
908
  (acc, it) => {
889
- const s = (it.severity || "info").toLowerCase();
909
+ const s = (it.severity || import_core3.Severity.Info).toLowerCase();
890
910
  acc[s] = (acc[s] || 0) + 1;
891
911
  return acc;
892
912
  },
893
913
  {}
894
914
  );
895
915
  const sample = issues.find(
896
- (it) => it.severity === "critical" || it.severity === "major"
916
+ (it) => it.severity === import_core3.Severity.Critical || it.severity === import_core3.Severity.Major
897
917
  ) || issues[0];
898
918
  const sampleMsg = sample ? ` \u2014 ${sample.message}` : "";
899
919
  console.log(
900
- ` ${idx + 1}. ${file} \u2014 ${issues.length} issue(s) (critical:${counts.critical || 0} major:${counts.major || 0} minor:${counts.minor || 0} info:${counts.info || 0})${sampleMsg}`
920
+ ` ${idx + 1}. ${file} \u2014 ${issues.length} issue(s) (critical:${counts[import_core3.Severity.Critical] || 0} major:${counts[import_core3.Severity.Major] || 0} minor:${counts[import_core3.Severity.Minor] || 0} info:${counts[import_core3.Severity.Info] || 0})${sampleMsg}`
901
921
  );
902
922
  });
903
923
  const remaining = files.length - topFiles.length;
@@ -972,25 +992,25 @@ async function scanAction(directory, options) {
972
992
  console.log(
973
993
  ` Total issues (all tools): ${import_chalk3.default.bold(String(results.summary.totalIssues || 0))}`
974
994
  );
975
- if (results.patternDetect) {
995
+ if (results[import_core3.ToolName.PatternDetect]) {
976
996
  console.log(
977
- ` Duplicate patterns found: ${import_chalk3.default.bold(String(results.patternDetect.duplicates?.length || 0))}`
997
+ ` Duplicate patterns found: ${import_chalk3.default.bold(String(results[import_core3.ToolName.PatternDetect].duplicates?.length || 0))}`
978
998
  );
979
999
  console.log(
980
- ` Pattern files with issues: ${import_chalk3.default.bold(String(results.patternDetect.results.length || 0))}`
1000
+ ` Pattern files with issues: ${import_chalk3.default.bold(String(results[import_core3.ToolName.PatternDetect].results.length || 0))}`
981
1001
  );
982
1002
  }
983
- if (results.contextAnalyzer)
1003
+ if (results[import_core3.ToolName.ContextAnalyzer])
984
1004
  console.log(
985
- ` Context issues: ${import_chalk3.default.bold(String(results.contextAnalyzer.results.length || 0))}`
1005
+ ` Context issues: ${import_chalk3.default.bold(String(results[import_core3.ToolName.ContextAnalyzer].results.length || 0))}`
986
1006
  );
987
- if (results.consistency)
1007
+ if (results[import_core3.ToolName.NamingConsistency])
988
1008
  console.log(
989
- ` Consistency issues: ${import_chalk3.default.bold(String(results.consistency.summary?.totalIssues || 0))}`
1009
+ ` Consistency issues: ${import_chalk3.default.bold(String(results[import_core3.ToolName.NamingConsistency].summary?.totalIssues || 0))}`
990
1010
  );
991
- if (results.changeAmplification)
1011
+ if (results[import_core3.ToolName.ChangeAmplification])
992
1012
  console.log(
993
- ` Change amplification: ${import_chalk3.default.bold(String(results.changeAmplification.summary?.score || 0))}/100`
1013
+ ` Change amplification: ${import_chalk3.default.bold(String(results[import_core3.ToolName.ChangeAmplification].summary?.score || 0))}/100`
994
1014
  );
995
1015
  console.log(import_chalk3.default.cyan("===========================\n"));
996
1016
  const elapsedTime = (0, import_core3.getElapsedTime)(startTime);
@@ -1130,6 +1150,78 @@ async function scanAction(directory, options) {
1130
1150
  }
1131
1151
  }
1132
1152
  }
1153
+ const mapToUnifiedReport = (res, scoring) => {
1154
+ const allResults = [];
1155
+ let totalFilesSet = /* @__PURE__ */ new Set();
1156
+ let criticalCount = 0;
1157
+ let majorCount = 0;
1158
+ const collect = (spokeRes, defaultType = import_core3.IssueType.AiSignalClarity) => {
1159
+ if (!spokeRes || !spokeRes.results) return;
1160
+ spokeRes.results.forEach((r) => {
1161
+ const fileName = r.fileName || r.file || "unknown";
1162
+ totalFilesSet.add(fileName);
1163
+ const normalizedResult = {
1164
+ fileName,
1165
+ issues: [],
1166
+ metrics: r.metrics || { tokenCost: r.tokenCost || 0 }
1167
+ };
1168
+ if (r.issues && Array.isArray(r.issues)) {
1169
+ r.issues.forEach((i) => {
1170
+ const normalizedIssue = typeof i === "string" ? {
1171
+ type: defaultType,
1172
+ severity: r.severity || import_core3.Severity.Info,
1173
+ message: i,
1174
+ location: { file: fileName, line: 1 }
1175
+ } : {
1176
+ type: i.type || defaultType,
1177
+ severity: i.severity || r.severity || import_core3.Severity.Info,
1178
+ message: i.message || String(i),
1179
+ location: i.location || { file: fileName, line: 1 },
1180
+ suggestion: i.suggestion
1181
+ };
1182
+ if (normalizedIssue.severity === import_core3.Severity.Critical || normalizedIssue.severity === "critical")
1183
+ criticalCount++;
1184
+ if (normalizedIssue.severity === import_core3.Severity.Major || normalizedIssue.severity === "major")
1185
+ majorCount++;
1186
+ normalizedResult.issues.push(normalizedIssue);
1187
+ });
1188
+ } else if (r.severity) {
1189
+ const normalizedIssue = {
1190
+ type: defaultType,
1191
+ severity: r.severity,
1192
+ message: r.message || "General issue",
1193
+ location: { file: fileName, line: 1 }
1194
+ };
1195
+ if (normalizedIssue.severity === import_core3.Severity.Critical || normalizedIssue.severity === "critical")
1196
+ criticalCount++;
1197
+ if (normalizedIssue.severity === import_core3.Severity.Major || normalizedIssue.severity === "major")
1198
+ majorCount++;
1199
+ normalizedResult.issues.push(normalizedIssue);
1200
+ }
1201
+ allResults.push(normalizedResult);
1202
+ });
1203
+ };
1204
+ collect(res[import_core3.ToolName.PatternDetect], import_core3.IssueType.DuplicatePattern);
1205
+ collect(res[import_core3.ToolName.ContextAnalyzer], import_core3.IssueType.ContextFragmentation);
1206
+ collect(res[import_core3.ToolName.NamingConsistency], import_core3.IssueType.NamingInconsistency);
1207
+ collect(res[import_core3.ToolName.DocDrift], import_core3.IssueType.DocDrift);
1208
+ collect(res[import_core3.ToolName.DependencyHealth], import_core3.IssueType.DependencyHealth);
1209
+ collect(res[import_core3.ToolName.AiSignalClarity], import_core3.IssueType.AiSignalClarity);
1210
+ collect(res[import_core3.ToolName.AgentGrounding], import_core3.IssueType.AgentNavigationFailure);
1211
+ collect(res[import_core3.ToolName.TestabilityIndex], import_core3.IssueType.LowTestability);
1212
+ collect(res[import_core3.ToolName.ChangeAmplification], import_core3.IssueType.ChangeAmplification);
1213
+ return {
1214
+ ...res,
1215
+ results: allResults,
1216
+ summary: {
1217
+ ...res.summary,
1218
+ totalFiles: totalFilesSet.size,
1219
+ criticalIssues: criticalCount,
1220
+ majorIssues: majorCount
1221
+ },
1222
+ scoring
1223
+ };
1224
+ };
1133
1225
  const outputFormat = options.output || finalOptions.output?.format || "console";
1134
1226
  const userOutputFile = options.outputFile || finalOptions.output?.file;
1135
1227
  if (outputFormat === "json") {
@@ -1141,8 +1233,7 @@ async function scanAction(directory, options) {
1141
1233
  resolvedDir
1142
1234
  );
1143
1235
  const outputData = {
1144
- ...results,
1145
- scoring: scoringResult,
1236
+ ...mapToUnifiedReport(results, scoringResult),
1146
1237
  repository: repoMetadata
1147
1238
  };
1148
1239
  (0, import_core3.handleJSONOutput)(
@@ -1167,8 +1258,7 @@ async function scanAction(directory, options) {
1167
1258
  resolvedDir
1168
1259
  );
1169
1260
  const outputData = {
1170
- ...results,
1171
- scoring: scoringResult,
1261
+ ...mapToUnifiedReport(results, scoringResult),
1172
1262
  repository: repoMetadata
1173
1263
  };
1174
1264
  try {
@@ -1209,9 +1299,9 @@ async function scanAction(directory, options) {
1209
1299
  `::notice::AI Readiness Score: ${scoringResult.overall}/100 (threshold: ${threshold})`
1210
1300
  );
1211
1301
  }
1212
- if (results.patternDetect) {
1213
- const criticalPatterns = results.patternDetect.results.flatMap(
1214
- (p) => p.issues.filter((i) => i.severity === "critical")
1302
+ if (results[import_core3.ToolName.PatternDetect]) {
1303
+ const criticalPatterns = results[import_core3.ToolName.PatternDetect].results.flatMap(
1304
+ (p) => p.issues.filter((i) => i.severity === import_core3.Severity.Critical)
1215
1305
  );
1216
1306
  criticalPatterns.slice(0, 10).forEach((issue) => {
1217
1307
  console.log(
@@ -1231,25 +1321,25 @@ async function scanAction(directory, options) {
1231
1321
  const minSeverity = severityLevels[failOnLevel] || 4;
1232
1322
  let criticalCount = 0;
1233
1323
  let majorCount = 0;
1234
- if (results.patternDetect) {
1235
- results.patternDetect.results.forEach((p) => {
1324
+ if (results[import_core3.ToolName.PatternDetect]) {
1325
+ results[import_core3.ToolName.PatternDetect].results.forEach((p) => {
1236
1326
  p.issues.forEach((i) => {
1237
- if (i.severity === "critical") criticalCount++;
1238
- if (i.severity === "major") majorCount++;
1327
+ if (i.severity === import_core3.Severity.Critical) criticalCount++;
1328
+ if (i.severity === import_core3.Severity.Major) majorCount++;
1239
1329
  });
1240
1330
  });
1241
1331
  }
1242
- if (results.contextAnalyzer) {
1243
- results.contextAnalyzer.results.forEach((c) => {
1244
- if (c.severity === "critical") criticalCount++;
1245
- if (c.severity === "major") majorCount++;
1332
+ if (results[import_core3.ToolName.ContextAnalyzer]) {
1333
+ results[import_core3.ToolName.ContextAnalyzer].results.forEach((c) => {
1334
+ if (c.severity === import_core3.Severity.Critical) criticalCount++;
1335
+ if (c.severity === import_core3.Severity.Major) majorCount++;
1246
1336
  });
1247
1337
  }
1248
- if (results.consistency) {
1249
- results.consistency.results.forEach((r) => {
1338
+ if (results[import_core3.ToolName.NamingConsistency]) {
1339
+ results[import_core3.ToolName.NamingConsistency].results.forEach((r) => {
1250
1340
  r.issues?.forEach((i) => {
1251
- if (i.severity === "critical") criticalCount++;
1252
- if (i.severity === "major") majorCount++;
1341
+ if (i.severity === import_core3.Severity.Critical) criticalCount++;
1342
+ if (i.severity === import_core3.Severity.Major) majorCount++;
1253
1343
  });
1254
1344
  });
1255
1345
  }