public/src/ajaxify.js
File ajaxify.js
has 501 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
'use strict';
const benchpress = require('benchpressjs');
const translator = require('./modules/translator');
const alerts = require('./modules/alerts');
Function ajaxifyAnchors
has 77 lines of code (exceeds 75 allowed). Consider refactoring. Open
Open
function ajaxifyAnchors() {
function hrefEmpty(href) {
// eslint-disable-next-line no-script-url
return href === undefined || href === '' || href === 'javascript:;';
}
Avoid deeply nested control flow statements. Open
Open
if (!safeUrls.length || !safeUrls.some(function (url) { return href.indexOf(url) !== -1; })) {
ajaxify.go('outgoing?url=' + encodeURIComponent(href));
e.preventDefault();
}
Avoid deeply nested control flow statements. Open
Open
if (data.responseJSON.startsWith('http://') || data.responseJSON.startsWith('https://')) {
window.location.href = data.responseJSON;
} else {
ajaxify.go(data.responseJSON.slice(1), callback, quiet);
}
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return e.preventDefault();
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return e.preventDefault();