Class: PmdTester::CpdReport

Inherits:
Object
  • Object
show all
Defined in:
lib/pmdtester/cpd_report_diff.rb

Overview

A full CPD report, created by the report XML parser, can be diffed with another report into a CpdReportDiff

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report_details:, report_document:, file:) ⇒ CpdReport

Returns a new instance of CpdReport.



11
12
13
14
15
16
# File 'lib/pmdtester/cpd_report_diff.rb', line 11

def initialize(report_details:, report_document:, file:)
  initialize_empty
  initialize_with_report_document report_document unless report_document.nil?
  @report_details = report_details
  @file = file
end

Instance Attribute Details

#duplicationsObject (readonly)

Returns the value of attribute duplications.



7
8
9
# File 'lib/pmdtester/cpd_report_diff.rb', line 7

def duplications
  @duplications
end

#errorsObject (readonly)

Returns the value of attribute errors.



7
8
9
# File 'lib/pmdtester/cpd_report_diff.rb', line 7

def errors
  @errors
end

#fileObject (readonly)

Returns the value of attribute file.



7
8
9
# File 'lib/pmdtester/cpd_report_diff.rb', line 7

def file
  @file
end

#report_detailsObject (readonly)

Returns the value of attribute report_details.



7
8
9
# File 'lib/pmdtester/cpd_report_diff.rb', line 7

def report_details
  @report_details
end

Class Method Details

.emptyObject



18
19
20
# File 'lib/pmdtester/cpd_report_diff.rb', line 18

def self.empty
  new(report_details: PmdTester::PmdReportDetail.empty, report_document: nil, file: '')
end