arcvision 0.1.18 → 0.1.19
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/index.js +3 -2
- package/package.json +1 -1
- package/src/core/scanner.js +7 -2
package/dist/index.js
CHANGED
|
@@ -56662,9 +56662,10 @@ var require_scanner = __commonJS({
|
|
|
56662
56662
|
});
|
|
56663
56663
|
const totalFiles = architectureMap.nodes.length;
|
|
56664
56664
|
const { computeBlastRadiusWithPercentage: computeBlastRadiusWithPercentage2 } = require_blastRadius();
|
|
56665
|
-
const
|
|
56665
|
+
const allFilesWithPercentage = computeBlastRadiusWithPercentage2(blastRadiusMap, totalFiles);
|
|
56666
|
+
const topFiles = allFilesWithPercentage.sort((a, b) => b.blastRadius - a.blastRadius).slice(0, 3);
|
|
56666
56667
|
architectureMap.riskSurface = {
|
|
56667
|
-
topBlastRadiusFiles: topFiles
|
|
56668
|
+
topBlastRadiusFiles: topFiles
|
|
56668
56669
|
};
|
|
56669
56670
|
return architectureMap;
|
|
56670
56671
|
} catch (err) {
|
package/package.json
CHANGED
package/src/core/scanner.js
CHANGED
|
@@ -100,10 +100,15 @@ async function scan(directory) {
|
|
|
100
100
|
// Add top blast radius files to the architecture map
|
|
101
101
|
const totalFiles = architectureMap.nodes.length;
|
|
102
102
|
const { computeBlastRadiusWithPercentage } = require('./blastRadius');
|
|
103
|
-
const
|
|
103
|
+
const allFilesWithPercentage = computeBlastRadiusWithPercentage(blastRadiusMap, totalFiles);
|
|
104
|
+
|
|
105
|
+
// Sort by blast radius descending and take top 3
|
|
106
|
+
const topFiles = allFilesWithPercentage
|
|
107
|
+
.sort((a, b) => b.blastRadius - a.blastRadius)
|
|
108
|
+
.slice(0, 3);
|
|
104
109
|
|
|
105
110
|
architectureMap.riskSurface = {
|
|
106
|
-
topBlastRadiusFiles: topFiles
|
|
111
|
+
topBlastRadiusFiles: topFiles
|
|
107
112
|
};
|
|
108
113
|
|
|
109
114
|
return architectureMap;
|