(code: string)
| 288 | * Check if code contains plotting commands |
| 289 | */ |
| 290 | export function containsPlotting(code: string): boolean { |
| 291 | const plottingPatterns = [ |
| 292 | /plt\.(plot|bar|scatter|hist|show|figure)/, |
| 293 | /sns\.(plot|bar|scatter|hist)/, |
| 294 | /plotly\.(graph_objects|express)/, |
| 295 | /\.plot\(/, |
| 296 | /\.hist\(/, |
| 297 | /\.scatter\(/, |
| 298 | ]; |
| 299 | |
| 300 | return plottingPatterns.some((pattern) => pattern.test(code)); |
| 301 | } |
| 302 | |
| 303 | /** |
| 304 | * Validate Python code syntax |
nothing calls this directly
no outgoing calls
no test coverage detected