ControlFlowGraph { @CheckForNull private static ControlFlowGraph build(@Nullable StatementList statementList, PythonFile file) { if (!treesWithCfgErrors.contains(statementList)) { try { return new ControlFlowGraphBuilder(statementList).getCfg(); } catch (Exception e) { treesWithCfgErrors.add(statementList); LOG.warn("Failed to build control flow graph in file [{}]: {}", file, e.getMessage()); } } return null; } ControlFlowGraph(Set<CfgBlock> blocks, CfgBlock start, CfgBlock end); @CheckForNull static ControlFlowGraph build(FunctionDef functionDef, PythonFile file); @CheckForNull static ControlFlowGraph build(FileInput fileInput, PythonFile file); CfgBlock start(); CfgBlock end(); Set<CfgBlock> blocks(); @Override String toString();  }
@Test public void return_outside_function() { assertThat(ControlFlowGraph.build(PythonTestUtils.parse("return"), file)).isNull(); assertThat(cfg( "class Foo:", " return" )).isNull(); }