MCPcopy Index your code
hub / github.com/anomalyco/opencode / isDisproportionateMatch

Function isDisproportionateMatch

packages/opencode/src/tool/edit.ts:731–737  ·  view source on GitHub ↗
(search: string, oldString: string)

Source from the content-addressed store, hash-verified

729}
730
731function isDisproportionateMatch(search: string, oldString: string) {
732 const oldLines = oldString.split("\n").length
733 const searchLines = search.split("\n").length
734 if (searchLines >= Math.max(oldLines + 3, oldLines * 2)) return true
735 if (oldLines === 1) return false
736 return search.trim().length > Math.max(oldString.trim().length + 500, oldString.trim().length * 4)
737}

Callers 1

replaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected