private boolean hasNCalls(Function function, int n) throws CancelledException {

		InstructionIterator instructions =
			function.getProgram().getListing().getInstructions(function.getBody(), true);

		int numCalls = 0;
		while (instructions.hasNext()) {
			monitor.checkCancelled();
			Instruction instruction = instructions.next();
			if (instruction.getFlowType().isCall()) {
				numCalls++;
				if (numCalls > n) {
					return false;
				}
			}
		}
		if (numCalls == n) {
			return true;
		}
		return false;
	}
Method to find basic clone functions from given classes virtual functions
@param recoveredClasses list of classes to process
@throws CancelledException if cancelled
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java