"function-paren-newline": "off",
"global-require": "off",
"guard-for-in": "off",
- "init-declarations": "off",
"key-spacing": "off",
"line-comment-position": "off",
"max-len": "off",
var items = [];
$.each(data[0].data, function (i, item) {
var idx = -1;
- var label;
+ var label = null;
if (item.action === "greylist") {
label = "Greylist";
idx = 0;
var $tbody = $("<tbody>");
$.each(data, function (i, item) {
- var label;
- if ((item.editable === false || rspamd.read_only)) {
- label = "<span class=\"label label-default\">Read</span>";
- } else {
- label = "<span class=\"label label-default\">Read</span> <span class=\"label label-success\">Write</span>";
- }
+ var label = ((item.editable === false || rspamd.read_only))
+ ? "<span class=\"label label-default\">Read</span>"
+ : "<span class=\"label label-default\">Read</span> <span class=\"label label-success\">Write</span>";
var $tr = $("<tr>");
$("<td class=\"col-md-2 maps-cell\">" + label + "</td>").appendTo($tr);
var $span = $("<span class=\"map-link\" data-toggle=\"modal\" data-target=\"#modalDialog\">" + item.uri + "</span>").data("item", item);
var rows_per_page = 25;
var ui = {};
- var prevVersion;
+ var prevVersion = null;
var htmlEscapes = {
"&": "&",
"<": "<",
item.action = "<div style='font-size:11px' class='label label-info'>" + item.action + "</div>";
}
- var score_content;
- if (item.score < item.required_score) {
- score_content = "<span class='text-success'>" + item.score.toFixed(2) + " / " + item.required_score + "</span>";
- } else {
- score_content = "<span class='text-danger'>" + item.score.toFixed(2) + " / " + item.required_score + "</span>";
- }
+ var score_content = (item.score < item.required_score)
+ ? "<span class='text-success'>" + item.score.toFixed(2) + " / " + item.required_score + "</span>"
+ : "<span class='text-danger'>" + item.score.toFixed(2) + " / " + item.required_score + "</span>";
item.score = {
options: {
preprocess_item(item);
Object.keys(item.symbols).map(function (key) {
- var str;
+ var str = null;
var sym = item.symbols[key];
if (sym.description) {
var checked_server = "All SERVERS";
var ui = {};
var timer_id = [];
- var selData; // Graph's dataset selector state
+ var selData = null; // Graph's dataset selector state
NProgress.configure({
minimum: 0.01,
var hours = seconds % 31536000 % 2628000 % 86400 / 3600 >> 0;
var minutes = seconds % 31536000 % 2628000 % 86400 % 3600 / 60 >> 0;
/* eslint-enable no-bitwise */
- var out;
+ var out = null;
if (years > 0) {
if (months > 0) {
out = years + "yr " + months + "mth";
// @upload text
function uploadText(rspamd, data, source, headers) {
- var url;
+ var url = null;
if (source === "spam") {
url = "learnspam";
} else if (source === "ham") {