AlexAegis/advent-of-code

View on GitHub
solutions/typescript/2023/16/src/internal/beam.ts

Summary

Maintainability
A
2 hrs
Test Coverage

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

export const energizeMap = (gg: GridGraph, startingBeam: Beam): number => {
    let beams: Beam[] = [startingBeam];
    const beamPathHistory = new Map<string, Set<string>>();
    while (beams.length > 0) {
        const spawnedBeams: Beam[] = [];
Severity: Minor
Found in solutions/typescript/2023/16/src/internal/beam.ts - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

                        if (mirroredTo) {
                            beam.direction = mirroredTo;
                            beam.position = beam.position.add(mirroredTo);
                        } else if (splitter) {
                            const [dirA, dirB] = splitter;
    Severity: Major
    Found in solutions/typescript/2023/16/src/internal/beam.ts - About 45 mins to fix

      There are no issues that match your filters.

      Category
      Status