testilo 51.2.1 → 52.0.0
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/.claude/settings.local.json +13 -0
- package/package.json +1 -1
- package/procs/score/tsp50.js +24 -5
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(gh pr *)",
|
|
5
|
+
"Read(//opt/homebrew/bin/**)",
|
|
6
|
+
"Bash(/opt/homebrew/bin/gh --version)",
|
|
7
|
+
"WebFetch(domain:github.com)",
|
|
8
|
+
"WebFetch(domain:patch-diff.githubusercontent.com)",
|
|
9
|
+
"Bash(curl -sL https://patch-diff.githubusercontent.com/raw/jrpool/testilo/pull/1.patch -o /tmp/pr1.patch)",
|
|
10
|
+
"Read(//tmp/**)"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
package/package.json
CHANGED
package/procs/score/tsp50.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
© 2026 Jeff Witt. All rights reserved.
|
|
3
4
|
|
|
4
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -263,11 +264,12 @@ exports.scorer = report => {
|
|
|
263
264
|
.texts
|
|
264
265
|
.push(what);
|
|
265
266
|
}
|
|
266
|
-
issuePaths[issueName] ??=
|
|
267
|
+
issuePaths[issueName] ??= {};
|
|
267
268
|
// If the element has a path ID:
|
|
268
269
|
if (pathID) {
|
|
269
|
-
// Ensure that it is in the issue-specific
|
|
270
|
-
issuePaths[issueName]
|
|
270
|
+
// Ensure that it is in the issue-specific map of paths to tools.
|
|
271
|
+
issuePaths[issueName][pathID] ??= new Set();
|
|
272
|
+
issuePaths[issueName][pathID].add(which);
|
|
271
273
|
}
|
|
272
274
|
}
|
|
273
275
|
}
|
|
@@ -323,6 +325,10 @@ exports.scorer = report => {
|
|
|
323
325
|
issueData.instanceCounts[toolName] = 0;
|
|
324
326
|
}
|
|
325
327
|
});
|
|
328
|
+
// Add the count of unique path-identified elements for the issue.
|
|
329
|
+
if (issuePaths[issueName]) {
|
|
330
|
+
issueData.uniqueElementCount = Object.keys(issuePaths[issueName]).length;
|
|
331
|
+
}
|
|
326
332
|
});
|
|
327
333
|
// Add the severity detail totals to the score.
|
|
328
334
|
details.severity.total = Object
|
|
@@ -333,9 +339,22 @@ exports.scorer = report => {
|
|
|
333
339
|
});
|
|
334
340
|
return severityTotals;
|
|
335
341
|
}, details.severity.total);
|
|
336
|
-
// Add the element details to the score.
|
|
342
|
+
// Add the element details to the score, grouped by detecting tools.
|
|
337
343
|
Object.keys(issuePaths).forEach(issueID => {
|
|
338
|
-
details.element[issueID] =
|
|
344
|
+
details.element[issueID] = {};
|
|
345
|
+
const issueElementDetails = details.element[issueID];
|
|
346
|
+
// For each element reported as exhibiting the issue:
|
|
347
|
+
Object.keys(issuePaths[issueID]).forEach(pathID => {
|
|
348
|
+
// Convert the set of tools reporting it to a string.
|
|
349
|
+
const toolList = Array.from(issuePaths[issueID][pathID]).sort().join(' + ');
|
|
350
|
+
issueElementDetails[toolList] ??= [];
|
|
351
|
+
// Classify the path by the set of tools reporting its element for the issue.
|
|
352
|
+
issueElementDetails[toolList].push(pathID);
|
|
353
|
+
});
|
|
354
|
+
// Sort the paths within each tool list.
|
|
355
|
+
Object.keys(issueElementDetails).forEach(toolList => {
|
|
356
|
+
issueElementDetails[toolList].sort();
|
|
357
|
+
});
|
|
339
358
|
});
|
|
340
359
|
// Add the summary issue-count total to the score.
|
|
341
360
|
summary.issueCount = Object.keys(details.issue).length * issueCountWeight;
|