/*
 * Copyright (c) 2018, 2026, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
var Stats=function(){this.errors=0;this.warnings=0;this.asserts=0;this.totalFilesSelected=0;this.totalFilesAudited=0;this.totalIssues=0;this.totalIssueFiles=0;this.errorFiles=0;this.parseErrors=0;this.totalUrlsAudited=0;this.sevStats={blocker:0,critical:0,major:0,minor:0,info:0};this.totalSevStats={blocker:0,critical:0,major:0,minor:0,info:0};this.rulesFired=0;this.hooksFired=0;this.packRulesFired};Stats.prototype.clearAll=function(){this.clearErrWarnAsserts();this.clearFileStats();this.clearSevStats();this.clearTotalSevStats();this.clearRulesFired();this.clearPackRulesFired()};Stats.prototype.clearErrWarnAsserts=function(){this.errors=this.warnings=this.asserts=0};Stats.prototype.clearSevStats=function(){this.sevStats.critical=this.sevStats.blocker=this.sevStats.major=this.sevStats.minor=this.sevStats.info=0};Stats.prototype.clearTotalSevStats=function(){this.totalSevStats.critical=this.totalSevStats.blocker=this.totalSevStats.major=this.totalSevStats.minor=this.totalSevStats.info=0};Stats.prototype.clearFileStats=function(){this.totalIssues=this.totalIssueFiles=this.errorFiles=this.parseErrors=this.totalFilesSelected=this.totalFilesAudited=this.totalUrlsAudited=0};Stats.prototype.clearRulesFired=function(){this.rulesFired=this.hooksFired=0};Stats.prototype.clearPackRulesFired=function(){if(this.packRulesFired){for(let i=0;i<this.packRulesFired.length;i++){let pack=this.packRulesFired[i];if(Object.keys(pack.rules).length){pack.rules={}}}}};Stats.prototype.addSevStatsToTotals=function(clear){this.totalSevStats.critical+=this.sevStats.critical;this.totalSevStats.blocker+=this.sevStats.blocker;this.totalSevStats.major+=this.sevStats.major;this.totalSevStats.minor+=this.sevStats.minor;this.totalSevStats.info+=this.sevStats.info;if(clear){this.clearSevStats()}};module.exports=Stats;