diff --git a/lib/evinser/evinser.js b/lib/evinser/evinser.js index f3279a3f6..2177e8e65 100644 --- a/lib/evinser/evinser.js +++ b/lib/evinser/evinser.js @@ -212,7 +212,7 @@ export async function createSlice( options = {}, ) { if (!filePath) { - return; + return undefined; } const firstLanguage = Array.isArray(purlOrLanguages) ? purlOrLanguages[0] @@ -227,7 +227,7 @@ export async function createSlice( PROJECT_TYPE_ALIASES.swift.includes(language) && sliceType !== "semantics" ) { - return; + return undefined; } let sliceOutputDir = fs.mkdtempSync( @@ -388,7 +388,7 @@ export async function analyzeProject(dbObjMap, options) { fs.readFileSync(options.reachablesSlicesFile, "utf-8"), ); } else { - retMap = createSlice(language, dirPath, "reachables", options); + retMap = await createSlice(language, dirPath, "reachables", options); if (retMap?.slicesFile && fs.existsSync(retMap.slicesFile)) { reachablesSlicesFile = retMap.slicesFile; reachablesSlice = JSON.parse( @@ -409,7 +409,7 @@ export async function analyzeProject(dbObjMap, options) { usagesSlicesFile = options.usagesSlicesFile; } else { // Generate our own slices - retMap = createSlice(language, dirPath, "usages", options); + retMap = await createSlice(language, dirPath, "usages", options); if (retMap?.slicesFile && fs.existsSync(retMap.slicesFile)) { usageSlice = JSON.parse(fs.readFileSync(retMap.slicesFile, "utf-8")); usagesSlicesFile = retMap.slicesFile; @@ -428,7 +428,7 @@ export async function analyzeProject(dbObjMap, options) { semanticsSlicesFile = options.semanticsSlicesFile; } else { // Generate our own slices - retMap = createSlice(language, dirPath, "semantics", options); + retMap = await createSlice(language, dirPath, "semantics", options); if (retMap?.slicesFile && fs.existsSync(retMap.slicesFile)) { semanticsSlice = JSON.parse( fs.readFileSync(retMap.slicesFile, "utf-8"), @@ -471,7 +471,7 @@ export async function analyzeProject(dbObjMap, options) { fs.readFileSync(options.dataFlowSlicesFile, "utf-8"), ); } else { - retMap = createSlice(language, dirPath, "data-flow", options); + retMap = await createSlice(language, dirPath, "data-flow", options); if (retMap?.slicesFile && fs.existsSync(retMap.slicesFile)) { dataFlowSlicesFile = retMap.slicesFile; dataFlowSlice = JSON.parse(fs.readFileSync(retMap.slicesFile, "utf-8"));