#NEWLINE# def __init__( self , coverage_analysis ) : #NEWLINE# #INDENT# self . lines_total = sorted ( coverage_analysis . statements ) #NEWLINE# self . lines_excluded = sorted ( coverage_analysis . excluded ) #NEWLINE# self . lines_missing = sorted ( coverage_analysis . missing ) #NEWLINE# numbers = coverage_analysis . numbers #NEWLINE# self . n_lines_total = numbers . n_statements #NEWLINE# self . n_lines_excluded = numbers . n_excluded #NEWLINE# self . n_lines_missing = numbers . n_missing #NEWLINE# self . n_lines_covered = ( self . n_lines_total - self . n_lines_missing ) #NEWLINE# self . n_branches = numbers . n_branches #NEWLINE# self . n_branches_partial = numbers . n_partial_branches #NEWLINE# self . n_branches_missing = numbers . n_missing_branches #NEWLINE# self . n_branches_covered = ( self . n_branches - self . n_branches_missing ) #NEWLINE# self . n_branches_partial_covered = ( self . n_branches - self . n_branches_partial ) #NEWLINE# if ( self . n_lines_total == 0 ) : #NEWLINE# #INDENT# self . code_coverage = 100 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . code_coverage = ( ( self . n_lines_covered * 100 ) / self . n_lines_total ) #NEWLINE# #UNINDENT# if ( self . n_branches == 0 ) : #NEWLINE# #INDENT# self . branch_coverage = 100 #NEWLINE# self . branch_partial_coverage = 100 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . branch_coverage = ( ( self . n_branches_covered * 100 ) / self . n_branches ) #NEWLINE# self . branch_partial_coverage = ( ( self . n_branches_partial_covered * 100 ) / self . n_branches )