andywer/threads.js

View on GitHub
src/master/pool.ts

Summary

Maintainability
B
5 hrs
Test Coverage

File pool.ts has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import DebugLogger from "debug"
import { multicast, Observable, Subject } from "observable-fns"
import { allSettled } from "../ponyfills"
import { defaultPoolSize } from "./implementation"
import {
Severity: Minor
Found in src/master/pool.ts - About 3 hrs to fix

    Function queue has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public queue(taskFunction: TaskRunFunction<ThreadType, any>) {
        const { maxQueuedJobs = Infinity } = this.options
    
        if (this.isClosing) {
          throw Error(`Cannot schedule pool tasks after terminate() has been called.`)
    Severity: Minor
    Found in src/master/pool.ts - About 1 hr to fix

      Function settled has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public async settled(allowResolvingImmediately: boolean = false): Promise<Error[]> {
          const getCurrentlyRunningTasks = () => flatMap(this.workers, worker => worker.runningTasks)
      
          const taskFailures: Error[] = []
      
      
      Severity: Minor
      Found in src/master/pool.ts - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status