sparklemotion/nokogiri

View on GitHub

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?)
 
 
Severity: Minor
Found in lib/nokogiri/xml/node.rb - About 25 mins to fix

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
Severity: Minor
Found in lib/nokogiri/xml/node.rb - About 25 mins to fix

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)
 
 
Severity: Minor
Found in lib/nokogiri/xml/sax/parser.rb - About 25 mins to fix
Severity
Category
Status
Source
Language