From 19e52a9bdcfc3318efb2cdcbf1e9cf3343b3dbf8 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 15 Oct 2009 06:38:10 -0400 Subject: Refactor the analysis results so we aren't passing so many tuples around. --- coverage/xmlreport.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'coverage/xmlreport.py') diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py index 9898e7e1..155f7bf5 100644 --- a/coverage/xmlreport.py +++ b/coverage/xmlreport.py @@ -80,7 +80,7 @@ class XmlReporter(Reporter): # Use the DOM to write the output file. outfile.write(self.xml_out.toprettyxml()) - def xml_file(self, cu, statements, excluded_unused, missing): + def xml_file(self, cu, analysis): """Add to the XML report for a single file.""" # Create the 'lines' and 'package' XML elements, which @@ -101,14 +101,14 @@ class XmlReporter(Reporter): xclass.setAttribute("complexity", "0.0") # For each statement, create an XML 'line' element. - for line in statements: + for line in analysis.statements: l = self.xml_out.createElement("line") l.setAttribute("number", str(line)) # Q: can we get info about the number of times # a statement is executed? If so, that should be # recorded here. - l.setAttribute("hits", str(int(not line in missing))) + l.setAttribute("hits", str(int(not line in analysis.missing))) # Q: can we get info about whether this statement # is a branch? If so, that data should be @@ -116,8 +116,8 @@ class XmlReporter(Reporter): #l.setAttribute("branch", "false") xlines.appendChild(l) - class_lines = 1.0 * len(statements) - class_hits = class_lines - len(missing) + class_lines = 1.0 * len(analysis.statements) + class_hits = class_lines - len(analysis.missing) class_branches = 0.0 class_branch_hits = 0.0 -- cgit v1.2.1