MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / set_matched_lines

Function set_matched_lines

src/licensedcode/match.py:858–866  ·  view source on GitHub ↗

Update a ``matches`` LicenseMatch sequence with start and end line given a `line_by_pos` {pos: line} mapping.

(matches, line_by_pos)

Source from the content-addressed store, hash-verified

856
857
858def set_matched_lines(matches, line_by_pos):
859 """
860 Update a ``matches`` LicenseMatch sequence with start and end line given a
861 `line_by_pos` {pos: line} mapping.
862 """
863 # if there is no line_by_pos, do not bother: the lines will stay to zero.
864 if line_by_pos:
865 for match in matches:
866 match.set_lines(line_by_pos)
867
868
869def merge_matches(matches, max_dist=None, trace=TRACE_MERGE):

Callers 2

get_undetected_matchesFunction · 0.90
refine_matchesFunction · 0.85

Calls 1

set_linesMethod · 0.80

Tested by

no test coverage detected