'Do consistency checks.'

def check_consistency(self):

    for docname in sorted(self.all_docs):
        if (docname not in self.files_to_rebuild):
            if (docname == self.config.master_doc):
                continue
            if (docname in self.included):
                continue
            if ('orphan' in self.metadata[docname]):
                continue
            logger.warning("document    isn't    included    in    any    toctree", location=docname)
    for domain in self.domains.values():
        domain.check_consistency()
    self.app.emit('env-check-consistency', self)
