(content)
| 263 | } |
| 264 | |
| 265 | function countLoc(content) { |
| 266 | let code = 0, comments = 0, inBlock = false; |
| 267 | const lines = content.split(/\r?\n/); |
| 268 | for (const line of lines) { |
| 269 | const s = line.trim(); |
| 270 | if (!s) continue; |
| 271 | if (inBlock) { |
| 272 | comments++; |
| 273 | if (s.includes('*/')) inBlock = false; |
| 274 | continue; |
| 275 | } |
| 276 | if (s.startsWith('//')) { comments++; continue; } |
| 277 | if (s.startsWith('/*')) { comments++; if (!s.includes('*/')) inBlock = true; continue; } |
| 278 | code++; |
| 279 | } |
| 280 | return { code, comments }; |
| 281 | } |
| 282 | |
| 283 | async function fetchFileCached(ref, path) { |
| 284 | const key = `${ref}:${path}`; |
nothing calls this directly
no test coverage detected