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

Function analyze

src/analyze.ts:79–104  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

77}
78
79export function analyze(code: string): CodeAnalysis {
80 const length = code.length as CodeLength
81
82 const allSame = isAllSame(code)
83 const tooSimple = isTooSimpleSequence(code)
84 const asc = isSequentialAsc(code)
85 const desc = isSequentialDesc(code)
86 const groups = countGroups(code)
87
88 const entropy = estimateEntropy(code)
89 const collision = collisionRisk(code, entropy)
90 const memory = memorabilityScore(code, groups)
91
92 return {
93 length,
94 isAllSame: allSame,
95 isTooSimple: tooSimple,
96 isSequentialAsc: asc,
97 isSequentialDesc: desc,
98 repeatedGroups: groups,
99
100 entropy,
101 collisionRisk: collision,
102 memorability: memory,
103 }
104}

Callers 3

predictCodeQualityFunction · 0.90
isProfileCompatibleFunction · 0.90
isModeCompatibleFunction · 0.90

Calls 8

isAllSameFunction · 0.90
isTooSimpleSequenceFunction · 0.90
isSequentialAscFunction · 0.85
isSequentialDescFunction · 0.85
countGroupsFunction · 0.85
estimateEntropyFunction · 0.85
collisionRiskFunction · 0.85
memorabilityScoreFunction · 0.85

Tested by

no test coverage detected