Class: Hashira::Pipeline
- Inherits:
-
Object
- Object
- Hashira::Pipeline
- Defined in:
- lib/hashira/pipeline.rb
Constant Summary collapse
- ANALYZERS =
%i[coupling complexity duplication].freeze
- RULES =
[Hashira::Analysis::CycleFindings, Hashira::Analysis::SdpViolationFindings].freeze
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #churn ⇒ Object
- #complexity ⇒ Object
- #duplication ⇒ Object
- #enabled?(analyzer) ⇒ Boolean
- #findings ⇒ Object
- #hotspots ⇒ Object
-
#initialize(project, enabled: ANALYZERS, packaging: :auto) ⇒ Pipeline
constructor
A new instance of Pipeline.
Constructor Details
#initialize(project, enabled: ANALYZERS, packaging: :auto) ⇒ Pipeline
Returns a new instance of Pipeline.
10 11 12 13 14 15 |
# File 'lib/hashira/pipeline.rb', line 10 def initialize(project, enabled: ANALYZERS, packaging: :auto) @project = project @enabled = enabled @trees = project.files.to_h { [it, parse(it)] } @graph = Hashira::Analysis::Graph.new(project, @trees, census(settle(packaging))) end |
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
17 18 19 |
# File 'lib/hashira/pipeline.rb', line 17 def graph @graph end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
17 18 19 |
# File 'lib/hashira/pipeline.rb', line 17 def project @project end |
Instance Method Details
#churn ⇒ Object
31 |
# File 'lib/hashira/pipeline.rb', line 31 def churn = @churn ||= Hashira::Churn.scan |
#complexity ⇒ Object
19 20 21 |
# File 'lib/hashira/pipeline.rb', line 19 def complexity @complexity ||= Hashira::Complexity::Analyzer.new(@project, @trees) if enabled?(:complexity) end |
#duplication ⇒ Object
23 24 25 |
# File 'lib/hashira/pipeline.rb', line 23 def duplication @duplication ||= Hashira::Duplication::Analyzer.new(@project, @trees, churn) if enabled?(:duplication) end |
#enabled?(analyzer) ⇒ Boolean
33 |
# File 'lib/hashira/pipeline.rb', line 33 def enabled?(analyzer) = @enabled.include?(analyzer) |
#findings ⇒ Object
35 |
# File 'lib/hashira/pipeline.rb', line 35 def findings = structural + listed(complexity) + listed(duplication) |