public int numLoops(Vertex v) {
		int loops = 0;
		Edge e = vertices.getFirstOutgoingEdge(v);
		while (e != null) {
			if (v.key() == e.to().key()) {
				loops++;
			}
			e = edges.getNextEdgeWithSameFrom(e);
		}
		return loops;
	}
The number of edges having v as both their terminal and
 terminal vertex.
Ghidra/Framework/Generic/src/main/java/ghidra/util/graph/DirectedGraph.java