@industry-theme/file-city-panel 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/panels/CodeCityPanel.d.ts.map +1 -1
- package/dist/panels/CodeCityPanel.stories.d.ts +29 -3
- package/dist/panels/CodeCityPanel.stories.d.ts.map +1 -1
- package/dist/panels/utils/qualityLayers.d.ts +6 -0
- package/dist/panels/utils/qualityLayers.d.ts.map +1 -1
- package/dist/panels.bundle.js +411 -71
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +1 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -14272,18 +14272,12 @@ function normalizePath(path) {
|
|
|
14272
14272
|
function createCoverageHighlightLayers(buildings, fileCoverage) {
|
|
14273
14273
|
const buildingsByPath = new Map(buildings.map((b) => [b.path, b]));
|
|
14274
14274
|
const layerGroups = {
|
|
14275
|
-
|
|
14276
|
-
//
|
|
14277
|
-
|
|
14278
|
-
//
|
|
14279
|
-
low: [],
|
|
14280
|
-
// 20-49%
|
|
14281
|
-
veryLow: [],
|
|
14282
|
-
// 1-19%
|
|
14283
|
-
zero: [],
|
|
14284
|
-
// 0%
|
|
14275
|
+
covered: [],
|
|
14276
|
+
// > 0% coverage - green
|
|
14277
|
+
uncovered: [],
|
|
14278
|
+
// 0% coverage - red
|
|
14285
14279
|
noData: []
|
|
14286
|
-
// No coverage data
|
|
14280
|
+
// No coverage data (not applicable) - gray
|
|
14287
14281
|
};
|
|
14288
14282
|
for (const [path, building] of buildingsByPath) {
|
|
14289
14283
|
const normalizedPath = normalizePath(path);
|
|
@@ -14294,32 +14288,201 @@ function createCoverageHighlightLayers(buildings, fileCoverage) {
|
|
|
14294
14288
|
type: "file",
|
|
14295
14289
|
renderStrategy: "fill"
|
|
14296
14290
|
});
|
|
14297
|
-
} else if (coverage
|
|
14298
|
-
layerGroups.
|
|
14291
|
+
} else if (coverage > 0) {
|
|
14292
|
+
layerGroups.covered.push({
|
|
14299
14293
|
path: building.path,
|
|
14300
14294
|
type: "file",
|
|
14301
14295
|
renderStrategy: "fill"
|
|
14302
14296
|
});
|
|
14303
|
-
} else
|
|
14304
|
-
layerGroups.
|
|
14297
|
+
} else {
|
|
14298
|
+
layerGroups.uncovered.push({
|
|
14305
14299
|
path: building.path,
|
|
14306
14300
|
type: "file",
|
|
14307
14301
|
renderStrategy: "fill"
|
|
14308
14302
|
});
|
|
14309
|
-
}
|
|
14310
|
-
|
|
14303
|
+
}
|
|
14304
|
+
}
|
|
14305
|
+
const layers = [];
|
|
14306
|
+
if (layerGroups.covered.length > 0) {
|
|
14307
|
+
layers.push({
|
|
14308
|
+
id: "coverage-covered",
|
|
14309
|
+
name: "Covered",
|
|
14310
|
+
enabled: true,
|
|
14311
|
+
color: "#22c55e",
|
|
14312
|
+
// green
|
|
14313
|
+
priority: 50,
|
|
14314
|
+
items: layerGroups.covered
|
|
14315
|
+
});
|
|
14316
|
+
}
|
|
14317
|
+
if (layerGroups.uncovered.length > 0) {
|
|
14318
|
+
layers.push({
|
|
14319
|
+
id: "coverage-uncovered",
|
|
14320
|
+
name: "Not covered",
|
|
14321
|
+
enabled: true,
|
|
14322
|
+
color: "#ef4444",
|
|
14323
|
+
// red
|
|
14324
|
+
priority: 50,
|
|
14325
|
+
items: layerGroups.uncovered
|
|
14326
|
+
});
|
|
14327
|
+
}
|
|
14328
|
+
if (layerGroups.noData.length > 0) {
|
|
14329
|
+
layers.push({
|
|
14330
|
+
id: "coverage-nodata",
|
|
14331
|
+
name: "No data",
|
|
14332
|
+
enabled: true,
|
|
14333
|
+
color: "#6b7280",
|
|
14334
|
+
// gray
|
|
14335
|
+
priority: 40,
|
|
14336
|
+
items: layerGroups.noData
|
|
14337
|
+
});
|
|
14338
|
+
}
|
|
14339
|
+
return layers;
|
|
14340
|
+
}
|
|
14341
|
+
function createEslintHighlightLayers(buildings, eslintMetrics) {
|
|
14342
|
+
const buildingsByPath = new Map(buildings.map((b) => [b.path, b]));
|
|
14343
|
+
const metricsByPath = new Map(eslintMetrics.map((m) => [normalizePath(m.file), m]));
|
|
14344
|
+
const layerGroups = {
|
|
14345
|
+
clean: [],
|
|
14346
|
+
// 0 issues - green
|
|
14347
|
+
minor: [],
|
|
14348
|
+
// 1-3 issues - orange
|
|
14349
|
+
moderate: [],
|
|
14350
|
+
// 4-10 issues - orange-red
|
|
14351
|
+
significant: [],
|
|
14352
|
+
// 11-25 issues - red
|
|
14353
|
+
severe: [],
|
|
14354
|
+
// 26+ issues - dark red
|
|
14355
|
+
noData: []
|
|
14356
|
+
// No metric data
|
|
14357
|
+
};
|
|
14358
|
+
for (const [path, building] of buildingsByPath) {
|
|
14359
|
+
const normalizedPath = normalizePath(path);
|
|
14360
|
+
const metric = metricsByPath.get(normalizedPath);
|
|
14361
|
+
if (!metric) {
|
|
14362
|
+
layerGroups.noData.push({
|
|
14311
14363
|
path: building.path,
|
|
14312
14364
|
type: "file",
|
|
14313
14365
|
renderStrategy: "fill"
|
|
14314
14366
|
});
|
|
14315
|
-
} else
|
|
14316
|
-
|
|
14367
|
+
} else {
|
|
14368
|
+
const issues = metric.issueCount;
|
|
14369
|
+
let bucket;
|
|
14370
|
+
if (issues === 0) bucket = "clean";
|
|
14371
|
+
else if (issues <= 3) bucket = "minor";
|
|
14372
|
+
else if (issues <= 10) bucket = "moderate";
|
|
14373
|
+
else if (issues <= 25) bucket = "significant";
|
|
14374
|
+
else bucket = "severe";
|
|
14375
|
+
layerGroups[bucket].push({
|
|
14376
|
+
path: building.path,
|
|
14377
|
+
type: "file",
|
|
14378
|
+
renderStrategy: "fill"
|
|
14379
|
+
});
|
|
14380
|
+
}
|
|
14381
|
+
}
|
|
14382
|
+
const layers = [];
|
|
14383
|
+
if (layerGroups.clean.length > 0) {
|
|
14384
|
+
layers.push({
|
|
14385
|
+
id: "eslint-clean",
|
|
14386
|
+
name: "0 issues",
|
|
14387
|
+
enabled: true,
|
|
14388
|
+
color: "#22c55e",
|
|
14389
|
+
// green - only for no lint issues
|
|
14390
|
+
priority: 50,
|
|
14391
|
+
items: layerGroups.clean
|
|
14392
|
+
});
|
|
14393
|
+
}
|
|
14394
|
+
if (layerGroups.minor.length > 0) {
|
|
14395
|
+
layers.push({
|
|
14396
|
+
id: "eslint-minor",
|
|
14397
|
+
name: "1-3 issues",
|
|
14398
|
+
enabled: true,
|
|
14399
|
+
color: "#f97316",
|
|
14400
|
+
// orange
|
|
14401
|
+
priority: 50,
|
|
14402
|
+
items: layerGroups.minor
|
|
14403
|
+
});
|
|
14404
|
+
}
|
|
14405
|
+
if (layerGroups.moderate.length > 0) {
|
|
14406
|
+
layers.push({
|
|
14407
|
+
id: "eslint-moderate",
|
|
14408
|
+
name: "4-10 issues",
|
|
14409
|
+
enabled: true,
|
|
14410
|
+
color: "#ea580c",
|
|
14411
|
+
// orange-600 (darker orange)
|
|
14412
|
+
priority: 50,
|
|
14413
|
+
items: layerGroups.moderate
|
|
14414
|
+
});
|
|
14415
|
+
}
|
|
14416
|
+
if (layerGroups.significant.length > 0) {
|
|
14417
|
+
layers.push({
|
|
14418
|
+
id: "eslint-significant",
|
|
14419
|
+
name: "11-25 issues",
|
|
14420
|
+
enabled: true,
|
|
14421
|
+
color: "#ef4444",
|
|
14422
|
+
// red
|
|
14423
|
+
priority: 50,
|
|
14424
|
+
items: layerGroups.significant
|
|
14425
|
+
});
|
|
14426
|
+
}
|
|
14427
|
+
if (layerGroups.severe.length > 0) {
|
|
14428
|
+
layers.push({
|
|
14429
|
+
id: "eslint-severe",
|
|
14430
|
+
name: "26+ issues",
|
|
14431
|
+
enabled: true,
|
|
14432
|
+
color: "#991b1b",
|
|
14433
|
+
// dark red
|
|
14434
|
+
priority: 50,
|
|
14435
|
+
items: layerGroups.severe
|
|
14436
|
+
});
|
|
14437
|
+
}
|
|
14438
|
+
if (layerGroups.noData.length > 0) {
|
|
14439
|
+
layers.push({
|
|
14440
|
+
id: "eslint-nodata",
|
|
14441
|
+
name: "No data",
|
|
14442
|
+
enabled: true,
|
|
14443
|
+
color: "#6b7280",
|
|
14444
|
+
// gray
|
|
14445
|
+
priority: 40,
|
|
14446
|
+
items: layerGroups.noData
|
|
14447
|
+
});
|
|
14448
|
+
}
|
|
14449
|
+
return layers;
|
|
14450
|
+
}
|
|
14451
|
+
function createTypescriptHighlightLayers(buildings, typescriptMetrics) {
|
|
14452
|
+
const buildingsByPath = new Map(buildings.map((b) => [b.path, b]));
|
|
14453
|
+
const metricsByPath = new Map(typescriptMetrics.map((m) => [normalizePath(m.file), m]));
|
|
14454
|
+
const layerGroups = {
|
|
14455
|
+
clean: [],
|
|
14456
|
+
// 0 issues - green
|
|
14457
|
+
minor: [],
|
|
14458
|
+
// 1-3 issues - orange
|
|
14459
|
+
moderate: [],
|
|
14460
|
+
// 4-10 issues - orange-red
|
|
14461
|
+
significant: [],
|
|
14462
|
+
// 11-25 issues - red
|
|
14463
|
+
severe: [],
|
|
14464
|
+
// 26+ issues - dark red
|
|
14465
|
+
noData: []
|
|
14466
|
+
// No metric data
|
|
14467
|
+
};
|
|
14468
|
+
for (const [path, building] of buildingsByPath) {
|
|
14469
|
+
const normalizedPath = normalizePath(path);
|
|
14470
|
+
const metric = metricsByPath.get(normalizedPath);
|
|
14471
|
+
if (!metric) {
|
|
14472
|
+
layerGroups.noData.push({
|
|
14317
14473
|
path: building.path,
|
|
14318
14474
|
type: "file",
|
|
14319
14475
|
renderStrategy: "fill"
|
|
14320
14476
|
});
|
|
14321
14477
|
} else {
|
|
14322
|
-
|
|
14478
|
+
const issues = metric.issueCount;
|
|
14479
|
+
let bucket;
|
|
14480
|
+
if (issues === 0) bucket = "clean";
|
|
14481
|
+
else if (issues <= 3) bucket = "minor";
|
|
14482
|
+
else if (issues <= 10) bucket = "moderate";
|
|
14483
|
+
else if (issues <= 25) bucket = "significant";
|
|
14484
|
+
else bucket = "severe";
|
|
14485
|
+
layerGroups[bucket].push({
|
|
14323
14486
|
path: building.path,
|
|
14324
14487
|
type: "file",
|
|
14325
14488
|
renderStrategy: "fill"
|
|
@@ -14327,82 +14490,88 @@ function createCoverageHighlightLayers(buildings, fileCoverage) {
|
|
|
14327
14490
|
}
|
|
14328
14491
|
}
|
|
14329
14492
|
const layers = [];
|
|
14330
|
-
if (layerGroups.
|
|
14493
|
+
if (layerGroups.clean.length > 0) {
|
|
14331
14494
|
layers.push({
|
|
14332
|
-
id: "
|
|
14333
|
-
name: "
|
|
14495
|
+
id: "typescript-clean",
|
|
14496
|
+
name: "0 errors",
|
|
14334
14497
|
enabled: true,
|
|
14335
14498
|
color: "#22c55e",
|
|
14499
|
+
// green - only for no type errors
|
|
14336
14500
|
priority: 50,
|
|
14337
|
-
items: layerGroups.
|
|
14501
|
+
items: layerGroups.clean
|
|
14338
14502
|
});
|
|
14339
14503
|
}
|
|
14340
|
-
if (layerGroups.
|
|
14504
|
+
if (layerGroups.minor.length > 0) {
|
|
14341
14505
|
layers.push({
|
|
14342
|
-
id: "
|
|
14343
|
-
name: "
|
|
14506
|
+
id: "typescript-minor",
|
|
14507
|
+
name: "1-3 errors",
|
|
14344
14508
|
enabled: true,
|
|
14345
|
-
color: "#
|
|
14509
|
+
color: "#f97316",
|
|
14510
|
+
// orange
|
|
14346
14511
|
priority: 50,
|
|
14347
|
-
items: layerGroups.
|
|
14512
|
+
items: layerGroups.minor
|
|
14348
14513
|
});
|
|
14349
14514
|
}
|
|
14350
|
-
if (layerGroups.
|
|
14515
|
+
if (layerGroups.moderate.length > 0) {
|
|
14351
14516
|
layers.push({
|
|
14352
|
-
id: "
|
|
14353
|
-
name: "
|
|
14517
|
+
id: "typescript-moderate",
|
|
14518
|
+
name: "4-10 errors",
|
|
14354
14519
|
enabled: true,
|
|
14355
|
-
color: "#
|
|
14520
|
+
color: "#ea580c",
|
|
14521
|
+
// orange-600 (darker orange)
|
|
14356
14522
|
priority: 50,
|
|
14357
|
-
items: layerGroups.
|
|
14523
|
+
items: layerGroups.moderate
|
|
14358
14524
|
});
|
|
14359
14525
|
}
|
|
14360
|
-
if (layerGroups.
|
|
14526
|
+
if (layerGroups.significant.length > 0) {
|
|
14361
14527
|
layers.push({
|
|
14362
|
-
id: "
|
|
14363
|
-
name: "
|
|
14528
|
+
id: "typescript-significant",
|
|
14529
|
+
name: "11-25 errors",
|
|
14364
14530
|
enabled: true,
|
|
14365
14531
|
color: "#ef4444",
|
|
14532
|
+
// red
|
|
14366
14533
|
priority: 50,
|
|
14367
|
-
items: layerGroups.
|
|
14534
|
+
items: layerGroups.significant
|
|
14368
14535
|
});
|
|
14369
14536
|
}
|
|
14370
|
-
if (layerGroups.
|
|
14537
|
+
if (layerGroups.severe.length > 0) {
|
|
14371
14538
|
layers.push({
|
|
14372
|
-
id: "
|
|
14373
|
-
name: "
|
|
14539
|
+
id: "typescript-severe",
|
|
14540
|
+
name: "26+ errors",
|
|
14374
14541
|
enabled: true,
|
|
14375
14542
|
color: "#991b1b",
|
|
14543
|
+
// dark red
|
|
14376
14544
|
priority: 50,
|
|
14377
|
-
items: layerGroups.
|
|
14545
|
+
items: layerGroups.severe
|
|
14378
14546
|
});
|
|
14379
14547
|
}
|
|
14380
14548
|
if (layerGroups.noData.length > 0) {
|
|
14381
14549
|
layers.push({
|
|
14382
|
-
id: "
|
|
14550
|
+
id: "typescript-nodata",
|
|
14383
14551
|
name: "No data",
|
|
14384
14552
|
enabled: true,
|
|
14385
14553
|
color: "#6b7280",
|
|
14554
|
+
// gray
|
|
14386
14555
|
priority: 40,
|
|
14387
14556
|
items: layerGroups.noData
|
|
14388
14557
|
});
|
|
14389
14558
|
}
|
|
14390
14559
|
return layers;
|
|
14391
14560
|
}
|
|
14392
|
-
function
|
|
14561
|
+
function createPrettierHighlightLayers(buildings, prettierMetrics) {
|
|
14393
14562
|
const buildingsByPath = new Map(buildings.map((b) => [b.path, b]));
|
|
14394
|
-
const metricsByPath = new Map(
|
|
14563
|
+
const metricsByPath = new Map(prettierMetrics.map((m) => [normalizePath(m.file), m]));
|
|
14395
14564
|
const layerGroups = {
|
|
14396
14565
|
clean: [],
|
|
14397
|
-
// 0 issues
|
|
14566
|
+
// 0 issues - green
|
|
14398
14567
|
minor: [],
|
|
14399
|
-
// 1-3 issues
|
|
14568
|
+
// 1-3 issues - orange
|
|
14400
14569
|
moderate: [],
|
|
14401
|
-
// 4-10 issues
|
|
14570
|
+
// 4-10 issues - orange-red
|
|
14402
14571
|
significant: [],
|
|
14403
|
-
// 11-25 issues
|
|
14572
|
+
// 11-25 issues - red
|
|
14404
14573
|
severe: [],
|
|
14405
|
-
// 26+ issues
|
|
14574
|
+
// 26+ issues - dark red
|
|
14406
14575
|
noData: []
|
|
14407
14576
|
// No metric data
|
|
14408
14577
|
};
|
|
@@ -14433,80 +14602,251 @@ function createMetricHighlightLayers(buildings, metrics, metricId, _metricName)
|
|
|
14433
14602
|
const layers = [];
|
|
14434
14603
|
if (layerGroups.clean.length > 0) {
|
|
14435
14604
|
layers.push({
|
|
14436
|
-
id:
|
|
14605
|
+
id: "prettier-clean",
|
|
14437
14606
|
name: "0 issues",
|
|
14438
14607
|
enabled: true,
|
|
14439
14608
|
color: "#22c55e",
|
|
14609
|
+
// green - only for perfect formatting
|
|
14440
14610
|
priority: 50,
|
|
14441
14611
|
items: layerGroups.clean
|
|
14442
14612
|
});
|
|
14443
14613
|
}
|
|
14444
14614
|
if (layerGroups.minor.length > 0) {
|
|
14445
14615
|
layers.push({
|
|
14446
|
-
id:
|
|
14616
|
+
id: "prettier-minor",
|
|
14447
14617
|
name: "1-3 issues",
|
|
14448
14618
|
enabled: true,
|
|
14449
|
-
color: "#
|
|
14619
|
+
color: "#f97316",
|
|
14620
|
+
// orange
|
|
14450
14621
|
priority: 50,
|
|
14451
14622
|
items: layerGroups.minor
|
|
14452
14623
|
});
|
|
14453
14624
|
}
|
|
14454
14625
|
if (layerGroups.moderate.length > 0) {
|
|
14455
14626
|
layers.push({
|
|
14456
|
-
id:
|
|
14627
|
+
id: "prettier-moderate",
|
|
14457
14628
|
name: "4-10 issues",
|
|
14458
14629
|
enabled: true,
|
|
14459
|
-
color: "#
|
|
14630
|
+
color: "#ea580c",
|
|
14631
|
+
// orange-600 (darker orange)
|
|
14460
14632
|
priority: 50,
|
|
14461
14633
|
items: layerGroups.moderate
|
|
14462
14634
|
});
|
|
14463
14635
|
}
|
|
14464
14636
|
if (layerGroups.significant.length > 0) {
|
|
14465
14637
|
layers.push({
|
|
14466
|
-
id:
|
|
14638
|
+
id: "prettier-significant",
|
|
14467
14639
|
name: "11-25 issues",
|
|
14468
14640
|
enabled: true,
|
|
14469
|
-
color: "#
|
|
14641
|
+
color: "#ef4444",
|
|
14642
|
+
// red
|
|
14470
14643
|
priority: 50,
|
|
14471
14644
|
items: layerGroups.significant
|
|
14472
14645
|
});
|
|
14473
14646
|
}
|
|
14474
14647
|
if (layerGroups.severe.length > 0) {
|
|
14475
14648
|
layers.push({
|
|
14476
|
-
id:
|
|
14649
|
+
id: "prettier-severe",
|
|
14477
14650
|
name: "26+ issues",
|
|
14478
14651
|
enabled: true,
|
|
14479
|
-
color: "#
|
|
14652
|
+
color: "#991b1b",
|
|
14653
|
+
// dark red
|
|
14480
14654
|
priority: 50,
|
|
14481
14655
|
items: layerGroups.severe
|
|
14482
14656
|
});
|
|
14483
14657
|
}
|
|
14484
14658
|
if (layerGroups.noData.length > 0) {
|
|
14485
14659
|
layers.push({
|
|
14486
|
-
id:
|
|
14660
|
+
id: "prettier-nodata",
|
|
14487
14661
|
name: "No data",
|
|
14488
14662
|
enabled: true,
|
|
14489
14663
|
color: "#6b7280",
|
|
14664
|
+
// gray
|
|
14490
14665
|
priority: 40,
|
|
14491
14666
|
items: layerGroups.noData
|
|
14492
14667
|
});
|
|
14493
14668
|
}
|
|
14494
14669
|
return layers;
|
|
14495
14670
|
}
|
|
14496
|
-
function createEslintHighlightLayers(buildings, eslintMetrics) {
|
|
14497
|
-
return createMetricHighlightLayers(buildings, eslintMetrics, "eslint");
|
|
14498
|
-
}
|
|
14499
|
-
function createTypescriptHighlightLayers(buildings, typescriptMetrics) {
|
|
14500
|
-
return createMetricHighlightLayers(buildings, typescriptMetrics, "typescript");
|
|
14501
|
-
}
|
|
14502
|
-
function createPrettierHighlightLayers(buildings, prettierMetrics) {
|
|
14503
|
-
return createMetricHighlightLayers(buildings, prettierMetrics, "prettier");
|
|
14504
|
-
}
|
|
14505
14671
|
function createKnipHighlightLayers(buildings, knipMetrics) {
|
|
14506
|
-
|
|
14672
|
+
const buildingsByPath = new Map(buildings.map((b) => [b.path, b]));
|
|
14673
|
+
const metricsByPath = new Map(knipMetrics.map((m) => [normalizePath(m.file), m]));
|
|
14674
|
+
const layerGroups = {
|
|
14675
|
+
clean: [],
|
|
14676
|
+
// 0 issues - green
|
|
14677
|
+
minor: [],
|
|
14678
|
+
// 1-3 issues - orange
|
|
14679
|
+
moderate: [],
|
|
14680
|
+
// 4-10 issues - orange-red
|
|
14681
|
+
significant: [],
|
|
14682
|
+
// 11-25 issues - red
|
|
14683
|
+
severe: [],
|
|
14684
|
+
// 26+ issues - dark red
|
|
14685
|
+
noData: []
|
|
14686
|
+
// No metric data
|
|
14687
|
+
};
|
|
14688
|
+
for (const [path, building] of buildingsByPath) {
|
|
14689
|
+
const normalizedPath = normalizePath(path);
|
|
14690
|
+
const metric = metricsByPath.get(normalizedPath);
|
|
14691
|
+
if (!metric) {
|
|
14692
|
+
layerGroups.noData.push({
|
|
14693
|
+
path: building.path,
|
|
14694
|
+
type: "file",
|
|
14695
|
+
renderStrategy: "fill"
|
|
14696
|
+
});
|
|
14697
|
+
} else {
|
|
14698
|
+
const issues = metric.issueCount;
|
|
14699
|
+
let bucket;
|
|
14700
|
+
if (issues === 0) bucket = "clean";
|
|
14701
|
+
else if (issues <= 3) bucket = "minor";
|
|
14702
|
+
else if (issues <= 10) bucket = "moderate";
|
|
14703
|
+
else if (issues <= 25) bucket = "significant";
|
|
14704
|
+
else bucket = "severe";
|
|
14705
|
+
layerGroups[bucket].push({
|
|
14706
|
+
path: building.path,
|
|
14707
|
+
type: "file",
|
|
14708
|
+
renderStrategy: "fill"
|
|
14709
|
+
});
|
|
14710
|
+
}
|
|
14711
|
+
}
|
|
14712
|
+
const layers = [];
|
|
14713
|
+
if (layerGroups.clean.length > 0) {
|
|
14714
|
+
layers.push({
|
|
14715
|
+
id: "knip-clean",
|
|
14716
|
+
name: "0 unused",
|
|
14717
|
+
enabled: true,
|
|
14718
|
+
color: "#22c55e",
|
|
14719
|
+
// green - only for no dead code
|
|
14720
|
+
priority: 50,
|
|
14721
|
+
items: layerGroups.clean
|
|
14722
|
+
});
|
|
14723
|
+
}
|
|
14724
|
+
if (layerGroups.minor.length > 0) {
|
|
14725
|
+
layers.push({
|
|
14726
|
+
id: "knip-minor",
|
|
14727
|
+
name: "1-3 unused",
|
|
14728
|
+
enabled: true,
|
|
14729
|
+
color: "#f97316",
|
|
14730
|
+
// orange
|
|
14731
|
+
priority: 50,
|
|
14732
|
+
items: layerGroups.minor
|
|
14733
|
+
});
|
|
14734
|
+
}
|
|
14735
|
+
if (layerGroups.moderate.length > 0) {
|
|
14736
|
+
layers.push({
|
|
14737
|
+
id: "knip-moderate",
|
|
14738
|
+
name: "4-10 unused",
|
|
14739
|
+
enabled: true,
|
|
14740
|
+
color: "#ea580c",
|
|
14741
|
+
// orange-600 (darker orange)
|
|
14742
|
+
priority: 50,
|
|
14743
|
+
items: layerGroups.moderate
|
|
14744
|
+
});
|
|
14745
|
+
}
|
|
14746
|
+
if (layerGroups.significant.length > 0) {
|
|
14747
|
+
layers.push({
|
|
14748
|
+
id: "knip-significant",
|
|
14749
|
+
name: "11-25 unused",
|
|
14750
|
+
enabled: true,
|
|
14751
|
+
color: "#ef4444",
|
|
14752
|
+
// red
|
|
14753
|
+
priority: 50,
|
|
14754
|
+
items: layerGroups.significant
|
|
14755
|
+
});
|
|
14756
|
+
}
|
|
14757
|
+
if (layerGroups.severe.length > 0) {
|
|
14758
|
+
layers.push({
|
|
14759
|
+
id: "knip-severe",
|
|
14760
|
+
name: "26+ unused",
|
|
14761
|
+
enabled: true,
|
|
14762
|
+
color: "#991b1b",
|
|
14763
|
+
// dark red
|
|
14764
|
+
priority: 50,
|
|
14765
|
+
items: layerGroups.severe
|
|
14766
|
+
});
|
|
14767
|
+
}
|
|
14768
|
+
if (layerGroups.noData.length > 0) {
|
|
14769
|
+
layers.push({
|
|
14770
|
+
id: "knip-nodata",
|
|
14771
|
+
name: "No data",
|
|
14772
|
+
enabled: true,
|
|
14773
|
+
color: "#6b7280",
|
|
14774
|
+
// gray
|
|
14775
|
+
priority: 40,
|
|
14776
|
+
items: layerGroups.noData
|
|
14777
|
+
});
|
|
14778
|
+
}
|
|
14779
|
+
return layers;
|
|
14507
14780
|
}
|
|
14508
14781
|
function createAlexandriaHighlightLayers(buildings, alexandriaMetrics) {
|
|
14509
|
-
|
|
14782
|
+
const buildingsByPath = new Map(buildings.map((b) => [b.path, b]));
|
|
14783
|
+
const metricsByPath = new Map(alexandriaMetrics.map((m) => [normalizePath(m.file), m]));
|
|
14784
|
+
const layerGroups = {
|
|
14785
|
+
documented: [],
|
|
14786
|
+
// 0 issues - fully documented
|
|
14787
|
+
needsDocs: [],
|
|
14788
|
+
// > 0 issues - needs documentation
|
|
14789
|
+
noData: []
|
|
14790
|
+
// No data (not applicable)
|
|
14791
|
+
};
|
|
14792
|
+
for (const [path, building] of buildingsByPath) {
|
|
14793
|
+
const normalizedPath = normalizePath(path);
|
|
14794
|
+
const metric = metricsByPath.get(normalizedPath);
|
|
14795
|
+
if (!metric) {
|
|
14796
|
+
layerGroups.noData.push({
|
|
14797
|
+
path: building.path,
|
|
14798
|
+
type: "file",
|
|
14799
|
+
renderStrategy: "fill"
|
|
14800
|
+
});
|
|
14801
|
+
} else if (metric.issueCount === 0) {
|
|
14802
|
+
layerGroups.documented.push({
|
|
14803
|
+
path: building.path,
|
|
14804
|
+
type: "file",
|
|
14805
|
+
renderStrategy: "fill"
|
|
14806
|
+
});
|
|
14807
|
+
} else {
|
|
14808
|
+
layerGroups.needsDocs.push({
|
|
14809
|
+
path: building.path,
|
|
14810
|
+
type: "file",
|
|
14811
|
+
renderStrategy: "fill"
|
|
14812
|
+
});
|
|
14813
|
+
}
|
|
14814
|
+
}
|
|
14815
|
+
const layers = [];
|
|
14816
|
+
if (layerGroups.documented.length > 0) {
|
|
14817
|
+
layers.push({
|
|
14818
|
+
id: "alexandria-documented",
|
|
14819
|
+
name: "Documented",
|
|
14820
|
+
enabled: true,
|
|
14821
|
+
color: "#22c55e",
|
|
14822
|
+
// green
|
|
14823
|
+
priority: 50,
|
|
14824
|
+
items: layerGroups.documented
|
|
14825
|
+
});
|
|
14826
|
+
}
|
|
14827
|
+
if (layerGroups.needsDocs.length > 0) {
|
|
14828
|
+
layers.push({
|
|
14829
|
+
id: "alexandria-needsdocs",
|
|
14830
|
+
name: "Needs docs",
|
|
14831
|
+
enabled: true,
|
|
14832
|
+
color: "#ef4444",
|
|
14833
|
+
// red
|
|
14834
|
+
priority: 50,
|
|
14835
|
+
items: layerGroups.needsDocs
|
|
14836
|
+
});
|
|
14837
|
+
}
|
|
14838
|
+
if (layerGroups.noData.length > 0) {
|
|
14839
|
+
layers.push({
|
|
14840
|
+
id: "alexandria-nodata",
|
|
14841
|
+
name: "No data",
|
|
14842
|
+
enabled: true,
|
|
14843
|
+
color: "#6b7280",
|
|
14844
|
+
// gray
|
|
14845
|
+
priority: 40,
|
|
14846
|
+
items: layerGroups.noData
|
|
14847
|
+
});
|
|
14848
|
+
}
|
|
14849
|
+
return layers;
|
|
14510
14850
|
}
|
|
14511
14851
|
function getLayersForColorMode(mode, buildings, qualityData, fileColorLayers, gitLayers) {
|
|
14512
14852
|
var _a, _b, _c, _d, _e;
|