MCPcopy Index your code
hub / github.com/deepnote/deepnote / analyzeFile

Function analyzeFile

packages/cli/src/commands/analyze.ts:68–84  ·  view source on GitHub ↗
(path: string | undefined, options: AnalyzeOptions)

Source from the content-addressed store, hash-verified

66}
67
68async 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
86function buildAnalyzeResult(path: string, analysis: AnalysisResult, blockMap: Map<string, BlockInfo>): AnalyzeResult {
87 const { stats, lint, dag } = analysis

Callers 1

createAnalyzeActionFunction · 0.85

Calls 8

emitInitResolverWarningsFunction · 0.90
debugFunction · 0.90
resolvePythonExecutableFunction · 0.90
analyzeProjectFunction · 0.90
buildBlockMapFunction · 0.90
buildAnalyzeResultFunction · 0.85

Tested by

no test coverage detected