def remark_unit_test_coverage(unit_test_coverage, code_coverage_threshold): """Generate remark for unit test coverage problems.""" if unit_test_coverage is not None: if not unit_test_coverage_ok(unit_test_coverage, code_coverage_threshold): return "<li>improve code coverage</li>" else: return "" else: return "<li>unit tests has not been setup</li>"
def compute_status(source_files, linter_checks_total, ignored_pylint_files, docstyle_checks_total, ignored_pydocstyle_files, linter_checks, docstyle_checks, unit_test_coverage, cyclomatic_complexity, maintainability_index, code_coverage_threshold, dead_code, common_errors): """Compute the overall status from various metrics.""" return source_files == (linter_checks_total + ignored_pylint_files) and \ source_files == (docstyle_checks_total + ignored_pydocstyle_files) and \ linter_checks["failed"] == 0 and docstyle_checks["failed"] == 0 and \ unit_test_coverage_ok(unit_test_coverage, code_coverage_threshold) and \ cyclomatic_complexity["status"] and \ maintainability_index["status"] and \ dead_code["failed"] == 0 and common_errors["failed"] == 0