knsv/mermaid

View on GitHub
packages/mermaid/src/mermaidAPI.ts

Summary

Maintainability
C
1 day
Test Coverage

File mermaidAPI.ts has 329 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * This is the API to be used when optionally handling the integration with the web page, instead of
 * using the default integration provided by mermaid.js.
 *
 * The core of this api is the [**render**](Setup.md?id=render) function which, given a graph
Severity: Minor
Found in packages/mermaid/src/mermaidAPI.ts - About 3 hrs to fix

    Function render has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const render = async function (
      id: string,
      text: string,
      svgContainingElement?: Element
    ): Promise<RenderResult> {
    Severity: Major
    Found in packages/mermaid/src/mermaidAPI.ts - About 3 hrs to fix

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

      export const createCssStyles = (
        config: MermaidConfig,
        classDefs: Record<string, DiagramStyleClassDef> | null | undefined = {}
      ): string => {
        let cssStyles = '';
      Severity: Minor
      Found in packages/mermaid/src/mermaidAPI.ts - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status