1- import typing
21from collections import defaultdict
32from itertools import repeat
3+ from xml .etree .ElementTree import Element
44
5+ import sentry_sdk
56from shared .reports .resources import Report
67
78from services .report .languages .base import BaseLanguageProcessor
1314
1415
1516class CSharpProcessor (BaseLanguageProcessor ):
16- def matches_content (self , content , first_line , name ) :
17- return bool ( content .tag == "CoverageSession" )
17+ def matches_content (self , content : Element , first_line : str , name : str ) -> bool :
18+ return content .tag == "CoverageSession"
1819
20+ @sentry_sdk .trace
1921 def process (
20- self , name : str , content : typing . Any , report_builder : ReportBuilder
22+ self , name : str , content : Element , report_builder : ReportBuilder
2123 ) -> Report :
2224 report_builder_session = report_builder .create_report_builder_session (name )
2325 return from_xml (content , report_builder_session )
@@ -38,7 +40,7 @@ def _build_branches(branch_gen):
3840 return branches
3941
4042
41- def from_xml (xml , report_builder_session : ReportBuilderSession ) -> Report :
43+ def from_xml (xml : Element , report_builder_session : ReportBuilderSession ) -> Report :
4244 """
4345 https://github.com/OpenCover/opencover/issues/293#issuecomment-94598145
4446 @sl - start line
@@ -50,13 +52,10 @@ def from_xml(xml, report_builder_session: ReportBuilderSession) -> Report:
5052 @vc - statement executed
5153 <SequencePoint vc="2" uspid="3" ordinal="0" offset="0" sl="35" sc="8" el="35" ec="9" bec="0" bev="0" fileid="1" />
5254 """
53- ignored_lines , sessionid = (
54- report_builder_session .ignored_lines ,
55- report_builder_session .sessionid ,
56- )
55+ ignored_lines = report_builder_session .ignored_lines
56+
5757 # dict of {"fileid": "path"}
5858 file_by_id = {}
59- file_by_id_get = file_by_id .get
6059 file_by_name = {None : None }
6160 for f in xml .iter ("File" ):
6261 filename = report_builder_session .path_fixer (
0 commit comments