diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-19 15:43:03 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-19 15:43:03 +0000 |
commit | e5c77aed5ebc2dc096709a29ff9b10bfad326912 (patch) | |
tree | 329cc6b05ed29c1dc499428ff11ec53095258946 /lualib | |
parent | 422749d19d44b508f226adbe66072d8a633dcc33 (diff) | |
download | rspamd-e5c77aed5ebc2dc096709a29ff9b10bfad326912.tar.gz rspamd-e5c77aed5ebc2dc096709a29ff9b10bfad326912.zip |
[Minor] Some lua style fixes
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/rspamadm/rescore.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lualib/rspamadm/rescore.lua b/lualib/rspamadm/rescore.lua index 87e0ea2c5..56a92deff 100644 --- a/lualib/rspamadm/rescore.lua +++ b/lualib/rspamadm/rescore.lua @@ -468,10 +468,11 @@ return function (args, cfg) -- Display hit frequencies if opts['z'] then - local file_stats, all_symbols_stats = rescore_utility.generate_statistics_from_logs(logs, threshold) + local _, all_symbols_stats = rescore_utility.generate_statistics_from_logs(logs, threshold) local t = {} for _, symbol_stats in pairs(all_symbols_stats) do table.insert(t, symbol_stats) end - function compare_symbols (a, b) + + local function compare_symbols(a, b) if (a.spam_overall ~= b.spam_overall) then return b.spam_overall < a.spam_overall end @@ -481,6 +482,7 @@ return function (args, cfg) return b.ham_hits < a.ham_hits end table.sort(t, compare_symbols) + logger.message(string.format("%-40s %6s %6s %6s %6s %6s %6s %6s", "NAME", "HITS", "HAM", "HAM%", "SPAM", "SPAM%", "S/O", "OVER%")) for _, symbol_stats in pairs(t) do |