Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return ([] as string[]).concat(...await map(programNames, async (programName): Promise =>
concurrentFilter(pathParts.map(p => pathlib.join(p, programName)), async p => isExecutableFile(p))));
}
const ailments = registry.ailments.filter(ailment => {
if (this.env.config.get(`doctor.issues.${ailment.id}.ignored` as any)) {
debug('Issue %s ignored by config', ailment.id);
return false;
}
if (!ailment.implicit) {
debug('Issue %s will not be implicitly detected', ailment.id);
return false;
}
return true;
});
const detectedAilments = await concurrentFilter(ailments, async (ailment): Promise => {
let detected = false;
try {
detected = await ailment.detected();
debug('Detected %s: %s', ailment.id, detected);
} catch (e) {
this.env.log.error(
`Error while checking ${strong(ailment.id)}:\n` +
`${failure(e.stack ? e.stack : e)}`
);
}
count++;
detectTask.msg = `Detecting issues: ${strong(`${count} / ${ailments.length}`)} complete`;
return detected;