(parsed: &ParsedCommit, line_index: &ImportLineIndex)
| 709 | } |
| 710 | |
| 711 | fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String { |
| 712 | let mut entries: Vec<(usize, String)> = parsed |
| 713 | .files |
| 714 | .iter() |
| 715 | .map(|file| { |
| 716 | let (current_lines, indexed_lines, imported_commits) = |
| 717 | import_shape_for_file(file, line_index); |
| 718 | let bytes = file |
| 719 | .new_content |
| 720 | .as_ref() |
| 721 | .or(file.old_content.as_ref()) |
| 722 | .map(|content| content.len()) |
| 723 | .unwrap_or(0); |
| 724 | let weight = current_lines |
| 725 | .saturating_mul(imported_commits.max(1)) |
| 726 | .saturating_add(indexed_lines); |
| 727 | ( |
| 728 | weight, |
| 729 | format!( |
| 730 | "{} op={:?} lines={} indexed_lines={} file_commits={} bytes={}", |
| 731 | file.path, |
| 732 | file.operation, |
| 733 | current_lines, |
| 734 | indexed_lines, |
| 735 | imported_commits, |
| 736 | bytes |
| 737 | ), |
| 738 | ) |
| 739 | }) |
| 740 | .collect(); |
| 741 | entries.sort_by_key(|entry| std::cmp::Reverse(entry.0)); |
| 742 | entries |
| 743 | .into_iter() |
| 744 | .take(3) |
| 745 | .map(|(_, entry)| entry) |
| 746 | .collect::<Vec<_>>() |
| 747 | .join("; ") |
| 748 | } |
| 749 | |
| 750 | fn graph_first_skip_summary(skips: &[GraphFirstSkip], parsed: &ParsedCommit) -> String { |
| 751 | if skips.is_empty() { |
no test coverage detected