Schema: 1.0.0
Findings: 2
| Function A | Function B | ||
|---|---|---|---|
| 147 | def _select_compare(matches: list[CandidateMatch]) -> dict[str, object] | None: | 65 | def _select_compare(matches: list[CandidateMatch]) -> dict[str, object] | None: |
| 148 | compare = select_compare(matches) | 66 | compare = select_compare(matches) |
| 149 | if compare is None: | 67 | if compare is None: |
| 150 | return None | 68 | return None |
| 151 | return _compare_payload(compare, matches) | 69 | return _serialize_evidence(compare) |
| Function A | Function B | ||
|---|---|---|---|
| 339 | def _merge_spans(spans: list[tuple[int, int]]) -> list[tuple[int, int]]: | 152 | def _covered_lines(spans: list[tuple[int, int]]) -> int: |
| 340 | if not spans: | 153 | if not spans: |
| 341 | return [] | 154 | return 0 |
| 342 | merged: list[tuple[int, int]] = [] | 155 | merged: list[list[int]] = [] |
| 343 | for start, end in sorted(spans): | 156 | for start, end in sorted(spans): |
| 344 | if not merged or start > merged[-1][1] + 1: | 157 | if not merged or start > merged[-1][1] + 1: |
| 345 | merged.append((start, end)) | 158 | merged.append([start, end]) |
| 346 | continue | 159 | continue |
| 347 | prev_start, prev_end = merged[-1] | 160 | if end > merged[-1][1]: |
| 348 | if end > prev_end: | 161 | merged[-1][1] = end |
| 349 | merged[-1] = (prev_start, end) | 162 | return sum((end - start + 1 for start, end in merged)) |
| 350 | return merged |