knsv/mermaid

View on GitHub

Showing 384 of 1,490 total issues

Function drawFace has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const drawFace = function (element, faceData) {
  const radius = 15;
  const circleElement = element
    .append('circle')
    .attr('cx', faceData.cx)
Severity: Major
Found in packages/mermaid/src/diagrams/user-journey/svgDraw.js - About 2 hrs to fix

    Function copy has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const copy = (clusterId, graph, newGraph, rootId) => {
      log.warn(
        'Copying children of ',
        clusterId,
        'root',
    Severity: Major
    Found in packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js - About 2 hrs to fix

      Function _drawTextCandidateFunc has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const _drawTextCandidateFunc = (function () {
        /**
         * @param {any} content
         * @param {any} g
         * @param {any} x
      Severity: Major
      Found in packages/mermaid/src/diagrams/timeline/svgDraw.js - About 2 hrs to fix

        Function _drawTextCandidateFunc has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const _drawTextCandidateFunc = (function () {
          /**
           * @param {any} content
           * @param {any} g
           * @param {any} x
        Severity: Major
        Found in packages/mermaid/src/diagrams/user-journey/svgDraw.js - About 2 hrs to fix

          Function constructor has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            constructor() {
              /* Base vales */
              this.background = '#f4f4f4';
              this.primaryColor = '#cde498';
              this.secondaryColor = '#cdffb2';
          Severity: Major
          Found in packages/mermaid/src/themes/theme-forest.js - About 2 hrs to fix

            Function drawC4ShapeArray has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const drawC4ShapeArray = function (currentBounds, diagram, c4ShapeArray, c4ShapeKeys) {
              // Upper Y is relative point
              let Y = 0;
              // Draw the c4ShapeArray
              for (const c4ShapeKey of c4ShapeKeys) {
            Severity: Major
            Found in packages/mermaid/src/diagrams/c4/c4Renderer.js - About 2 hrs to fix

              Function insertEdges has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export async function insertEdges(
                elem: any,
                edges: Block[],
                blocks: Block[],
                db: BlockDB,
              Severity: Major
              Found in packages/mermaid/src/diagrams/block/renderHelpers.ts - About 2 hrs to fix

                Function getMaxMessageWidthPerActor has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                async function getMaxMessageWidthPerActor(
                  actors: { [id: string]: any },
                  messages: any[],
                  diagObj: Diagram
                ): Promise<{ [id: string]: number }> {
                Severity: Major
                Found in packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts - About 2 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

                    File markers.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /** Setup arrow head and define the marker. The result is appended to the svg. */
                    
                    import { log } from '../logger.js';
                    
                    // Only add the number of markers that the diagram needs
                    Severity: Minor
                    Found in packages/mermaid/src/dagre-wrapper/markers.js - About 2 hrs to fix

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

                      export const draw = function (_text, id, _version, diagObj) {
                        conf = getConfig().c4;
                        const securityLevel = getConfig().securityLevel;
                        // Handle root and Document for when rendering in sandbox mode
                        let sandboxElement;
                      Severity: Major
                      Found in packages/mermaid/src/diagrams/c4/c4Renderer.js - About 2 hrs to fix

                        Function populateBlockDatabase has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const populateBlockDatabase = (_blockList: Block[] | Block[][], parent: Block): void => {
                          const blockList = _blockList.flat();
                          const children = [];
                          for (const block of blockList) {
                            if (block.label) {
                        Severity: Major
                        Found in packages/mermaid/src/diagrams/block/blockDB.ts - About 2 hrs to fix

                          Function layoutBlocks has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function layoutBlocks(block: Block, db: BlockDB) {
                            log.debug(
                              `abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${block?.size?.x} y: ${block?.size?.y} width: ${block?.size?.width}`
                            );
                            const columns = block.columns || -1;
                          Severity: Major
                          Found in packages/mermaid/src/diagrams/block/layout.ts - About 2 hrs to fix

                            File layout.ts has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import type { BlockDB } from './blockDB.js';
                            import type { Block } from './blockTypes.js';
                            import { log } from '../../logger.js';
                            import { getConfig } from '../../diagram-api/diagramAPI.js';
                            const padding = getConfig()?.block?.padding || 8;
                            Severity: Minor
                            Found in packages/mermaid/src/diagrams/block/layout.ts - About 2 hrs to fix

                              Function drawBoundary has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const drawBoundary = function (elem, boundary, conf) {
                                const boundaryElem = elem.append('g');
                              
                                let fillColor = boundary.bgColor ? boundary.bgColor : 'none';
                                let strokeColor = boundary.borderColor ? boundary.borderColor : '#444444';
                              Severity: Major
                              Found in packages/mermaid/src/diagrams/c4/svgDraw.js - About 2 hrs to fix

                                Function _drawTextCandidateFunc has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const _drawTextCandidateFunc = (function () {
                                  /**
                                   * @param {any} content
                                   * @param {any} g
                                   * @param {any} x
                                Severity: Major
                                Found in packages/mermaid/src/diagrams/c4/svgDraw.js - About 2 hrs to fix

                                  Function cylinder has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const cylinder = async (parent, node) => {
                                    const { shapeSvg, bbox } = await labelHelper(
                                      parent,
                                      node,
                                      getClassesFromNode(node, undefined),
                                  Severity: Major
                                  Found in packages/mermaid/src/dagre-wrapper/nodes.js - About 2 hrs to fix

                                    Function addTitleAndBox has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const addTitleAndBox = (g, stateDef, altBkg) => {
                                      const pad = getConfig().state.padding;
                                      const dblPad = 2 * getConfig().state.padding;
                                      const orgBox = g.node().getBBox();
                                      const orgWidth = orgBox.width;
                                    Severity: Major
                                    Found in packages/mermaid/src/diagrams/state/shapes.js - About 2 hrs to fix

                                      Function adjustCreatedDestroyedData has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function adjustCreatedDestroyedData(
                                        msg,
                                        msgModel,
                                        lineStartY,
                                        index,
                                      Severity: Major
                                      Found in packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts - About 2 hrs to fix

                                        Function _drawMenuItemTextCandidateFunc has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const _drawMenuItemTextCandidateFunc = (function () {
                                          /**
                                           * @param {any} content
                                           * @param {any} g
                                           * @param {any} x
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language