private static FGVertexType getVertexType(Graph<FGVertex, FGEdge> graph, FGVertex v) {

		boolean isEntry = v.isEntry();
		boolean isExit = false;

		FlowType flowType = v.getFlowType();
		if (flowType.isTerminal()) {
			isExit = true;
		}

		if (graph.getOutEdges(v).isEmpty()) {
			isExit = true;
		}

		FGVertexType type = BODY;
		if (isEntry) {
			if (isExit) {
				type = SINGLETON;
			}
			else {
				type = ENTRY;
			}
		}
		else if (isExit) {
			type = EXIT;
		}
		return type;
	}
Creates a new function graph for the given function

@param function the function to graph
@param controller the controller needed by the function graph
@param program the function's program
@param monitor the task monitor
@return the new graph
@throws CancelledException if the task is cancelled via the monitor
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/FunctionGraphFactory.java