Showing 383 of 516 total issues
Method prepend_child
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def prepend_child(node_or_tags) if (first = children.first) # Mimic the error add_child would raise. raise "Document already has a root node" if document? && !(node_or_tags.comment? || node_or_tags.processing_instruction?)
- Read upRead up
Method wrap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wrap(node_or_tags) case node_or_tags when String context_node = parent || document new_parent = context_node.coerce(node_or_tags).first
- Read upRead up
Method parse_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_file(filename, encoding = @encoding) raise ArgumentError, "no filename provided" unless filename raise Errno::ENOENT unless File.exist?(filename) raise Errno::EISDIR if File.directory?(filename)
- Read upRead up