tdreyno/leisure

View on GitHub

Showing 23 of 23 total issues

File Seq.ts has 529 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { identity } from "@tdreyno/figment"
 
export const DONE = Symbol()
 
type Tramp<T> = () => typeof DONE | T
Severity: Major
Found in src/Seq.ts - About 1 day to fix

    Seq has 45 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class Seq<T> {
    public static MAX_YIELDS = 1_000_000
     
    private yields_ = 0
     
     
    Severity: Minor
    Found in src/Seq.ts - About 6 hrs to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      fn: (
      [result1, result2, result3]:
      | [T, T2, T3]
      | [T, undefined, undefined]
      | [T, T2, undefined]
      Severity: Major
      Found in src/Seq.ts and 1 other location - About 2 hrs to fix
      src/static.ts on lines 98..108

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      fn: (
      [result1, result2, resul3]:
      | [T1, T2, T3]
      | [T1, undefined, undefined]
      | [T1, T2, undefined]
      Severity: Major
      Found in src/static.ts and 1 other location - About 2 hrs to fix
      src/Seq.ts on lines 537..547

      Function partitionBy has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      public partitionBy(
      fn: (value: T, index: number) => unknown,
      ): [Seq<T>, Seq<T>] {
      // eslint-disable-next-line @typescript-eslint/no-this-alias
      const self = this
      Severity: Major
      Found in src/Seq.ts - About 2 hrs to fix

        Function zip2With has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        public zip2With<T2, T3, T4>(
        fn: (
        [result1, result2, result3]:
        | [T, T2, T3]
        | [T, undefined, undefined]
        Severity: Minor
        Found in src/Seq.ts - About 1 hr to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export const concat = <T>(head: Seq<T>, ...remaining: Array<Seq<T>>) =>
          head.concat(...remaining)
          Severity: Major
          Found in src/static.ts and 1 other location - About 1 hr to fix
          src/static.ts on lines 120..121

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export const interleave = <T>(head: Seq<T>, ...remaining: Array<Seq<T>>) =>
          head.interleave(...remaining)
          Severity: Major
          Found in src/static.ts and 1 other location - About 1 hr to fix
          src/static.ts on lines 117..118

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          bench(
          "map (worth case)",
          () => fromArray(lotsOfNumbers).map(square).nth(10000),
          () => lotsOfNumbers.map(square),
          () => _.map(lotsOfNumbers, square),
          Severity: Major
          Found in src/benchmarks/benchmark.ts and 1 other location - About 1 hr to fix
          src/benchmarks/benchmark.ts on lines 69..74

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          bench(
          "map (middle case)",
          () => fromArray(lotsOfNumbers).map(square).nth(5000),
          () => lotsOfNumbers.map(square),
          () => _.map(lotsOfNumbers, square),
          Severity: Major
          Found in src/benchmarks/benchmark.ts and 1 other location - About 1 hr to fix
          src/benchmarks/benchmark.ts on lines 76..81

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          bench(
          "filter",
          () => fromArray(lotsOfNumbers).filter(isEven).first(),
          () => lotsOfNumbers.filter(isEven),
          () => _.filter(lotsOfNumbers, isEven),
          Severity: Major
          Found in src/benchmarks/benchmark.ts and 1 other location - About 1 hr to fix
          src/benchmarks/benchmark.ts on lines 62..67

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          bench(
          "map (best case)",
          () => fromArray(lotsOfNumbers).map(square).first(),
          () => lotsOfNumbers.map(square),
          () => _.map(lotsOfNumbers, square),
          Severity: Major
          Found in src/benchmarks/benchmark.ts and 1 other location - About 1 hr to fix
          src/benchmarks/benchmark.ts on lines 83..88

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          ? (): typeof DONE | number => {
          const num = start + i
           
          if (num > end) {
          return DONE
          Severity: Minor
          Found in src/static.ts and 1 other location - About 45 mins to fix
          src/static.ts on lines 51..61

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          : (): typeof DONE | number => {
          const num = start - i
           
          if (num < end) {
          return DONE
          Severity: Minor
          Found in src/static.ts and 1 other location - About 45 mins to fix
          src/static.ts on lines 40..50

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          export const simplex2D = (
          fn: () => [number, number],
          seed: number = Date.now(),
          ) => {
          const noise2D = makeNoise2D(seed)
          Severity: Major
          Found in src/simplex.ts and 2 other locations - About 40 mins to fix
          src/simplex.ts on lines 15..23
          src/simplex.ts on lines 25..33

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          export const simplex3D = (
          fn: () => [number, number, number],
          seed: number = Date.now(),
          ) => {
          const noise3D = makeNoise3D(seed)
          Severity: Major
          Found in src/simplex.ts and 2 other locations - About 40 mins to fix
          src/simplex.ts on lines 5..13
          src/simplex.ts on lines 25..33

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          export const simplex4D = (
          fn: () => [number, number, number, number],
          seed: number = Date.now(),
          ): Seq<number> => {
          const noise4D = makeNoise4D(seed)
          Severity: Major
          Found in src/simplex.ts and 2 other locations - About 40 mins to fix
          src/simplex.ts on lines 5..13
          src/simplex.ts on lines 15..23

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          fn: (
          [result1, result2]: [T, T2] | [T, undefined] | [undefined, T2],
          index: number,
          ) => T3,
          Severity: Minor
          Found in src/Seq.ts and 1 other location - About 35 mins to fix
          src/static.ts on lines 86..89

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          fn: (
          [result1, result2]: [T1, T2] | [T1, undefined] | [undefined, T2],
          index: number,
          ) => T3,
          Severity: Minor
          Found in src/static.ts and 1 other location - About 35 mins to fix
          src/Seq.ts on lines 499..502

          Avoid too many return statements within this function.
          Open

          return fn([result1 as T, result2 as T2, result3 as T3], counter++)
          Severity: Major
          Found in src/Seq.ts - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language