I just discovered that pages which have (accidentally) two attributes with the same name inside the frontmatter are not displayed in query results. How would go about finding all of the culprits?
What you are basically looking for are pages with invalid frontmatter (defining the same attribute twice makes the YAML invalid). So you could either try to find all pages where you expect a certain attribute but it is missing, or you could write a (rather complicated) function to iterate through all pages and see if the frontmatter is valid (using index.extractFrontmatter?).
I think the first one is less time consuming. If you expect frontmatter on, for instance, all journal pages it should be fairly straightforward to find journal pages missing, for instance, a date attribute.