(parsed: &ParsedCommit, line_index: &ImportLineIndex)
| 770 | } |
| 771 | |
| 772 | fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String { |
| 773 | let mut entries: Vec<(usize, String)> = parsed |
| 774 | .files |
| 775 | .iter() |
| 776 | .map(|file| { |
| 777 | let (current_lines, indexed_lines, imported_commits) = |
| 778 | import_shape_for_file(file, line_index); |
| 779 | let bytes = file |
| 780 | .new_content |
| 781 | .as_ref() |
| 782 | .or(file.old_content.as_ref()) |
| 783 | .map(|content| content.len()) |
| 784 | .unwrap_or(0); |
| 785 | let weight = current_lines |
| 786 | .saturating_mul(imported_commits.max(1)) |
| 787 | .saturating_add(indexed_lines); |
| 788 | ( |
| 789 | weight, |
| 790 | format!( |
| 791 | "{} op={:?} lines={} indexed_lines={} file_commits={} bytes={}", |
| 792 | file.path, |
| 793 | file.operation, |
| 794 | current_lines, |
| 795 | indexed_lines, |
| 796 | imported_commits, |
| 797 | bytes |
| 798 | ), |
| 799 | ) |
| 800 | }) |
| 801 | .collect(); |
| 802 | entries.sort_by_key(|entry| std::cmp::Reverse(entry.0)); |
| 803 | entries |
| 804 | .into_iter() |
| 805 | .take(3) |
| 806 | .map(|(_, entry)| entry) |
| 807 | .collect::<Vec<_>>() |
| 808 | .join("; ") |
| 809 | } |
| 810 | |
| 811 | fn graph_first_skip_summary(skips: &[GraphFirstSkip], parsed: &ParsedCommit) -> String { |
| 812 | if skips.is_empty() { |
no test coverage detected