#NEWLINE# def __init__( self , cov , code_unit ) : #NEWLINE# #INDENT# self . coverage = cov #NEWLINE# self . code_unit = code_unit #NEWLINE# self . filename = self . code_unit . filename #NEWLINE# ( actual_filename , source ) = self . find_source ( self . filename ) #NEWLINE# self . parser = CodeParser ( text = source , filename = actual_filename , exclude = self . coverage . _exclude_regex ( 'exclude' ) ) #NEWLINE# ( self . statements , self . excluded ) = self . parser . parse_source ( ) #NEWLINE# executed = self . coverage . data . executed_lines ( self . filename ) #NEWLINE# exec1 = self . parser . first_lines ( executed ) #NEWLINE# self . missing = ( self . statements - exec1 ) #NEWLINE# if self . coverage . data . has_arcs ( ) : #NEWLINE# #INDENT# self . no_branch = self . parser . lines_matching ( join_regex ( self . coverage . config . partial_list ) , join_regex ( self . coverage . config . partial_always_list ) ) #NEWLINE# n_branches = self . total_branches ( ) #NEWLINE# mba = self . missing_branch_arcs ( ) #NEWLINE# n_partial_branches = sum ( [ len ( v ) for ( k , v ) in iitems ( mba ) if ( k not in self . missing ) ] ) #NEWLINE# n_missing_branches = sum ( [ len ( v ) for ( k , v ) in iitems ( mba ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# n_branches = n_partial_branches = n_missing_branches = 0 #NEWLINE# self . no_branch = set ( ) #NEWLINE# #UNINDENT# self . numbers = Numbers ( n_files = 1 , n_statements = len ( self . statements ) , n_excluded = len ( self . excluded ) , n_missing = len ( self . missing ) , n_branches = n_branches , n_partial_branches = n_partial_branches , n_missing_branches = n_missing_branches )