|
2 | 2 | import { indepth as indepth_analyzer, recent as recent_analyzer } from "./analyzers.mjs" |
3 | 3 |
|
4 | 4 | //Setup |
5 | | -export default async function({login, data, imports, q, rest, account}, {enabled = false} = {}) { |
| 5 | +export default async function({login, data, imports, q, rest, account}, {enabled = false, extras = false} = {}) { |
6 | 6 | //Plugin execution |
7 | 7 | try { |
8 | 8 | //Check if plugin is enabled and requirements are met |
@@ -52,17 +52,20 @@ export default async function({login, data, imports, q, rest, account}, {enabled |
52 | 52 | } |
53 | 53 | } |
54 | 54 |
|
55 | | - //Recently used languages |
56 | | - if ((sections.includes("recently-used"))&&(context.mode === "user")) { |
57 | | - console.debug(`metrics/compute/${login}/plugins > languages > using recent analyzer`) |
58 | | - languages["stats.recent"] = await recent_analyzer({login, data, imports, rest, account}, {skipped, days:_recent_days, load:_recent_load}) |
59 | | - } |
| 55 | + //Extras features |
| 56 | + if (extras) { |
| 57 | + //Recently used languages |
| 58 | + if ((sections.includes("recently-used"))&&(context.mode === "user")) { |
| 59 | + console.debug(`metrics/compute/${login}/plugins > languages > using recent analyzer`) |
| 60 | + languages["stats.recent"] = await recent_analyzer({login, data, imports, rest, account}, {skipped, days:_recent_days, load:_recent_load}) |
| 61 | + } |
60 | 62 |
|
61 | | - //Indepth mode |
62 | | - if (indepth) { |
63 | | - console.debug(`metrics/compute/${login}/plugins > languages > switching to indepth mode (this may take some time)`) |
64 | | - Object.assign(languages, await indepth_analyzer({login, data, imports, repositories}, {skipped})) |
65 | | - console.debug(`metrics/compute/${login}/plugins > languages > indepth analysis missed ${languages.missed} commits`) |
| 63 | + //Indepth mode |
| 64 | + if (indepth) { |
| 65 | + console.debug(`metrics/compute/${login}/plugins > languages > switching to indepth mode (this may take some time)`) |
| 66 | + Object.assign(languages, await indepth_analyzer({login, data, imports, repositories}, {skipped})) |
| 67 | + console.debug(`metrics/compute/${login}/plugins > languages > indepth analysis missed ${languages.missed} commits`) |
| 68 | + } |
66 | 69 | } |
67 | 70 |
|
68 | 71 | //Compute languages stats |
|
0 commit comments