MCPcopy Create free account
hub / github.com/code-pushup/cli / auditDetails

Function auditDetails

packages/utils/src/lib/reports/generate-md-report.ts:115–142  ·  view source on GitHub ↗
(
  audit: AuditReport,
  options?: MdReportOptions,
)

Source from the content-addressed store, hash-verified

113}
114
115export function auditDetails(
116 audit: AuditReport,
117 options?: MdReportOptions,
118): MarkdownDocument {
119 const { table, issues = [], trees = [] } = audit.details ?? {};
120 const detailsValue = auditDetailsAuditValue(audit);
121
122 // undefined details OR empty details (undefined issues OR empty issues AND empty table)
123 if (issues.length === 0 && !table?.rows.length && trees.length === 0) {
124 return new MarkdownDocument().paragraph(detailsValue);
125 }
126
127 const tableSectionContent = table && tableSection(table);
128 const issuesSectionContent =
129 issues.length > 0 && auditDetailsIssues(issues, options);
130 const treesSectionContent =
131 trees.length > 0 &&
132 new MarkdownDocument().$concat(...trees.map(tree => treeSection(tree)));
133
134 return new MarkdownDocument().details(
135 detailsValue,
136 new MarkdownDocument().$concat(
137 tableSectionContent,
138 treesSectionContent,
139 issuesSectionContent,
140 ),
141 );
142}
143
144export function auditsSection(
145 { plugins }: Pick<ScoredReport, 'plugins'>,

Callers 2

auditsSectionFunction · 0.85

Calls 4

auditDetailsAuditValueFunction · 0.85
tableSectionFunction · 0.85
auditDetailsIssuesFunction · 0.85
treeSectionFunction · 0.85

Tested by

no test coverage detected