class RuboCop::Cop::Lint::DuplicateBranch
def literal_branch?(branch) # rubocop:disable Metrics/CyclomaticComplexity
def literal_branch?(branch) # rubocop:disable Metrics/CyclomaticComplexity return false if !branch.literal? || branch.xstr_type? return true if branch.basic_literal? branch.each_descendant.all? do |node| node.basic_literal? || node.pair_type? || # hash keys and values are contained within a `pair` node (node.const_type? && ignore_constant_branches?) end end