Class: Hashira::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/hashira/pipeline.rb

Constant Summary collapse

RULES =
[Analysis::CycleFindings, Analysis::SdpViolationFindings].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ Pipeline

Returns a new instance of Pipeline.



7
8
9
10
11
12
# File 'lib/hashira/pipeline.rb', line 7

def initialize(project)
  @project = project
  trees = project.files.to_h { [_1, parse(_1)] }
  @census = Analysis::Census.new(project, trees)
  @graph = Analysis::Graph.new(project, trees, @census)
end

Instance Attribute Details

#graphObject (readonly)

Returns the value of attribute graph.



14
15
16
# File 'lib/hashira/pipeline.rb', line 14

def graph
  @graph
end

#projectObject (readonly)

Returns the value of attribute project.



14
15
16
# File 'lib/hashira/pipeline.rb', line 14

def project
  @project
end

Instance Method Details

#findingsObject



18
# File 'lib/hashira/pipeline.rb', line 18

def findings = RULES.flat_map { _1.new(@project, @graph).list }