@@ -14,17 +14,19 @@ class DiffBuilder
1414 # http://pmd.sourceforge.net/report_2_0_0.xsd
1515 def build ( base_report_filename , patch_report_filename , base_info , patch_info , filter_set = nil )
1616 report_diffs = ReportDiff . new
17- base_violations , base_errors = parse_pmd_report ( base_report_filename , 'base' , filter_set )
18- patch_violations , patch_errors = parse_pmd_report ( patch_report_filename , 'patch' )
17+ base_details , patch_details = report_diffs . calculate_details ( base_info , patch_info )
18+ base_violations , base_errors = parse_pmd_report ( base_report_filename , 'base' ,
19+ base_details . working_dir , filter_set )
20+ patch_violations , patch_errors = parse_pmd_report ( patch_report_filename , 'patch' ,
21+ patch_details . working_dir )
1922 report_diffs . calculate_violations ( base_violations , patch_violations )
2023 report_diffs . calculate_errors ( base_errors , patch_errors )
21- report_diffs . calculate_details ( base_info , patch_info )
2224
2325 report_diffs
2426 end
2527
26- def parse_pmd_report ( report_filename , branch , filter_set = nil )
27- doc = PmdReportDocument . new ( branch , filter_set )
28+ def parse_pmd_report ( report_filename , branch , working_dir , filter_set = nil )
29+ doc = PmdReportDocument . new ( branch , working_dir , filter_set )
2830 parser = Nokogiri ::XML ::SAX ::Parser . new ( doc )
2931 parser . parse_file ( report_filename ) unless report_filename . nil?
3032 [ doc . violations , doc . errors ]
0 commit comments