knsv/mermaid

View on GitHub

Showing 384 of 1,490 total issues

File ganttDb.js has 606 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { sanitizeUrl } from '@braintree/sanitize-url';
import dayjs from 'dayjs';
import dayjsIsoWeek from 'dayjs/plugin/isoWeek.js';
import dayjsCustomParseFormat from 'dayjs/plugin/customParseFormat.js';
import dayjsAdvancedFormat from 'dayjs/plugin/advancedFormat.js';
Severity: Major
Found in packages/mermaid/src/diagrams/gantt/ganttDb.js - About 1 day to fix

    Function drawCommits has 259 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const drawCommits = (svg, commits, modifyGraph) => {
      const gitGraphConfig = getConfig().gitGraph;
      const gBullets = svg.append('g').attr('class', 'commit-bullets');
      const gLabels = svg.append('g').attr('class', 'commit-labels');
      let pos = 0;
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphRenderer.js - About 1 day to fix

      Function updateColors has 257 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        updateColors() {
          // The || is to make sure that if the variable has been defined by a user override that value is to be used
      
          /* Main */
          this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#eee' : '#333'); // invert(this.primaryColor);
      Severity: Major
      Found in packages/mermaid/src/themes/theme-base.js - About 1 day to fix

        File classTypes.spec.ts has 572 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { ClassMember } from './classTypes.js';
        import { vi, describe, it, expect } from 'vitest';
        const spyOn = vi.spyOn;
        
        const staticCssStyle = 'text-decoration:underline;';
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts - About 1 day to fix

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

          import common from '../common/common.js';
          import * as svgDrawCommon from '../common/svgDrawCommon.js';
          import { sanitizeUrl } from '@braintree/sanitize-url';
          
          export const drawRect = function (elem, rectData) {
          Severity: Major
          Found in packages/mermaid/src/diagrams/c4/svgDraw.js - About 1 day to fix

            File sequenceDb.js has 562 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { getConfig } from '../../diagram-api/diagramAPI.js';
            import { log } from '../../logger.js';
            import { sanitizeText } from '../common/common.js';
            import {
              clear as commonClear,
            Severity: Major
            Found in packages/mermaid/src/diagrams/sequence/sequenceDb.js - About 1 day to fix

              File gitGraphRenderer.js has 560 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { select } from 'd3';
              import { getConfig, setupGraphViewbox } from '../../diagram-api/diagramAPI.js';
              import { log } from '../../logger.js';
              import utils from '../../utils.js';
              
              
              Severity: Major
              Found in packages/mermaid/src/diagrams/git/gitGraphRenderer.js - About 1 day to fix

                File classDiagram-v2.spec.js has 551 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { imgSnapshotTest } from '../../helpers/util.ts';
                describe('Class diagram V2', () => {
                  it('0: should render a simple class diagram', () => {
                    imgSnapshotTest(
                      `
                Severity: Major
                Found in cypress/integration/rendering/classDiagram-v2.spec.js - About 1 day to fix

                  File stateDiagram-v2.spec.js has 545 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
                  
                  describe('State diagram', () => {
                    it('v2 should render a simple info', () => {
                      imgSnapshotTest(
                  Severity: Major
                  Found in cypress/integration/rendering/stateDiagram-v2.spec.js - About 1 day to fix

                    File utils.spec.ts has 545 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { vi } from 'vitest';
                    import utils, { calculatePoint, cleanAndMerge, detectDirective } from './utils.js';
                    import assignWithDepth from './assignWithDepth.js';
                    import { detectType } from './diagram-api/detectType.js';
                    import { addDiagrams } from './diagram-api/diagram-orchestration.js';
                    Severity: Major
                    Found in packages/mermaid/src/utils.spec.ts - About 1 day to fix

                      File quadrantBuilder.ts has 543 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { scaleLinear } from 'd3';
                      import { log } from '../../logger.js';
                      import type { BaseDiagramConfig, QuadrantChartConfig } from '../../config.type.js';
                      import defaultConfig from '../../defaultConfig.js';
                      import { getThemeVariables } from '../../themes/theme-default.js';
                      Severity: Major
                      Found in packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts - About 1 day to fix

                        Function drawRects has 221 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w) {
                            // Get unique task orders. Required to draw the background rects when display mode is compact.
                            const uniqueTaskOrderIds = [...new Set(theArray.map((item) => item.order))];
                            const uniqueTasks = uniqueTaskOrderIds.map((id) => theArray.find((item) => item.order === id));
                        
                        
                        Severity: Major
                        Found in packages/mermaid/src/diagrams/gantt/ganttRenderer.js - About 1 day to fix

                          File c4Renderer.js has 521 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { select } from 'd3';
                          import svgDraw from './svgDraw.js';
                          import { log } from '../../logger.js';
                          import { parser } from './parser/c4Diagram.jison';
                          import common from '../common/common.js';
                          Severity: Major
                          Found in packages/mermaid/src/diagrams/c4/c4Renderer.js - About 1 day to fix

                            Function updateColors has 201 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              updateColors() {
                                /* Color Scale */
                                /* Each color-set will have a background, a foreground and a border color */
                            
                                this.cScale0 = this.cScale0 || this.primaryColor;
                            Severity: Major
                            Found in packages/mermaid/src/themes/theme-default.js - About 1 day to fix

                              Function updateColors has 196 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                updateColors() {
                                  /* Sequence Diagram variables */
                                  this.actorBorder = darken(this.mainBkg, 20);
                                  this.actorBkg = this.mainBkg;
                                  this.labelBoxBkgColor = this.actorBkg;
                              Severity: Major
                              Found in packages/mermaid/src/themes/theme-forest.js - About 7 hrs to fix

                                File config.type.ts has 488 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /* eslint-disable */
                                /**
                                 * This file was automatically generated by json-schema-to-typescript.
                                 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
                                 * and run json-schema-to-typescript to regenerate this file.
                                Severity: Minor
                                Found in packages/mermaid/src/config.type.ts - About 7 hrs to fix

                                  Function class_box has 192 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const class_box = (parent, node) => {
                                    const halfPadding = node.padding / 2;
                                    const rowPadding = 4;
                                    const lineHeight = 8;
                                  
                                  
                                  Severity: Major
                                  Found in packages/mermaid/src/dagre-wrapper/nodes.js - About 7 hrs to fix

                                    Function updateColors has 190 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      updateColors() {
                                        this.secondBkg = lighten(this.mainBkg, 16);
                                        this.lineColor = this.mainContrastColor;
                                        this.arrowheadColor = this.mainContrastColor;
                                        /* Flowchart variables */
                                    Severity: Major
                                    Found in packages/mermaid/src/themes/theme-dark.js - About 7 hrs to fix

                                      Function drawAttributes has 188 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const drawAttributes = (groupNode, entityTextNode, attributes) => {
                                        const heightPadding = conf.entityPadding / 3; // Padding internal to attribute boxes
                                        const widthPadding = conf.entityPadding / 3; // Ditto
                                        const attrFontSize = conf.fontSize * 0.85;
                                        const labelBBox = entityTextNode.node().getBBox();
                                      Severity: Major
                                      Found in packages/mermaid/src/diagrams/er/erRenderer.js - About 7 hrs to fix

                                        Function updateColors has 187 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          updateColors() {
                                            this.secondBkg = lighten(this.contrast, 55);
                                            this.border2 = this.contrast;
                                        
                                            /* Sequence Diagram variables */
                                        Severity: Major
                                        Found in packages/mermaid/src/themes/theme-neutral.js - About 7 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language