Skip to content

Commit

Permalink
changed concatenation for urls
Browse files Browse the repository at this point in the history
  • Loading branch information
o-andrieiev committed Dec 12, 2024
1 parent b0fd434 commit 72df367
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions universum/modules/code_report_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ def _process_one_sarif_issue(self, issue, root_uri_base_paths, who) -> None:
if artifact_data.get('uriBaseId'):
# means path is relative, need to make absolute
uri_base_id = artifact_data.get('uriBaseId', '')
root_base_path = root_uri_base_paths.get(uri_base_id, '')
if uri_base_id and not root_base_path:
base_uri = root_uri_base_paths.get(uri_base_id, '')
if uri_base_id and not base_uri:
raise ValueError(f"Unexpected lack of 'originalUriBaseIds' value for {uri_base_id}")
uri = str(Path(root_base_path) / uri)
path = urllib.parse.unquote(urllib.parse.urlparse(uri).path)
else:
base_uri = ''
path = str(Path(urllib.parse.urlparse(urllib.parse.urljoin(base_uri, uri)).path))
region_data = location_data.get('region')
if not region_data:
continue # TODO: cover this case as comment to the file as a whole
Expand Down

0 comments on commit 72df367

Please sign in to comment.