( code: string, groups: number )
| 63 | } |
| 64 | |
| 65 | function memorabilityScore( |
| 66 | code: string, |
| 67 | groups: number |
| 68 | ): 'low' | 'medium' | 'high' { |
| 69 | if (isAllSame(code)) return 'low' |
| 70 | if (isTooSimpleSequence(code)) return 'low' |
| 71 | |
| 72 | if (groups <= 2) return 'high' |
| 73 | |
| 74 | if (groups === 3) return 'medium' |
| 75 | |
| 76 | return 'low' |
| 77 | } |
| 78 | |
| 79 | export function analyze(code: string): CodeAnalysis { |
| 80 | const length = code.length as CodeLength |
no test coverage detected