def calculate_comment_to_code_ratio(production_code_metrics, test_code_metrics):
    """Calculate the ratio between the comments and the lines of code."""

    lines_of_code = production_code_metrics["SUM"]["code"] + test_code_metrics["SUM"]["code"]
    comment_lines = production_code_metrics["SUM"]["comment"] + test_code_metrics["SUM"]["comment"]

    return float(comment_lines) / float(lines_of_code)