def _find_coverage()

in bot/code_coverage_bot/phabricator.py [0:0]


    def _find_coverage(self, report: dict, path: str) -> Optional[List[int]]:
        """
        Find coverage value in a covdir report
        """
        parts = path.split("/")
        for part in filter(None, parts):
            if part not in report["children"]:
                # Only send warning for non 3rd party + supported extensions
                if self.is_third_party(path):
                    logger.info("Path not found in report for third party", path=path)
                elif not self.is_supported_extension(path):
                    logger.info(
                        "Path not found in report for unsupported extension", path=path
                    )
                else:
                    if self.warnings_enabled:
                        logger.warn("Path not found in report", path=path)
                    else:
                        logger.info("Path not found in report", path=path)
                return None
            report = report["children"][part]

        return report["coverage"]