| 81 | |
| 82 | impl IncrementalReport { |
| 83 | pub(super) fn analyses( |
| 84 | &self, |
| 85 | ) -> impl Iterator<Item = (&str, &atomic_canonical::review_finding::AnalysisReport)> { |
| 86 | self.changes |
| 87 | .iter() |
| 88 | .filter(|change| change.selected_root) |
| 89 | .map(|change| (change.hash.as_str(), &change.analysis)) |
| 90 | .chain( |
| 91 | self.view_snapshot |
| 92 | .iter() |
| 93 | .map(|snapshot| (snapshot.source_ref.as_str(), &snapshot.analysis)), |
| 94 | ) |
| 95 | .chain(self.view_comparison.iter().flat_map(|comparison| { |
| 96 | comparison |
| 97 | .files |
| 98 | .iter() |
| 99 | .map(|file| (file.source_ref.as_str(), &file.analysis)) |
| 100 | })) |
| 101 | } |
| 102 | |
| 103 | pub(super) fn is_view_review(&self) -> bool { |
| 104 | self.view_snapshot.is_some() || self.view_comparison.is_some() |