knsv/mermaid

View on GitHub

Showing 429 of 1,682 total issues

Function intersectPolygon has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function intersectPolygon(node, polyPoints, point) {
  var x1 = node.x;
  var y1 = node.y;

  var intersections = [];
Severity: Minor
Found in packages/mermaid/src/dagre-wrapper/intersect/intersect-polygon.js - About 1 hr to fix

    Function vertLabels has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function vertLabels(theGap, theTopPad) {
        let prevGap = 0;
    
        const numOccurrences = Object.keys(categoryHeights).map((d) => [d, categoryHeights[d]]);
    
    
    Severity: Minor
    Found in packages/mermaid/src/diagrams/gantt/ganttRenderer.js - About 1 hr to fix

      Function intersectPolygon has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function intersectPolygon(node, polyPoints, point) {
        let x1 = node.x;
        let y1 = node.y;
      
        let intersections = [];

        Function question has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const question = async (parent: SVGAElement, node: Node): Promise<SVGAElement> => {
          const { labelStyles, nodeStyles } = styles2String(node);
          node.labelStyle = labelStyles;
          const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
        
        

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

          export const draw = function (text, id, _version, diagObj) {
            conf = getConfig().er;
            log.info('Drawing ER diagram');
            const securityLevel = getConfig().securityLevel;
            // Handle root and Document for when rendering in sandbox mode
          Severity: Minor
          Found in packages/mermaid/src/diagrams/er/erRenderer.js - About 1 hr to fix

            Function addNotes has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const addNotes = function (
              notes: ClassNote[],
              g: graphlib.Graph,
              startEdgeId: number,
              classes: ClassMap
            Severity: Minor
            Found in packages/mermaid/src/diagrams/class/classRenderer-v2.ts - About 1 hr to fix

              Function setLogLevel has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const setLogLevel = function (level: keyof typeof LEVELS | number = 'fatal') {
                let numericLevel: number = LEVELS.fatal;
                if (typeof level === 'string') {
                  if (level.toLowerCase() in LEVELS) {
                    numericLevel = LEVELS[level];
              Severity: Minor
              Found in packages/mermaid/src/logger.ts - About 1 hr to fix

                Function createLabel has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const createLabel = async (_vertexText, style, isTitle, isNode) => {
                  let vertexText = _vertexText || '';
                  if (typeof vertexText === 'object') {
                    vertexText = vertexText[0];
                  }

                  Function subroutine has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const subroutine = async (parent: SVGAElement, node: Node) => {
                    const { labelStyles, nodeStyles } = styles2String(node);
                    node.labelStyle = labelStyles;
                    const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
                    const halfPadding = (node?.padding || 0) / 2;

                    Function addContainerBoundary has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const addContainerBoundary = function (alias, label, type, tags, link) {
                      // if (parentBoundary === null) return;
                    
                      // Don't allow label nulling
                      if (alias === null || label === null) {
                    Severity: Minor
                    Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                      Function addPersonOrSystemBoundary has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const addPersonOrSystemBoundary = function (alias, label, type, tags, link) {
                        // if (parentBoundary === null) return;
                      
                        // Don't allow label nulling
                        if (alias === null || label === null) {
                      Severity: Minor
                      Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                        Function sanitizeDirective has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const sanitizeDirective = (args: any): void => {
                          log.debug('sanitizeDirective called with', args);
                        
                          // Return if not an object
                          if (typeof args !== 'object' || args == null) {
                        Severity: Minor
                        Found in packages/mermaid/src/utils/sanitizeDirective.ts - About 1 hr to fix

                          Function genSections has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const genSections: DiagramStylesProvider = (options) => {
                            let sections = '';
                          
                            for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
                              options['lineColor' + i] = options['lineColor' + i] || options['cScaleInv' + i];
                          Severity: Minor
                          Found in packages/mermaid/src/diagrams/mindmap/styles.ts - About 1 hr to fix

                            Function drawRect has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const drawRect = async (parent: SVGAElement, node: Node, options: RectOptions) => {
                              const { labelStyles, nodeStyles } = styles2String(node);
                              node.labelStyle = labelStyles;
                              // console.log('IPI labelStyles:', labelStyles);
                              const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));

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

                              export const doublecircle = async (parent: SVGAElement, node: Node): Promise<SVGAElement> => {
                                const { labelStyles, nodeStyles } = styles2String(node);
                                node.labelStyle = labelStyles;
                                const { shapeSvg, bbox, halfPadding } = await labelHelper(parent, node, getNodeClasses(node));
                                const gap = 5;

                                Function addActorRenderingData has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const addActorRenderingData = function (
                                  diagram,
                                  actors,
                                  createdActors: Map<string, any>,
                                  actorKeys,
                                Severity: Minor
                                Found in packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts - About 1 hr to fix

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

                                  export const draw: DrawDefinition = function (txt, id, ver, diagObj) {
                                    clear();
                                  
                                    log.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver);
                                    if (!DEFAULT_GITGRAPH_CONFIG) {
                                  Severity: Minor
                                  Found in packages/mermaid/src/diagrams/git/gitGraphRenderer.ts - About 1 hr to fix

                                    Function addActor has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const addActor = function (
                                      id: string,
                                      name: string,
                                      description: { text: string; wrap?: boolean | null; type: string },
                                      type: string
                                    Severity: Minor
                                    Found in packages/mermaid/src/diagrams/sequence/sequenceDb.ts - About 1 hr to fix

                                      Function calculateSpace has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        calculateSpace(
                                          xAxisPosition: typeof this.config.xAxisPosition,
                                          showXAxis: boolean,
                                          showYAxis: boolean,
                                          showTitle: boolean
                                      Severity: Minor
                                      Found in packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts - About 1 hr to fix

                                        Function hexagon has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const hexagon = async (parent: SVGAElement, node: Node): Promise<SVGAElement> => {
                                          const { labelStyles, nodeStyles } = styles2String(node);
                                          node.labelStyle = labelStyles;
                                          const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language