MCPcopy Index your code
hub / github.com/TeaCoder52/patcode / hammingSimilarity

Function hammingSimilarity

src/predictor.ts:4–11  ·  view source on GitHub ↗
(a: string, b: string)

Source from the content-addressed store, hash-verified

2import { analyze } from './analyze'
3
4function hammingSimilarity(a: string, b: string): number {
5 if (!a || !b || a.length !== b.length) return 0
6 let same = 0
7 for (let i = 0; i < a.length; i++) {
8 if (a[i] === b[i]) same++
9 }
10 return same / a.length
11}
12
13export function predictCodeQuality(
14 code: string,

Callers 1

predictCodeQualityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected