public static bool hasLocalSourceCodeFile(this API_Veracode_DetailedXmlFindings apiVeracode, FlawType flaw) { return apiVeracode.sourceCodeFile(flaw).fileExists(); }
public static string sourceCodeFile(this API_Veracode_DetailedXmlFindings apiVeracode, FlawType flaw) { var sourceCodeFile = flaw.sourceCodeFile(); if (apiVeracode.LocalFileMappingsCache.hasKey(sourceCodeFile)) return apiVeracode.LocalFileMappingsCache[sourceCodeFile]; foreach(var path in apiVeracode.SourceCodePaths) { var sourceCodePath = path.pathCombine(sourceCodeFile); if (sourceCodePath.fileExists()) { apiVeracode.LocalFileMappingsCache.add(sourceCodeFile, sourceCodePath); return sourceCodePath; } } apiVeracode.FilesThatCouldNotMappedLocally.add_If_Not_There(sourceCodeFile); apiVeracode.LocalFileMappingsCache.add(sourceCodeFile, sourceCodeFile); return sourceCodeFile; }