A "Missing Assignments" report is already available in New Analytics of your course. Have you explored this option? Here is an example of the kind of data it provides:
Here is the Guide that explains how to run this report:
I hope this will help to answer your question. Sing out if you have any other questions/concerns about this....thanks!