Class: DeepCover::Analyser::Node
Instance Attribute Summary
Attributes included from Base
#options, #source
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Subset
#node_children
Methods included from Base
#covered_code, #each_node, #node_children, #node_covered?, #node_runs_map, #node_stat_contributions, #node_stat_type, #results, #stats
#covered?
Constructor Details
#initialize(source, **options) ⇒ Node
Returns a new instance of Node.
11
12
13
14
15
16
17
|
# File 'lib/deep_cover/analyser/node.rb', line 11
def initialize(source, **options)
@cache = {}.compare_by_identity
super
@allow_filters = Config.options_to_ignored(**options)
.map { |kind| Node.filter_to_method_name(kind) }
@nocov_ranges = FlagCommentAssociator.new(covered_code)
end
|
Class Method Details
.human_name ⇒ Object
7
8
9
|
# File 'lib/deep_cover/analyser/node.rb', line 7
def self.human_name
'Nodes'
end
|
Instance Method Details
#in_subset?(node, _parent) ⇒ Boolean
27
28
29
|
# File 'lib/deep_cover/analyser/node.rb', line 27
def in_subset?(node, _parent)
node.executable?
end
|
#node_runs(node) ⇒ Object
19
20
21
22
23
24
25
|
# File 'lib/deep_cover/analyser/node.rb', line 19
def node_runs(node)
@cache.fetch(node) do
runs = super
runs = nil if runs == 0 && should_be_ignored?(node)
@cache[node] = runs
end
end
|