Refactor risk score calc and verdict details

Introduce a percentageOfRiskScore variable to avoid recomputing the risk expression and clamp it to 100. Use this variable in the verdict details string and append the mayBeInfected note when the computed percentage is below 70%, improving readability and providing conditional infection context.
This commit is contained in:
DosX 2026-06-20 08:06:00 +03:00
commit eb07d5723d

View file

@ -7036,10 +7036,12 @@ function scanForMaliciousCode_NET_and_Native() {
}
if (detectedRiskScoreCounter >= 3) {
const percentageOfRiskScore = Math.min(65 + Math.round((detectedRiskScoreCounter - 3) * (35 / 6)), 100);
verdicts.push({
type: "Stealer",
version: String(),
details: "RiskScore " + Math.min(65 + Math.round((detectedRiskScoreCounter - 3) * (35 / 6)), 100) + "%"
details: "RiskScore " + percentageOfRiskScore + "%" + (percentageOfRiskScore < 70 ? " — " + mayBeInfected : String())
});
} else {
var signsToCheck = [