knsv/mermaid

View on GitHub

Showing 384 of 1,490 total issues

Function cross has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const cross = (elem, type, id) => {
  elem
    .append('marker')
    .attr('id', id + '_' + type + '-crossEnd')
    .attr('class', 'marker cross ' + type)
Severity: Minor
Found in packages/mermaid/src/dagre-wrapper/markers.js - About 1 hr to fix

    Function doublecircle has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const doublecircle = async (parent, node) => {
      const { shapeSvg, bbox, halfPadding } = await labelHelper(
        parent,
        node,
        getClassesFromNode(node, undefined),
    Severity: Minor
    Found in packages/mermaid/src/dagre-wrapper/nodes.js - About 1 hr to fix

      Function drawRelationshipFromLayout has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const drawRelationshipFromLayout = function (svg, rel, g, insert, diagObj) {
        // Find the edge relating to this relationship
        const edge = g.edge(elementString(rel.src), elementString(rel.dst));
      
        // Get a function that will generate the line path
      Severity: Minor
      Found in packages/mermaid/src/diagrams/requirement/requirementRenderer.js - About 1 hr to fix

        Function point has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const point = (elem, type, id) => {
          elem
            .append('marker')
            .attr('id', id + '_' + type + '-pointEnd')
            .attr('class', 'marker ' + type)
        Severity: Minor
        Found in packages/mermaid/src/dagre-wrapper/markers.js - About 1 hr to fix

          Function lollipop has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const lollipop = (elem, type, id) => {
            elem
              .append('defs')
              .append('marker')
              .attr('id', id + '_' + type + '-lollipopStart')
          Severity: Minor
          Found in packages/mermaid/src/dagre-wrapper/markers.js - About 1 hr to fix

            Function markdownToLines has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function markdownToLines(markdown: string): MarkdownLine[] {
              const preprocessedMarkdown = preprocessMarkdown(markdown);
              const { children } = fromMarkdown(preprocessedMarkdown);
              const lines: MarkdownLine[] = [[]];
              let currentLine = 0;
            Severity: Minor
            Found in packages/mermaid/src/rendering-util/handle-markdown-text.ts - About 1 hr to fix

              Function setupDoc has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const setupDoc = (g, parentParsedItem, doc, diagramStates, diagramDb, altFlag) => {
                // graphItemCount = 0;
                log.trace('items', doc);
                doc.forEach((item) => {
                  switch (item.stmt) {
              Severity: Minor
              Found in packages/mermaid/src/diagrams/state/stateRenderer-v2.js - About 1 hr to fix

                Function layoutMindmap has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function layoutMindmap(node: MindmapNode, conf: MermaidConfig): Promise<cytoscape.Core> {
                  return new Promise((resolve) => {
                    // Add temporary render element
                    const renderEl = select('body').append('div').attr('id', 'cy').attr('style', 'display:none');
                    const cy = cytoscape({
                Severity: Minor
                Found in packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts - About 1 hr to fix

                  Function addNodes has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function addNodes(mindmap: MindmapNode, cy: cytoscape.Core, conf: MermaidConfig, level: number) {
                    cy.add({
                      group: 'nodes',
                      data: {
                        id: mindmap.id.toString(),
                  Severity: Minor
                  Found in packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts - About 1 hr to fix

                    Function drawKatex has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const drawKatex = async function (elem, textData, msgModel = null) {
                      let textElem = elem.append('foreignObject');
                      const lines = await renderKatex(textData.text, configApi.getConfig());
                    
                      const divElem = textElem
                    Severity: Minor
                    Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

                      Function parseBoxData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const parseBoxData = function (str) {
                        const match = str.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);
                        let color = match != null && match[1] ? match[1].trim() : 'transparent';
                        let title = match != null && match[2] ? match[2].trim() : undefined;
                      
                      
                      Severity: Minor
                      Found in packages/mermaid/src/diagrams/sequence/sequenceDb.js - About 1 hr to fix

                        Function newBodyNode has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const newBodyNode = (parentNode, id, txts, yStart) => {
                          let body = parentNode
                            .append('text')
                            .attr('class', 'req reqLabel')
                            .attr('id', id)
                        Severity: Minor
                        Found in packages/mermaid/src/diagrams/requirement/requirementRenderer.js - About 1 hr to fix

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

                          export const draw = function (txt, id, ver) {
                            try {
                              logger.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver);
                          
                              config = Object.assign(config, apiConfig, db.getOptions());
                          Severity: Minor
                          Found in packages/mermaid/src/diagrams/git/gitGraphRenderer-old.js - About 1 hr to fix

                            Function addSingleLink has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const addSingleLink = function (_start, _end, type) {
                              let start = _start;
                              let end = _end;
                              // if (start[0].match(/\d/)) start = MERMAID_DOM_ID_PREFIX + start;
                              // if (end[0].match(/\d/)) end = MERMAID_DOM_ID_PREFIX + end;
                            Severity: Minor
                            Found in packages/mermaid/src/diagrams/flowchart/flowDb.js - About 1 hr to fix

                              Function splitLineToFitWidthRecursion has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function splitLineToFitWidthRecursion(
                                words: MarkdownWord[],
                                checkFit: CheckFitFunction,
                                lines: MarkdownLine[] = [],
                                newLine: MarkdownLine = []
                              Severity: Minor
                              Found in packages/mermaid/src/rendering-util/splitText.ts - About 1 hr to fix

                                Function insert has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  insert(c4Shape) {
                                    this.nextData.cnt = this.nextData.cnt + 1;
                                    let _startx =
                                      this.nextData.startx === this.nextData.stopx
                                        ? this.nextData.stopx + c4Shape.margin
                                Severity: Minor
                                Found in packages/mermaid/src/diagrams/c4/c4Renderer.js - About 1 hr to fix

                                  Function addHtmlSpan has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function addHtmlSpan(element, node, width, classes, addBackground = false) {
                                    const fo = element.append('foreignObject');
                                    const div = fo.append('xhtml:div');
                                  
                                    const label = node.label;
                                  Severity: Minor
                                  Found in packages/mermaid/src/rendering-util/createText.ts - About 1 hr to fix

                                    Function getDrawableElement has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      getDrawableElement(): DrawableElem[] {
                                        const finalData: [number, number][] = this.plotData.data.map((d) => [
                                          this.xAxis.getScaleValue(d[0]),
                                          this.yAxis.getScaleValue(d[1]),
                                        ]);

                                      Function drawLabel has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const drawLabel = function (elem, txtObject) {
                                        /**
                                         * @param {any} x
                                         * @param {any} y
                                         * @param {any} width
                                      Severity: Minor
                                      Found in packages/mermaid/src/diagrams/timeline/svgDraw.js - About 1 hr to fix

                                        Function drawLabel has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const drawLabel = function (elem, txtObject) {
                                          /**
                                           * @param {any} x
                                           * @param {any} y
                                           * @param {any} width
                                        Severity: Minor
                                        Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language