Address code review: extract magic number as named constant

Co-authored-by: liyupi <26037703+liyupi@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-22 06:43:41 +00:00
parent 32aa591732
commit 21b74f52cd
+2 -1
View File
@@ -140,7 +140,8 @@ function generateHTML(stats) {
const categoryChinese = JSON.stringify(categories.map(([, v]) => v.chineseChars));
const sizeLabels = JSON.stringify(stats.sizeDistribution.map((d) => d.label));
const sizeCounts = JSON.stringify(stats.sizeDistribution.map((d) => d.count));
const topLabels = JSON.stringify(stats.topFiles.map((f) => f.title.length > 18 ? f.title.slice(0, 18) + "…" : f.title));
const MAX_CHART_TITLE_LENGTH = 18;
const topLabels = JSON.stringify(stats.topFiles.map((f) => f.title.length > MAX_CHART_TITLE_LENGTH ? f.title.slice(0, MAX_CHART_TITLE_LENGTH) + "…" : f.title));
const topChars = JSON.stringify(stats.topFiles.map((f) => f.chineseChars));
const subLabels = JSON.stringify(subcategories.map(([k]) => k));
const subCounts = JSON.stringify(subcategories.map(([, v]) => v.fileCount));