def report(project_root):
    file_reports = {}
    for path in find_files(project_root, is_code_file):
        target_lang = code_metrics.file_ext_lang(path)
        with open(path, 'r') as input_file:
            try:
                file_reports[path] = code_metrics.report(path, input_file.read(), target_lang)
            except IOError:
                continue
    project_report = {'source_path': project_root, 'files': file_reports}
    add_project_totals(project_report, file_reports)
    return project_report
def report(project_root):
    file_reports = {}
    for path in find_files(project_root, is_code_file):
        target_lang = code_metrics.file_ext_lang(path)
        with open(path, 'r') as input_file:
            try:
                file_reports[path] = code_metrics.report(path, input_file.read(), target_lang)
            except IOError:
                continue
    project_report = {'source_path': project_root, 'files': file_reports}
    add_project_totals(project_report, file_reports)
    return project_report