@aiready/core 0.21.1 → 0.21.4
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 -7
- package/dist/index.mjs +3 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2940,13 +2940,9 @@ function calculateChangeAmplification(params) {
|
|
|
2940
2940
|
const hotspots = files.map((f) => ({ ...f, amplificationFactor: f.fanOut + f.fanIn * 0.5 })).sort((a, b) => b.amplificationFactor - a.amplificationFactor);
|
|
2941
2941
|
const maxAmplification = hotspots[0].amplificationFactor;
|
|
2942
2942
|
const avgAmplification = hotspots.reduce((sum, h) => sum + h.amplificationFactor, 0) / hotspots.length;
|
|
2943
|
-
const
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
100,
|
|
2947
|
-
100 - avgAmplification * 5 - (maxAmplification > 20 ? maxAmplification - 20 : 0)
|
|
2948
|
-
)
|
|
2949
|
-
);
|
|
2943
|
+
const avgPenalty = Math.log2(avgAmplification + 1) * 15;
|
|
2944
|
+
const maxPenalty = maxAmplification > 30 ? (maxAmplification - 30) * 1.5 : 0;
|
|
2945
|
+
const score = Math.max(0, Math.min(100, 100 - avgPenalty - maxPenalty));
|
|
2950
2946
|
let rating = "isolated";
|
|
2951
2947
|
if (score < 40) rating = "explosive";
|
|
2952
2948
|
else if (score < 70) rating = "amplified";
|
package/dist/index.mjs
CHANGED
|
@@ -2295,13 +2295,9 @@ function calculateChangeAmplification(params) {
|
|
|
2295
2295
|
const hotspots = files.map((f) => ({ ...f, amplificationFactor: f.fanOut + f.fanIn * 0.5 })).sort((a, b) => b.amplificationFactor - a.amplificationFactor);
|
|
2296
2296
|
const maxAmplification = hotspots[0].amplificationFactor;
|
|
2297
2297
|
const avgAmplification = hotspots.reduce((sum, h) => sum + h.amplificationFactor, 0) / hotspots.length;
|
|
2298
|
-
const
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
100,
|
|
2302
|
-
100 - avgAmplification * 5 - (maxAmplification > 20 ? maxAmplification - 20 : 0)
|
|
2303
|
-
)
|
|
2304
|
-
);
|
|
2298
|
+
const avgPenalty = Math.log2(avgAmplification + 1) * 15;
|
|
2299
|
+
const maxPenalty = maxAmplification > 30 ? (maxAmplification - 30) * 1.5 : 0;
|
|
2300
|
+
const score = Math.max(0, Math.min(100, 100 - avgPenalty - maxPenalty));
|
|
2305
2301
|
let rating = "isolated";
|
|
2306
2302
|
if (score < 40) rating = "explosive";
|
|
2307
2303
|
else if (score < 70) rating = "amplified";
|