(path: string | undefined, options: AnalyzeOptions)
| 66 | } |
| 67 | |
| 68 | async function analyzeFile(path: string | undefined, options: AnalyzeOptions): Promise<AnalyzeResult> { |
| 69 | const { absolutePath } = await resolvePathToDeepnoteFile(path) |
| 70 | |
| 71 | const { file: deepnoteFile, warnings } = await loadAndResolveDeepnoteFile(absolutePath) |
| 72 | emitInitResolverWarnings(warnings, options.output !== undefined) |
| 73 | |
| 74 | debug('Running analysis...') |
| 75 | const pythonInterpreter = options.python ? await resolvePythonExecutable(options.python) : undefined |
| 76 | const analysis = await analyzeProject(deepnoteFile, { |
| 77 | notebook: options.notebook, |
| 78 | pythonInterpreter, |
| 79 | }) |
| 80 | |
| 81 | const blockMap = buildBlockMap(deepnoteFile, { notebook: options.notebook }) |
| 82 | |
| 83 | return buildAnalyzeResult(absolutePath, analysis, blockMap) |
| 84 | } |
| 85 | |
| 86 | function buildAnalyzeResult(path: string, analysis: AnalysisResult, blockMap: Map<string, BlockInfo>): AnalyzeResult { |
| 87 | const { stats, lint, dag } = analysis |
no test coverage detected