Repository Analysis

mermaid-js/mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown

0.6 Likely human-written View on GitHub
0.6
Adjusted Score
0.6
Raw Score
100%
Time Factor
2026-05-30
Last Push
88,345
Stars
TypeScript
Language
250,232
Lines of Code
1240
Files
87
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 5HIGH 3MEDIUM 1LOW 78

Pattern Findings

87 matches across 8 categories. Click a row to expand file-level details.

Hallucination Indicators5 hits · 50 pts
SeverityFileLineSnippet
CRITICALpackages/mermaid/src/diagrams/sequence/sequenceDb.ts228 this.state.records.currentBox.actorKeys.push(id);
CRITICALpackages/mermaid/src/diagrams/sequence/sequenceDb.ts263 id: this.state.records.messages.length.toString(),
CRITICALpackages/mermaid/src/diagrams/sequence/sequenceDb.ts298 id: this.state.records.messages.length.toString(),
CRITICALpackages/mermaid/src/diagrams/sequence/sequenceDb.ts442 id: this.state.records.messages.length.toString(),
CRITICALpackages/mermaid/src/diagrams/sequence/sequenceDb.ts566 id: this.state.records.messages.length.toString(),
Hyper-Verbose Identifiers32 hits · 32 pts
SeverityFileLineSnippet
LOWcypress/integration/rendering/railroad/railroad.spec.ts3function shouldHaveRailroadContent($svg: JQuery<SVGSVGElement>) {
LOWpackages/mermaid-layout-tidy-tree/src/layout.ts166function convertNodeToTidyTreeTransposed(
LOWpackages/mermaid-layout-tidy-tree/src/layout.ts298function positionLeftTreeBidirectional(
LOWpackages/mermaid-layout-tidy-tree/src/layout.ts332function positionRightTreeBidirectional(
LOWpackages/mermaid-layout-tidy-tree/src/layout.ts369function computeCircleEdgeIntersection(circle: Bounds, lineStart: Point, lineEnd: Point): Point {
LOWpackages/parser/tests/test-util.ts40export function expectNoErrorsOrAlternatives(result: ParseResult) {
LOWpackages/parser/tests/test-util.ts62export function createArchitectureTestServices() {
LOWpackages/parser/tests/test-util.ts106export function createGitGraphTestServices() {
LOWpackages/parser/tests/test-util.ts118export function createEventModelingTestServices() {
LOWpackages/parser/tests/test-util.ts128export function createTreeViewTestServices() {
LOWpackages/parser/src/language/architecture/module.ts65export function createArchitectureServices(
LOWpackages/parser/src/language/eventmodeling/module.ts44export function createEventModelingServices(
LOWpackages/parser/src/language/railroad-ebnf/module.ts41export function createRailroadEbnfServices(
LOWpackages/parser/src/language/railroad-abnf/module.ts41export function createRailroadAbnfServices(
LOWpackages/parser/src/language/railroad-peg/module.ts41export function createRailroadPegServices(
LOWpackages/mermaid-layout-elk/src/render.ts58export function buildSubgraphLayoutOptions(
LOWpackages/mermaid/src/mermaidAPI.ts71function processAndSetConfigs(text: string) {
LOWpackages/mermaid/src/utils.ts398function calcTerminalLabelPosition(
LOWpackages/mermaid/src/styles.spec.ts37function checkValidStylisCSSStyleSheet(stylisString: string) {
LOWpackages/mermaid/src/rendering-util/createText.ts224function updateTextContentAndStyles(
LOWpackages/mermaid/src/rendering-util/splitText.ts46function splitWordToFitWidthRecursion(
LOWpackages/mermaid/src/rendering-util/splitText.ts90function splitLineToFitWidthRecursion(
LOW…mermaid/src/rendering-util/rendering-elements/edges.js924function applyMarkerOffsetsToPoints(points, edge) {
LOW…d/src/rendering-util/rendering-elements/shapes/util.ts186export function generateFullSineWavePoints(
LOW…ages/mermaid/src/diagrams/cynefin/cynefinBoundaries.ts94export function generateHorizontalBoundary(
LOWpackages/mermaid/src/diagrams/xychart/xychartDb.ts42function getChartDefaultThemeConfig(): XYChartThemeConfig {
LOWpackages/mermaid/src/diagrams/xychart/xychartDb.ts112function setYAxisRangeFromPlotData(data: number[]) {
LOWpackages/mermaid/src/diagrams/xychart/xychartDb.ts125function transformDataWithoutCategory(data: number[]): SimplePlotDataType {
LOWpackages/mermaid/src/diagrams/eventmodeling/db.ts280function calculateEntityVisualProps(frame: EmFrame): VisualProps {
LOW…ages/mermaid/src/diagrams/sequence/sequenceRenderer.ts945function adjustCreatedDestroyedData(
LOW…ages/mermaid/src/diagrams/sequence/sequenceRenderer.ts1487async function getMaxMessageWidthPerActor(
LOWpackages/mermaid/src/docs/.vitepress/ossHeroClass.ts16export function applyOssHomeHeroNameClipClass({
Over-Commented Block29 hits · 29 pts
SeverityFileLineSnippet
LOWnetlify.toml1# Settings in the [build] context are global and are applied to
LOWtsconfig.json21 // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in sour
LOWtsconfig.json41 "resolveJsonModule": true /* Enable importing .json files */,
LOWtsconfig.json61 // "sourceRoot": "", /* Specify the root path for debuggers to find the reference so
LOWtsconfig.json81 /* Type Checking */
LOWcypress/integration/rendering/appli.spec.js41
LOWcypress/integration/rendering/appli.spec.js61 // target: 'window',
LOW…press/integration/rendering/class/classDiagram.spec.js341 // it('17: should render a class diagram when useMaxWidth is true (default)', () => {
LOW…press/integration/rendering/class/classDiagram.spec.js361 // const style = svg.attr('style');
LOW…press/integration/rendering/class/classDiagram.spec.js381 // { class: { useMaxWidth: false } }
LOWcypress/platform/gitgraph2.html101 <script type="module">
LOWcypress/platform/knsv2.html581 // theme: 'default',
LOWcypress/platform/saurabh.html101 window.callback = function () {
LOWcypress/platform/gitgraph.html141 commitLabelColor: '#9400D3',
LOWcypress/support/commands.js1// ***********************************************
LOWcypress/support/commands.js21// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
LOWcypress/support/e2e.js1// ***********************************************************
LOWpackages/mermaid-layout-elk/src/render.ts761 // 'spacing.edgeEdge': 10,
LOWpackages/mermaid/src/diagrams/sankey/sankeyRenderer.ts101 const labelStyle = conf?.labelStyle ?? defaultSankeyConfig.labelStyle ?? 'legacy';
LOWpackages/mermaid/src/diagrams/state/shapes.js181 // stateDef.id,
LOWpackages/mermaid/src/diagrams/state/shapes.js501 .attr('class', 'box')
LOW…es/mermaid/src/diagrams/architecture/architectureDb.ts421// return db.getConfig()[field];
LOWpackages/mermaid/src/diagrams/er/erRenderer.js581 erMarkers.insertMarkers(svg, conf);
LOWpackages/mermaid/src/schemas/config.schema.yaml1# Used for VS Code's YAML plugin to automatically error on invalid types
LOWpackages/mermaid/src/dagre-wrapper/index.js181 adjustClustersAndEdges(graph);
LOWpackages/mermaid/src/themes/theme-redux-dark-color.js221
LOW.github/FUNDING.yml1# These are supported funding model platforms
LOW.github/lychee.toml81# Exclude all private IPs from checking.
LOW.github/workflows/codeql.yml41 config-file: ./.github/codeql/codeql-config.yml
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippet
HIGHdocs/syntax/sankey.md0,193.026 pumped heat,"heating and cooling, ""commercial
HIGHdocs/syntax/sankey.md0,193.026 pumped heat,"heating and cooling, ""commercial
HIGHpackages/mermaid/src/docs/syntax/sankey.md0,193.026 pumped heat,"heating and cooling, ""commercial
Verbosity Indicators8 hits · 12 pts
SeverityFileLineSnippet
LOWpackages/mermaid-layout-tidy-tree/src/render.ts51 // Step 1: Insert nodes into DOM to get their actual dimensions
LOWpackages/mermaid-layout-tidy-tree/src/render.ts90 // Step 2: Run the bidirectional tidy-tree layout algorithm
LOWpackages/mermaid-layout-tidy-tree/src/render.ts106 // Step 3: Position the nodes based on bidirectional layout results
LOWpackages/mermaid-layout-tidy-tree/src/render.ts121 // Step 3: Position the nodes based on bidirectional layout results
LOW…endering-util/layout-algorithms/cose-bilkent/render.ts51 // Step 1: Insert nodes into DOM to get their actual dimensions
LOW…endering-util/layout-algorithms/cose-bilkent/render.ts86 // Step 2: Run the cose-bilkent layout algorithm
LOW…endering-util/layout-algorithms/cose-bilkent/render.ts104 // Step 3: Position the nodes based on layout results
LOW…endering-util/layout-algorithms/cose-bilkent/render.ts137 // Step 4: Insert and position edges
Fake / Example Data6 hits · 6 pts
SeverityFileLineSnippet
LOWpackages/mermaid/src/diagrams/kanban/samples.md71 descr: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolor
LOWpackages/mermaid/src/diagrams/kanban/samples.md71 descr: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolor
LOWpackages/mermaid/src/diagrams/kanban/samples.md99 descr: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolor
LOWpackages/mermaid/src/diagrams/kanban/samples.md99 descr: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolor
LOWdemos/xychart.html212 x-axis "this is x axis" [category1, "Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint
LOWdemos/xychart.html212 x-axis "this is x axis" [category1, "Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint
Slop Phrases3 hits · 4 pts
SeverityFileLineSnippet
LOW.github/workflows/lint.yml55 # make sure to return an error exitcode so that GitHub actions shows a red-cross
LOW.github/workflows/lint.yml68 # make sure to return an error exitcode so that GitHub actions shows a red-cross
LOW.github/workflows/lint.yml82 # make sure to return an error exitcode so that GitHub actions shows a red-cross
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMpackages/mermaid/src/schemas/config.schema.yaml4# This file defines the MermaidConfig JSON Schema as a YAML file.