src/Activity/maintainer.js
Function techTable
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const techTable = async () => {
const { data: ghiaData } = await axios.get('https://raw.githubusercontent.com/MoegirlPediaInterfaceAdmins/MoegirlPediaInterfaceCodes/master/src/global/zh/MediaWiki:GHIAHistory.json');
const processData = [
Promise.all([
queryContribs(zhapi, userData.techeditor, '10|828', time[180]),
Consider simplifying this complex logical expression. Open
Open
if (nsContribsData.length || ghiaContribsCount) {
const nsLatestTimestamp = nsContribsData.length && moment.max(nsContribsData.map((item) => moment(item.timestamp)));
const ghiaLatestTimestamp = ghiaUserData?.length && moment.max(ghiaUserData.map((item) => moment(item.datetime))) || 0;
const latestTimestamp = moment.max([nsLatestTimestamp, ghiaLatestTimestamp]);
const timestamp = timestampCST(latestTimestamp);
Function maintainTable
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const maintainTable = async () => {
const processData = [
Promise.all([
queryContribs(zhapi, userData.sysop, '0|10|14|12|4|6', time[30]),
queryContribs(cmapi, userData.sysop, '0|10|14|12|4|6', time[30]),
Function queryLatestEvents
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function queryLatestEvents(api, user, end) {
const { data: { query: { usercontribs, logevents } } } = await api.post({
list: 'usercontribs|logevents',
uclimit: '1',
lelimit: '1',