From 0e5906bafc3d8ab0527dab7e85350a036052b28c Mon Sep 17 00:00:00 2001 From: Atreya Bain Date: Tue, 19 Aug 2025 21:33:37 +0100 Subject: [PATCH] [add] getting sliced available repos --- src_vuln/index.mjs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src_vuln/index.mjs b/src_vuln/index.mjs index 1be763c..3d8cb24 100644 --- a/src_vuln/index.mjs +++ b/src_vuln/index.mjs @@ -1,8 +1,9 @@ +import { readFile } from "fs/promises"; import { cacheFunctionOutput } from "../src_dataset/cache.mjs"; import { bifurcateArray, getGithubTokenFromEnvironment } from "./lib.mjs"; import { checkForParentDep, findSlicedDeps } from "./slicedeps.mjs"; import { basename } from "path"; - +import int from 'set.prototype.intersection' const githubToken = getGithubTokenFromEnvironment(); const vulnTargets = await findSlicedDeps(); @@ -46,21 +47,26 @@ for(const depo of fullMaps){ depMap.get(depo.repo_name).push(depo); } const depKeys = ([...depMap.keys()]) -console.log(depKeys) +// console.log(depKeys) const repoKeys = await checkForParentDep(depKeys); -console.log(repoKeys); +console.log(repoKeys, 'repos found with CVE-ridden direct dependencies'); // for(const repo of slicedReposSoFar) { // const deps = await getDepsOfRepo(repo); // console.log(repo,deps); // const depCVEs = fullMaps.filter(e=>(deps).includes(e.repo_name)); // depMap.set(repo, depCVEs); // } -console.log(cveMap.length, "advisories found"); -console.log(fullMaps.length, "advisories found"); -console.log(emptyMap.length, "advisories found"); +// console.log(cveMap.length, "advisories found"); +// console.log(fullMaps.length, " actionable advisories found"); +// console.log(emptyMap.length, "advisories found"); // what is pending // see what's been sliced so far. Find their dependencies, link back to +const successRepos = new Set((await readFile('success.txt')).toString().trim().split('\n')); +// console.log("success with ",successRepos.size) +const intSet = int (successRepos,repoKeys) +console.log("Anything right now? ",intSet) +