Class: Hashira::Duplication::Analyzer
- Inherits:
-
Object
- Object
- Hashira::Duplication::Analyzer
- Defined in:
- lib/hashira/duplication/analyzer.rb
Instance Method Summary collapse
- #clusters ⇒ Object
- #findings ⇒ Object
-
#initialize(project, trees, churn) ⇒ Analyzer
constructor
A new instance of Analyzer.
Constructor Details
#initialize(project, trees, churn) ⇒ Analyzer
Returns a new instance of Analyzer.
6 7 8 9 10 |
# File 'lib/hashira/duplication/analyzer.rb', line 6 def initialize(project, trees, churn) @project = project @trees = trees @churn = churn end |
Instance Method Details
#clusters ⇒ Object
12 |
# File 'lib/hashira/duplication/analyzer.rb', line 12 def clusters = @clusters ||= Clusterer.new(fragments).clusters.sort_by { -it.mass } |
#findings ⇒ Object
14 |
# File 'lib/hashira/duplication/analyzer.rb', line 14 def findings = clusters.map { |cluster| DuplicationFinding.new(cluster, @churn).to_finding } |