lovelyCARDINAL/WikiBots

View on GitHub
src/Activity/maintainer.js

Summary

Maintainability
C
7 hrs
Test Coverage

Function techTable has 67 lines of code (exceeds 25 allowed). Consider refactoring.
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]),
Severity: Major
Found in src/Activity/maintainer.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    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);
    Severity: Critical
    Found in src/Activity/maintainer.js - About 2 hrs to fix

      Function maintainTable has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      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]),
      Severity: Minor
      Found in src/Activity/maintainer.js - About 1 hr to fix

        Function queryLatestEvents has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        async function queryLatestEvents(api, user, end) {
            const { data: { query: { usercontribs, logevents } } } = await api.post({
                list: 'usercontribs|logevents',
                uclimit: '1',
                lelimit: '1',
        Severity: Minor
        Found in src/Activity/maintainer.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status