knsv/mermaid

View on GitHub

Showing 384 of 1,490 total issues

Function choice has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const choice = (parent, node) => {
  const shapeSvg = parent
    .insert('g')
    .attr('class', 'node default')
    .attr('id', node.domId || node.id);
Severity: Minor
Found in packages/mermaid/src/dagre-wrapper/nodes.js - About 1 hr to fix

    Function setClickFun has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const setClickFun = function (id, functionName, functionArgs) {
      if (getConfig().securityLevel !== 'loose') {
        return;
      }
      if (functionName === undefined) {
    Severity: Minor
    Found in packages/mermaid/src/diagrams/gantt/ganttDb.js - About 1 hr to fix

      Function extractFrontMatter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function extractFrontMatter(text: string): FrontMatterResult {
        const matches = text.match(frontMatterRegex);
        if (!matches) {
          return {
            text,
      Severity: Minor
      Found in packages/mermaid/src/diagram-api/frontmatter.ts - About 1 hr to fix

        Function drawRels has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const drawRels = function (diagram, rels, getC4ShapeObj, diagObj) {
          let i = 0;
          for (let rel of rels) {
            i = i + 1;
            let relTextWrap = rel.wrap && conf.wrap;
        Severity: Minor
        Found in packages/mermaid/src/diagrams/c4/c4Renderer.js - About 1 hr to fix

          Function calculatePoint has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const calculatePoint = (points: Point[], distanceToTraverse: number): Point => {
            let prevPoint: Point | undefined = undefined;
            let remainingDistance = distanceToTraverse;
            for (const point of points) {
              if (prevPoint) {
          Severity: Minor
          Found in packages/mermaid/src/utils.ts - About 1 hr to fix

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

            export const draw = function (text, id, _version, diagObj) {
              conf = getConfig().state;
              const securityLevel = getConfig().securityLevel;
              // Handle root and Document for when rendering in sandbox mode
              let sandboxElement;
            Severity: Minor
            Found in packages/mermaid/src/diagrams/state/stateRenderer.js - About 1 hr to fix

              Function transformDataWithoutCategory has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function transformDataWithoutCategory(data: number[]): SimplePlotDataType {
                let retData: SimplePlotDataType = [];
                if (data.length === 0) {
                  return retData;
                }
              Severity: Minor
              Found in packages/mermaid/src/diagrams/xychart/xychartDb.ts - About 1 hr to fix

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

                  constructor(
                    private chartConfig: XYChartConfig,
                    private chartData: XYChartData,
                    chartThemeConfig: XYChartThemeConfig,
                    tmpSVGGroup: Group
                Severity: Minor
                Found in packages/mermaid/src/diagrams/xychart/chartBuilder/orchestrator.ts - About 1 hr to fix

                  Function byTspan has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    function byTspan(content, g, x, y, width, height, textAttrs, conf) {
                  Severity: Major
                  Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

                    Function byFo has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      function byFo(content, g, x, y, width, height, textAttrs, conf) {
                    Severity: Major
                    Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

                      Function byTspan has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        function byTspan(content, g, x, y, width, height, textAttrs, conf) {
                      Severity: Major
                      Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

                        Function byText has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          function byText(content, g, x, y, width, height, textAttrs, colour) {
                        Severity: Major
                        Found in packages/mermaid/src/diagrams/user-journey/svgDraw.js - About 1 hr to fix

                          Function drawExcludeDays has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            function drawExcludeDays(theGap, theTopPad, theSidePad, w, h, tasks, excludes, includes) {
                          Severity: Major
                          Found in packages/mermaid/src/diagrams/gantt/ganttRenderer.js - About 1 hr to fix

                            Function byFo has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              function byFo(content, g, x, y, width, height, textAttrs, conf) {
                            Severity: Major
                            Found in packages/mermaid/src/diagrams/timeline/svgDraw.js - About 1 hr to fix

                              Function byTspan has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                function byTspan(content, g, x, y, width, height, textAttrs, conf) {
                              Severity: Major
                              Found in packages/mermaid/src/diagrams/c4/svgDraw.js - About 1 hr to fix

                                Function byFo has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  function byFo(content, g, x, y, width, height, textAttrs, conf) {
                                Severity: Major
                                Found in packages/mermaid/src/diagrams/user-journey/svgDraw.js - About 1 hr to fix

                                  Function byKatex has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                    async function byKatex(content, g, x, y, width, height, textAttrs, conf) {
                                  Severity: Major
                                  Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

                                    Function byFo has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                      function byFo(content, g, x, y, width, height, textAttrs, conf) {
                                    Severity: Major
                                    Found in packages/mermaid/src/diagrams/c4/svgDraw.js - About 1 hr to fix

                                      Function byText has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                        function byText(content, g, x, y, width, height, textAttrs, colour) {
                                      Severity: Major
                                      Found in packages/mermaid/src/diagrams/timeline/svgDraw.js - About 1 hr to fix

                                        Function byFo has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                          function byFo(content, g, x, y, width, height, textAttrs, conf) {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language