mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
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:
parent
ddcb553e3f
commit
eb07d5723d
1 changed files with 3 additions and 1 deletions
|
|
@ -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 = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue