knsv/mermaid

View on GitHub

Showing 384 of 1,490 total issues

File svgDraw.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { line, curveBasis } from 'd3';
import utils from '../../utils.js';
import { log } from '../../logger.js';
import { parseGenericTypes } from '../common/common.js';

Severity: Minor
Found in packages/mermaid/src/diagrams/class/svgDraw.js - About 3 hrs to fix

    Function updateElStyle has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const updateElStyle = function (
      typeC4Shape,
      elementName,
      bgColor,
      fontColor,
    Severity: Major
    Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 3 hrs to fix

      File theme-forest.js has 296 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { darken, lighten, adjust, invert, isDark } from 'khroma';
      import { mkBorder } from './theme-helpers.js';
      import {
        oldAttributeBackgroundColorEven,
        oldAttributeBackgroundColorOdd,
      Severity: Minor
      Found in packages/mermaid/src/themes/theme-forest.js - About 3 hrs to fix

        File theme-base.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { darken, lighten, adjust, invert, isDark, toRgba } from 'khroma';
        import { mkBorder } from './theme-helpers.js';
        import {
          oldAttributeBackgroundColorEven,
          oldAttributeBackgroundColorOdd,
        Severity: Minor
        Found in packages/mermaid/src/themes/theme-base.js - About 3 hrs to fix

          Function renderCommitHistory has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function renderCommitHistory(svg, commitId, branches, direction) {
            let commit;
            const numCommits = Object.keys(allCommitsDict).length;
            if (typeof commitId === 'string') {
              do {
          Severity: Major
          Found in packages/mermaid/src/diagrams/git/gitGraphRenderer-old.js - About 3 hrs to fix

            File requirementRenderer.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { line, select } from 'd3';
            import { layout as dagreLayout } from 'dagre-d3-es/src/dagre/index.js';
            import * as graphlib from 'dagre-d3-es/src/graphlib/index.js';
            import { log } from '../../logger.js';
            import { configureSvgSize } from '../../setupGraphViewbox.js';
            Severity: Minor
            Found in packages/mermaid/src/diagrams/requirement/requirementRenderer.js - About 3 hrs to fix

              Function positionEdgeLabel has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const positionEdgeLabel = (edge, paths) => {
                log.debug('Moving label abc88 ', edge.id, edge.label, edgeLabels[edge.id], paths);
                let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;
                const siteConfig = getConfig();
                const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig);
              Severity: Major
              Found in packages/mermaid/src/dagre-wrapper/edges.js - About 3 hrs to fix

                Function insertEdge has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const insertEdge = function (elem, e, edge, clusterDb, diagramType, graph, id) {
                  let points = edge.points;
                  log.debug('abc88 InsertEdge: edge=', edge, 'e=', e);
                  let pointsHasChanged = false;
                  const tail = graph.node(e.v);
                Severity: Major
                Found in packages/mermaid/src/dagre-wrapper/edges.js - About 3 hrs to fix

                  Function buildNoteModel has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const buildNoteModel = async function (msg, actors, diagObj) {
                    const startx = actors[msg.from].x;
                    const stopx = actors[msg.to].x;
                    const shouldWrap = msg.wrap && msg.message;
                  
                  
                  Severity: Major
                  Found in packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts - About 3 hrs to fix

                    File theme-neutral.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { invert, darken, lighten, adjust, isDark } from 'khroma';
                    import { mkBorder } from './theme-helpers.js';
                    import {
                      oldAttributeBackgroundColorEven,
                      oldAttributeBackgroundColorOdd,
                    Severity: Minor
                    Found in packages/mermaid/src/themes/theme-neutral.js - About 3 hrs to fix

                      File classRenderer-v2.ts has 291 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      // @ts-nocheck - don't check until handle it
                      import { select, curveLinear } from 'd3';
                      import * as graphlib from 'dagre-d3-es/src/graphlib/index.js';
                      import { log } from '../../logger.js';
                      import { getConfig } from '../../diagram-api/diagramAPI.js';
                      Severity: Minor
                      Found in packages/mermaid/src/diagrams/class/classRenderer-v2.ts - About 3 hrs to fix

                        Function getDrawableElementsForLeftAxis has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          private getDrawableElementsForLeftAxis(): DrawableElem[] {
                            const drawableElement: DrawableElem[] = [];
                            if (this.showAxisLine) {
                              const x = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
                              drawableElement.push({

                          Function getDrawableElementsForBottomAxis has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            private getDrawableElementsForBottomAxis(): DrawableElem[] {
                              const drawableElement: DrawableElem[] = [];
                              if (this.showAxisLine) {
                                const y = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
                                drawableElement.push({

                            Function getDrawableElementsForTopAxis has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              private getDrawableElementsForTopAxis(): DrawableElem[] {
                                const drawableElement: DrawableElem[] = [];
                                if (this.showAxisLine) {
                                  const y = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
                                  drawableElement.push({

                              File theme-dark.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { invert, lighten, darken, rgba, adjust, isDark } from 'khroma';
                              import { mkBorder } from './theme-helpers.js';
                              
                              class Theme {
                                constructor() {
                              Severity: Minor
                              Found in packages/mermaid/src/themes/theme-dark.js - About 2 hrs to fix

                                Function drawActorTypeParticipant has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const drawActorTypeParticipant = async function (elem, actor, conf, isFooter) {
                                  const actorY = isFooter ? actor.stopy : actor.starty;
                                  const center = actor.x + actor.width / 2;
                                  const centerY = actorY + 5;
                                
                                
                                Severity: Major
                                Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 2 hrs to fix

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

                                    constructor() {
                                      this.primaryColor = '#eee';
                                      this.contrast = '#707070';
                                      this.secondaryColor = lighten(this.contrast, 55);
                                      this.background = '#ffffff';
                                  Severity: Major
                                  Found in packages/mermaid/src/themes/theme-neutral.js - About 2 hrs to fix

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

                                      constructor() {
                                        this.background = '#333';
                                        this.primaryColor = '#1f2020';
                                        this.secondaryColor = lighten(this.primaryColor, 16);
                                    
                                    
                                    Severity: Major
                                    Found in packages/mermaid/src/themes/theme-dark.js - About 2 hrs to fix

                                      Function drawExcludeDays has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function drawExcludeDays(theGap, theTopPad, theSidePad, w, h, tasks, excludes, includes) {
                                          if (excludes.length === 0 && includes.length === 0) {
                                            return;
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in packages/mermaid/src/diagrams/gantt/ganttRenderer.js - About 2 hrs to fix

                                        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/timeline/svgDraw.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language