MCPcopy Create free account
hub / github.com/apache/maka / countDiffLineStats

Function countDiffLineStats

packages/core/src/unified-diff.ts:105–113  ·  view source on GitHub ↗
(diff: string)

Source from the content-addressed store, hash-verified

103
104/** Green `+N` / red `-N` counts, from the structural parse. */
105export function countDiffLineStats(diff: string): { additions: number; deletions: number } {
106 let additions = 0;
107 let deletions = 0;
108 for (const row of parseUnifiedDiffRows(diff)) {
109 if (row.kind === 'add') additions += 1;
110 else if (row.kind === 'del') deletions += 1;
111 }
112 return { additions, deletions };
113}

Callers 7

compactDiffSummaryFunction · 0.90
diffStatsFunction · 0.90
readTrackedChangesFunction · 0.90
readUntrackedChangesFunction · 0.90
dedupeReviewFilesFunction · 0.90

Calls 1

parseUnifiedDiffRowsFunction · 0.85

Tested by

no test coverage detected