Sha256: 92aedeaa7619b3e3a9232af58404aede0fb840d23ea6d950f90a7b220ab7bcce

Contents?: true

Size: 480 Bytes

Versions: 14

Compression:

Stored size: 480 Bytes

Contents

require_relative 'subset'

module DeepCover
  class Analyser::Branch < Analyser
    include Analyser::Subset
    SUBSET_CLASSES = [Node::Branch]

    def results
      each_node.map do |node, _children|
        branches_runs = node.branches.map{|b| [b, node_runs(b)]}.to_h
        [node, branches_runs]
      end.to_h
    end

    def is_trivial_if?(node)
      parent = node.parent
      parent.is_a?(Node::If) && parent.condition.is_a?(Node::SingletonLiteral)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
deep-cover-0.1.14 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.13 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.12 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.11 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.10 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.9 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.8 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.7 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.6 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.5 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.4 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.3 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.2 lib/deep_cover/analyser/branch.rb
deep-cover-0.1.1 lib/deep_cover/analyser/branch.rb