Browse Source

[Minor] Initialize variables at declaration

tags/1.8.0
Alexander Moisseev 5 years ago
parent
commit
458642949a

+ 0
- 1
.eslintrc.json View File

@@ -60,7 +60,6 @@
"function-paren-newline": "off",
"global-require": "off",
"guard-for-in": "off",
"init-declarations": "off",
"key-spacing": "off",
"line-comment-position": "off",
"max-len": "off",

+ 4
- 7
interface/js/app/config.js View File

@@ -47,7 +47,7 @@ define(["jquery"],
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;
@@ -145,12 +145,9 @@ define(["jquery"],
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>&nbsp;<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>&nbsp;<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);

+ 5
- 8
interface/js/app/history.js View File

@@ -30,7 +30,7 @@ define(["jquery", "footable", "humanize"],
var rows_per_page = 25;

var ui = {};
var prevVersion;
var prevVersion = null;
var htmlEscapes = {
"&": "&amp;",
"<": "&lt;",
@@ -99,12 +99,9 @@ define(["jquery", "footable", "humanize"],
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: {
@@ -159,7 +156,7 @@ define(["jquery", "footable", "humanize"],

preprocess_item(item);
Object.keys(item.symbols).map(function (key) {
var str;
var str = null;
var sym = item.symbols[key];

if (sym.description) {

+ 1
- 1
interface/js/app/rspamd.js View File

@@ -38,7 +38,7 @@ function ($, D3pie, visibility, NProgress, tab_stat, tab_graph, tab_config,
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,

+ 1
- 1
interface/js/app/stats.js View File

@@ -34,7 +34,7 @@ define(["jquery", "d3pie", "humanize"],
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";

+ 1
- 1
interface/js/app/upload.js View File

@@ -33,7 +33,7 @@ define(["jquery"],

// @upload text
function uploadText(rspamd, data, source, headers) {
var url;
var url = null;
if (source === "spam") {
url = "learnspam";
} else if (source === "ham") {

Loading…
Cancel
Save