P1B: Refactor (packages/session-ui/src/components/markdown-worker-queue.ts): Function with high complexity (count = 32): createLatestWorkerQueue
Open
@mevensao is already working on this.
Since Sep 7, 2026.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
Uniqueness check
- I have searched open issues and confirmed this file + smell is not already taken.
Full path to the Typescript file
packages/session-ui/src/components/markdown-worker-queue.ts
Function(s)/scope targeted
schedule
Relevant Qlty output
packages/session-ui/src/components/markdown-worker-queue.ts
Function with high complexity (count = 32): createLatestWorkerQueue
1 export function createLatestWorkerQueue<T extends { key: string }>(input: {
2 run: (request: T) => Promise<void>
3 supersede: (request: T) => void
4 dispose: (key: string) => void
5 }) {
6 type Slot = { type: "highlight"; key: string; request?: T }
[hid 58 additional lines]
Function with high complexity (count = 21): schedule
12 const schedule = () => {
13 if (running) return
14 running = Promise.resolve()
15 .then(async () => {
16 while (cursor < jobs.length) {
17 const job = jobs[cursor++]!
[hid 17 additional lines]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.