knsv/mermaid

View on GitHub
packages/mermaid/src/diagrams/timeline/timelineRenderer.ts

Summary

Maintainability
C
1 day
Test Coverage

Function draw has 155 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const draw = function (text: string, id: string, version: string, diagObj: Diagram) {
  //1. Fetch the configuration
  const conf = getConfig();
  // @ts-expect-error - wrong config?
  const LEFT_MARGIN = conf.leftMargin ?? 50;
Severity: Major
Found in packages/mermaid/src/diagrams/timeline/timelineRenderer.ts - About 6 hrs to fix

    File timelineRenderer.ts has 278 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // @ts-nocheck - don't check until handle it
    import type { Selection } from 'd3';
    import { select } from 'd3';
    import svgDraw from './svgDraw.js';
    import { log } from '../../logger.js';
    Severity: Minor
    Found in packages/mermaid/src/diagrams/timeline/timelineRenderer.ts - About 2 hrs to fix

      Function drawTasks has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const drawTasks = function (
        diagram: Selection<SVGElement, unknown, null, undefined>,
        tasks: TimelineTask[],
        sectionColor: number,
        masterX: number,
      Severity: Minor
      Found in packages/mermaid/src/diagrams/timeline/timelineRenderer.ts - About 1 hr to fix

        Function drawTasks has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          diagram: Selection<SVGElement, unknown, null, undefined>,
          tasks: TimelineTask[],
          sectionColor: number,
          masterX: number,
          masterY: number,
        Severity: Major
        Found in packages/mermaid/src/diagrams/timeline/timelineRenderer.ts - About 1 hr to fix

          Function drawEvents has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            diagram: Selection<SVGElement, unknown, null, undefined>,
            events: string[],
            sectionColor: number,
            masterX: number,
            masterY: number,
          Severity: Minor
          Found in packages/mermaid/src/diagrams/timeline/timelineRenderer.ts - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status