@principal-ade/code-quality-panels 0.1.19 → 0.1.20
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.bundle.js
CHANGED
|
@@ -106,7 +106,7 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
106
106
|
* This source code is licensed under the ISC license.
|
|
107
107
|
* See the LICENSE file in the root directory of this source tree.
|
|
108
108
|
*/
|
|
109
|
-
const __iconNode$
|
|
109
|
+
const __iconNode$f = [
|
|
110
110
|
["path", { d: "M12 7v14", key: "1akyts" }],
|
|
111
111
|
[
|
|
112
112
|
"path",
|
|
@@ -116,14 +116,14 @@ const __iconNode$e = [
|
|
|
116
116
|
}
|
|
117
117
|
]
|
|
118
118
|
];
|
|
119
|
-
const BookOpen = createLucideIcon("book-open", __iconNode$
|
|
119
|
+
const BookOpen = createLucideIcon("book-open", __iconNode$f);
|
|
120
120
|
/**
|
|
121
121
|
* @license lucide-react v0.552.0 - ISC
|
|
122
122
|
*
|
|
123
123
|
* This source code is licensed under the ISC license.
|
|
124
124
|
* See the LICENSE file in the root directory of this source tree.
|
|
125
125
|
*/
|
|
126
|
-
const __iconNode$
|
|
126
|
+
const __iconNode$e = [
|
|
127
127
|
[
|
|
128
128
|
"path",
|
|
129
129
|
{ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
|
|
@@ -136,14 +136,14 @@ const __iconNode$d = [
|
|
|
136
136
|
}
|
|
137
137
|
]
|
|
138
138
|
];
|
|
139
|
-
const Braces = createLucideIcon("braces", __iconNode$
|
|
139
|
+
const Braces = createLucideIcon("braces", __iconNode$e);
|
|
140
140
|
/**
|
|
141
141
|
* @license lucide-react v0.552.0 - ISC
|
|
142
142
|
*
|
|
143
143
|
* This source code is licensed under the ISC license.
|
|
144
144
|
* See the LICENSE file in the root directory of this source tree.
|
|
145
145
|
*/
|
|
146
|
-
const __iconNode$
|
|
146
|
+
const __iconNode$d = [
|
|
147
147
|
["path", { d: "M12 20v-9", key: "1qisl0" }],
|
|
148
148
|
["path", { d: "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z", key: "uouzyp" }],
|
|
149
149
|
["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
|
|
@@ -156,41 +156,41 @@ const __iconNode$c = [
|
|
|
156
156
|
["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
|
|
157
157
|
["path", { d: "M9 7.13V6a3 3 0 1 1 6 0v1.13", key: "1vgav8" }]
|
|
158
158
|
];
|
|
159
|
-
const Bug = createLucideIcon("bug", __iconNode$
|
|
159
|
+
const Bug = createLucideIcon("bug", __iconNode$d);
|
|
160
160
|
/**
|
|
161
161
|
* @license lucide-react v0.552.0 - ISC
|
|
162
162
|
*
|
|
163
163
|
* This source code is licensed under the ISC license.
|
|
164
164
|
* See the LICENSE file in the root directory of this source tree.
|
|
165
165
|
*/
|
|
166
|
-
const __iconNode$
|
|
167
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
166
|
+
const __iconNode$c = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
167
|
+
const Check = createLucideIcon("check", __iconNode$c);
|
|
168
168
|
/**
|
|
169
169
|
* @license lucide-react v0.552.0 - ISC
|
|
170
170
|
*
|
|
171
171
|
* This source code is licensed under the ISC license.
|
|
172
172
|
* See the LICENSE file in the root directory of this source tree.
|
|
173
173
|
*/
|
|
174
|
-
const __iconNode$
|
|
175
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
174
|
+
const __iconNode$b = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
175
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$b);
|
|
176
176
|
/**
|
|
177
177
|
* @license lucide-react v0.552.0 - ISC
|
|
178
178
|
*
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
181
|
*/
|
|
182
|
-
const __iconNode$
|
|
182
|
+
const __iconNode$a = [
|
|
183
183
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
184
184
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
185
185
|
];
|
|
186
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
186
|
+
const Copy = createLucideIcon("copy", __iconNode$a);
|
|
187
187
|
/**
|
|
188
188
|
* @license lucide-react v0.552.0 - ISC
|
|
189
189
|
*
|
|
190
190
|
* This source code is licensed under the ISC license.
|
|
191
191
|
* See the LICENSE file in the root directory of this source tree.
|
|
192
192
|
*/
|
|
193
|
-
const __iconNode$
|
|
193
|
+
const __iconNode$9 = [
|
|
194
194
|
[
|
|
195
195
|
"path",
|
|
196
196
|
{
|
|
@@ -202,14 +202,14 @@ const __iconNode$8 = [
|
|
|
202
202
|
["circle", { cx: "11.5", cy: "14.5", r: "2.5", key: "1bq0ko" }],
|
|
203
203
|
["path", { d: "M13.3 16.3 15 18", key: "2quom7" }]
|
|
204
204
|
];
|
|
205
|
-
const FileSearch = createLucideIcon("file-search", __iconNode$
|
|
205
|
+
const FileSearch = createLucideIcon("file-search", __iconNode$9);
|
|
206
206
|
/**
|
|
207
207
|
* @license lucide-react v0.552.0 - ISC
|
|
208
208
|
*
|
|
209
209
|
* This source code is licensed under the ISC license.
|
|
210
210
|
* See the LICENSE file in the root directory of this source tree.
|
|
211
211
|
*/
|
|
212
|
-
const __iconNode$
|
|
212
|
+
const __iconNode$8 = [
|
|
213
213
|
[
|
|
214
214
|
"path",
|
|
215
215
|
{
|
|
@@ -220,27 +220,27 @@ const __iconNode$7 = [
|
|
|
220
220
|
["path", { d: "M6.453 15h11.094", key: "3shlmq" }],
|
|
221
221
|
["path", { d: "M8.5 2h7", key: "csnxdl" }]
|
|
222
222
|
];
|
|
223
|
-
const FlaskConical = createLucideIcon("flask-conical", __iconNode$
|
|
223
|
+
const FlaskConical = createLucideIcon("flask-conical", __iconNode$8);
|
|
224
224
|
/**
|
|
225
225
|
* @license lucide-react v0.552.0 - ISC
|
|
226
226
|
*
|
|
227
227
|
* This source code is licensed under the ISC license.
|
|
228
228
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
229
|
*/
|
|
230
|
-
const __iconNode$
|
|
230
|
+
const __iconNode$7 = [
|
|
231
231
|
["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
|
|
232
232
|
["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
|
|
233
233
|
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
234
234
|
["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
|
|
235
235
|
];
|
|
236
|
-
const GitBranch = createLucideIcon("git-branch", __iconNode$
|
|
236
|
+
const GitBranch = createLucideIcon("git-branch", __iconNode$7);
|
|
237
237
|
/**
|
|
238
238
|
* @license lucide-react v0.552.0 - ISC
|
|
239
239
|
*
|
|
240
240
|
* This source code is licensed under the ISC license.
|
|
241
241
|
* See the LICENSE file in the root directory of this source tree.
|
|
242
242
|
*/
|
|
243
|
-
const __iconNode$
|
|
243
|
+
const __iconNode$6 = [
|
|
244
244
|
[
|
|
245
245
|
"path",
|
|
246
246
|
{
|
|
@@ -249,26 +249,26 @@ const __iconNode$5 = [
|
|
|
249
249
|
}
|
|
250
250
|
]
|
|
251
251
|
];
|
|
252
|
-
const Hexagon = createLucideIcon("hexagon", __iconNode$
|
|
252
|
+
const Hexagon = createLucideIcon("hexagon", __iconNode$6);
|
|
253
253
|
/**
|
|
254
254
|
* @license lucide-react v0.552.0 - ISC
|
|
255
255
|
*
|
|
256
256
|
* This source code is licensed under the ISC license.
|
|
257
257
|
* See the LICENSE file in the root directory of this source tree.
|
|
258
258
|
*/
|
|
259
|
-
const __iconNode$
|
|
259
|
+
const __iconNode$5 = [
|
|
260
260
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
261
261
|
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
262
262
|
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
263
263
|
];
|
|
264
|
-
const Info = createLucideIcon("info", __iconNode$
|
|
264
|
+
const Info = createLucideIcon("info", __iconNode$5);
|
|
265
265
|
/**
|
|
266
266
|
* @license lucide-react v0.552.0 - ISC
|
|
267
267
|
*
|
|
268
268
|
* This source code is licensed under the ISC license.
|
|
269
269
|
* See the LICENSE file in the root directory of this source tree.
|
|
270
270
|
*/
|
|
271
|
-
const __iconNode$
|
|
271
|
+
const __iconNode$4 = [
|
|
272
272
|
[
|
|
273
273
|
"path",
|
|
274
274
|
{
|
|
@@ -280,32 +280,43 @@ const __iconNode$3 = [
|
|
|
280
280
|
["path", { d: "M22 4h-4", key: "gwowj6" }],
|
|
281
281
|
["circle", { cx: "4", cy: "20", r: "2", key: "6kqj1y" }]
|
|
282
282
|
];
|
|
283
|
-
const Sparkles = createLucideIcon("sparkles", __iconNode$
|
|
283
|
+
const Sparkles = createLucideIcon("sparkles", __iconNode$4);
|
|
284
284
|
/**
|
|
285
285
|
* @license lucide-react v0.552.0 - ISC
|
|
286
286
|
*
|
|
287
287
|
* This source code is licensed under the ISC license.
|
|
288
288
|
* See the LICENSE file in the root directory of this source tree.
|
|
289
289
|
*/
|
|
290
|
-
const __iconNode$
|
|
290
|
+
const __iconNode$3 = [
|
|
291
291
|
["path", { d: "M12 19h8", key: "baeox8" }],
|
|
292
292
|
["path", { d: "m4 17 6-6-6-6", key: "1yngyt" }]
|
|
293
293
|
];
|
|
294
|
-
const Terminal = createLucideIcon("terminal", __iconNode$
|
|
294
|
+
const Terminal = createLucideIcon("terminal", __iconNode$3);
|
|
295
295
|
/**
|
|
296
296
|
* @license lucide-react v0.552.0 - ISC
|
|
297
297
|
*
|
|
298
298
|
* This source code is licensed under the ISC license.
|
|
299
299
|
* See the LICENSE file in the root directory of this source tree.
|
|
300
300
|
*/
|
|
301
|
-
const __iconNode$
|
|
301
|
+
const __iconNode$2 = [
|
|
302
302
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
303
303
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
304
304
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
305
305
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
306
306
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
307
307
|
];
|
|
308
|
-
const Trash2 = createLucideIcon("trash-2", __iconNode$
|
|
308
|
+
const Trash2 = createLucideIcon("trash-2", __iconNode$2);
|
|
309
|
+
/**
|
|
310
|
+
* @license lucide-react v0.552.0 - ISC
|
|
311
|
+
*
|
|
312
|
+
* This source code is licensed under the ISC license.
|
|
313
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
+
*/
|
|
315
|
+
const __iconNode$1 = [
|
|
316
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
317
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
318
|
+
];
|
|
319
|
+
const X = createLucideIcon("x", __iconNode$1);
|
|
309
320
|
/**
|
|
310
321
|
* @license lucide-react v0.552.0 - ISC
|
|
311
322
|
*
|
|
@@ -1471,6 +1482,17 @@ const QualityHexagonPanelContent = ({
|
|
|
1471
1482
|
var _a;
|
|
1472
1483
|
const { theme } = useTheme();
|
|
1473
1484
|
const [refreshingPackages, setRefreshingPackages] = React2__default.useState(/* @__PURE__ */ new Set());
|
|
1485
|
+
const [showHelpOverlay, setShowHelpOverlay] = React2__default.useState(false);
|
|
1486
|
+
const [copiedCommand, setCopiedCommand] = React2__default.useState(null);
|
|
1487
|
+
const handleCopyCommand = async (command) => {
|
|
1488
|
+
try {
|
|
1489
|
+
await navigator.clipboard.writeText(command);
|
|
1490
|
+
setCopiedCommand(command);
|
|
1491
|
+
setTimeout(() => setCopiedCommand(null), 2e3);
|
|
1492
|
+
} catch {
|
|
1493
|
+
console.log("Copy:", command);
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1474
1496
|
const qualitySlice = context.getSlice("quality");
|
|
1475
1497
|
const hasQualitySlice = context.hasSlice("quality");
|
|
1476
1498
|
const isLoading = (qualitySlice == null ? void 0 : qualitySlice.loading) ?? false;
|
|
@@ -1536,7 +1558,8 @@ const QualityHexagonPanelContent = ({
|
|
|
1536
1558
|
overflowY: "auto",
|
|
1537
1559
|
boxSizing: "border-box",
|
|
1538
1560
|
display: "flex",
|
|
1539
|
-
flexDirection: "column"
|
|
1561
|
+
flexDirection: "column",
|
|
1562
|
+
position: "relative"
|
|
1540
1563
|
},
|
|
1541
1564
|
children: [
|
|
1542
1565
|
/* @__PURE__ */ jsxs("div", { style: {
|
|
@@ -1565,7 +1588,8 @@ const QualityHexagonPanelContent = ({
|
|
|
1565
1588
|
/* @__PURE__ */ jsx(
|
|
1566
1589
|
"span",
|
|
1567
1590
|
{
|
|
1568
|
-
|
|
1591
|
+
onClick: () => setShowHelpOverlay(true),
|
|
1592
|
+
title: "Click for help",
|
|
1569
1593
|
style: {
|
|
1570
1594
|
display: "inline-flex",
|
|
1571
1595
|
alignItems: "center",
|
|
@@ -1576,7 +1600,7 @@ const QualityHexagonPanelContent = ({
|
|
|
1576
1600
|
border: `1px solid ${theme.colors.border}`,
|
|
1577
1601
|
fontSize: 11,
|
|
1578
1602
|
color: theme.colors.textMuted,
|
|
1579
|
-
cursor: "
|
|
1603
|
+
cursor: "pointer"
|
|
1580
1604
|
},
|
|
1581
1605
|
children: "?"
|
|
1582
1606
|
}
|
|
@@ -1649,6 +1673,133 @@ const QualityHexagonPanelContent = ({
|
|
|
1649
1673
|
);
|
|
1650
1674
|
}) })
|
|
1651
1675
|
}
|
|
1676
|
+
),
|
|
1677
|
+
showHelpOverlay && /* @__PURE__ */ jsx(
|
|
1678
|
+
"div",
|
|
1679
|
+
{
|
|
1680
|
+
style: {
|
|
1681
|
+
position: "absolute",
|
|
1682
|
+
top: 0,
|
|
1683
|
+
left: 0,
|
|
1684
|
+
right: 0,
|
|
1685
|
+
bottom: 0,
|
|
1686
|
+
backgroundColor: "rgba(0, 0, 0, 0.7)",
|
|
1687
|
+
display: "flex",
|
|
1688
|
+
alignItems: "center",
|
|
1689
|
+
justifyContent: "center",
|
|
1690
|
+
zIndex: 100
|
|
1691
|
+
},
|
|
1692
|
+
onClick: () => setShowHelpOverlay(false),
|
|
1693
|
+
children: /* @__PURE__ */ jsxs(
|
|
1694
|
+
"div",
|
|
1695
|
+
{
|
|
1696
|
+
style: {
|
|
1697
|
+
backgroundColor: theme.colors.surface,
|
|
1698
|
+
borderRadius: 8,
|
|
1699
|
+
padding: 20,
|
|
1700
|
+
maxWidth: 400,
|
|
1701
|
+
width: "90%",
|
|
1702
|
+
border: `1px solid ${theme.colors.border}`
|
|
1703
|
+
},
|
|
1704
|
+
onClick: (e) => e.stopPropagation(),
|
|
1705
|
+
children: [
|
|
1706
|
+
/* @__PURE__ */ jsxs("div", { style: {
|
|
1707
|
+
display: "flex",
|
|
1708
|
+
justifyContent: "space-between",
|
|
1709
|
+
alignItems: "center",
|
|
1710
|
+
marginBottom: 16
|
|
1711
|
+
}, children: [
|
|
1712
|
+
/* @__PURE__ */ jsx("h3", { style: {
|
|
1713
|
+
margin: 0,
|
|
1714
|
+
fontSize: 16,
|
|
1715
|
+
fontWeight: 600,
|
|
1716
|
+
color: theme.colors.text
|
|
1717
|
+
}, children: "Quality Lens CLI" }),
|
|
1718
|
+
/* @__PURE__ */ jsx(
|
|
1719
|
+
"button",
|
|
1720
|
+
{
|
|
1721
|
+
onClick: () => setShowHelpOverlay(false),
|
|
1722
|
+
style: {
|
|
1723
|
+
background: "none",
|
|
1724
|
+
border: "none",
|
|
1725
|
+
cursor: "pointer",
|
|
1726
|
+
padding: 4,
|
|
1727
|
+
display: "flex",
|
|
1728
|
+
color: theme.colors.textMuted
|
|
1729
|
+
},
|
|
1730
|
+
children: /* @__PURE__ */ jsx(X, { size: 18 })
|
|
1731
|
+
}
|
|
1732
|
+
)
|
|
1733
|
+
] }),
|
|
1734
|
+
/* @__PURE__ */ jsx("p", { style: {
|
|
1735
|
+
fontSize: 13,
|
|
1736
|
+
color: theme.colors.textMuted,
|
|
1737
|
+
margin: "0 0 12px 0"
|
|
1738
|
+
}, children: "Run quality checks locally with the CLI:" }),
|
|
1739
|
+
[
|
|
1740
|
+
{ cmd: "npx @principal-ai/quality-lens-cli init", label: "Initialize quality lens in your project" },
|
|
1741
|
+
{ cmd: "npx @principal-ai/quality-lens-cli list", label: "List available quality lenses" }
|
|
1742
|
+
].map(({ cmd, label }) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: 12 }, children: [
|
|
1743
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 11, color: theme.colors.textMuted }, children: label }),
|
|
1744
|
+
/* @__PURE__ */ jsxs(
|
|
1745
|
+
"div",
|
|
1746
|
+
{
|
|
1747
|
+
style: {
|
|
1748
|
+
display: "flex",
|
|
1749
|
+
alignItems: "center",
|
|
1750
|
+
justifyContent: "space-between",
|
|
1751
|
+
gap: 8,
|
|
1752
|
+
padding: "8px 12px",
|
|
1753
|
+
borderRadius: 6,
|
|
1754
|
+
backgroundColor: theme.colors.background,
|
|
1755
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1756
|
+
fontFamily: "monospace",
|
|
1757
|
+
fontSize: 12,
|
|
1758
|
+
marginTop: 4
|
|
1759
|
+
},
|
|
1760
|
+
children: [
|
|
1761
|
+
/* @__PURE__ */ jsx("code", { style: { color: theme.colors.text }, children: cmd }),
|
|
1762
|
+
/* @__PURE__ */ jsx(
|
|
1763
|
+
"button",
|
|
1764
|
+
{
|
|
1765
|
+
onClick: () => handleCopyCommand(cmd),
|
|
1766
|
+
style: {
|
|
1767
|
+
display: "flex",
|
|
1768
|
+
alignItems: "center",
|
|
1769
|
+
padding: 4,
|
|
1770
|
+
border: "none",
|
|
1771
|
+
backgroundColor: "transparent",
|
|
1772
|
+
color: theme.colors.textMuted,
|
|
1773
|
+
cursor: "pointer"
|
|
1774
|
+
},
|
|
1775
|
+
title: "Copy command",
|
|
1776
|
+
children: copiedCommand === cmd ? /* @__PURE__ */ jsx(Check, { size: 14, color: theme.colors.success }) : /* @__PURE__ */ jsx(Copy, { size: 14 })
|
|
1777
|
+
}
|
|
1778
|
+
)
|
|
1779
|
+
]
|
|
1780
|
+
}
|
|
1781
|
+
)
|
|
1782
|
+
] }, cmd)),
|
|
1783
|
+
/* @__PURE__ */ jsxs("div", { style: {
|
|
1784
|
+
marginTop: 16,
|
|
1785
|
+
padding: 12,
|
|
1786
|
+
backgroundColor: theme.colors.background,
|
|
1787
|
+
borderRadius: 6,
|
|
1788
|
+
fontSize: 12,
|
|
1789
|
+
color: theme.colors.textMuted
|
|
1790
|
+
}, children: [
|
|
1791
|
+
/* @__PURE__ */ jsx("strong", { style: { color: theme.colors.text }, children: "Tiers:" }),
|
|
1792
|
+
/* @__PURE__ */ jsxs("div", { style: { marginTop: 8, display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
1793
|
+
/* @__PURE__ */ jsx("span", { children: "🏆 Platinum: 90%+ average" }),
|
|
1794
|
+
/* @__PURE__ */ jsx("span", { children: "🥇 Gold: 75%+ average" }),
|
|
1795
|
+
/* @__PURE__ */ jsx("span", { children: "🥈 Silver: 60%+ average" }),
|
|
1796
|
+
/* @__PURE__ */ jsx("span", { children: "🥉 Bronze: 40%+ average" })
|
|
1797
|
+
] })
|
|
1798
|
+
] })
|
|
1799
|
+
]
|
|
1800
|
+
}
|
|
1801
|
+
)
|
|
1802
|
+
}
|
|
1652
1803
|
)
|
|
1653
1804
|
]
|
|
1654
1805
|
}
|
|
@@ -1873,11 +2024,6 @@ function RepositoryQualityGridItem({
|
|
|
1873
2024
|
}
|
|
1874
2025
|
);
|
|
1875
2026
|
}
|
|
1876
|
-
function calculateAverageScore(metrics) {
|
|
1877
|
-
const adjusted = { ...metrics };
|
|
1878
|
-
adjusted.deadCode = 100 - adjusted.deadCode;
|
|
1879
|
-
return Object.values(adjusted).reduce((a, b) => a + b, 0) / 6;
|
|
1880
|
-
}
|
|
1881
2027
|
function RepositoryQualityGrid({
|
|
1882
2028
|
repositories,
|
|
1883
2029
|
theme,
|
|
@@ -1891,16 +2037,8 @@ function RepositoryQualityGrid({
|
|
|
1891
2037
|
const items = React2.useMemo(() => flattenRepositories(repositories), [repositories]);
|
|
1892
2038
|
const overallTier = React2.useMemo(() => calculateOverallTier(items), [items]);
|
|
1893
2039
|
const sortedItems = React2.useMemo(() => {
|
|
1894
|
-
return [...items].sort((a, b) =>
|
|
1895
|
-
|
|
1896
|
-
const aVal = selectedMetric === "deadCode" ? 100 - a.metrics[selectedMetric] : a.metrics[selectedMetric];
|
|
1897
|
-
const bVal = selectedMetric === "deadCode" ? 100 - b.metrics[selectedMetric] : b.metrics[selectedMetric];
|
|
1898
|
-
return bVal - aVal;
|
|
1899
|
-
} else {
|
|
1900
|
-
return calculateAverageScore(b.metrics) - calculateAverageScore(a.metrics);
|
|
1901
|
-
}
|
|
1902
|
-
});
|
|
1903
|
-
}, [items, selectedMetric]);
|
|
2040
|
+
return [...items].sort((a, b) => a.packageName.localeCompare(b.packageName));
|
|
2041
|
+
}, [items]);
|
|
1904
2042
|
const tierColors = {
|
|
1905
2043
|
none: "#808080",
|
|
1906
2044
|
bronze: "#CD7F32",
|