erikw/nestedtext-ruby

View on GitHub

Showing 10 of 17 total issues

Method has too many lines. [24/15]
Open

def detect_line_tag
if @content.length.zero? # rubocop:disable Style/ZeroLengthPredicate
self.tag = :blank
elsif @content[0] == '#'
self.tag = :comment
Severity: Minor
Found in lib/nestedtext/scanners.rb by rubocop

Perceived complexity for detect_line_tag is too high. [12/8]
Open

def detect_line_tag
if @content.length.zero? # rubocop:disable Style/ZeroLengthPredicate
self.tag = :blank
elsif @content[0] == '#'
self.tag = :comment
Severity: Minor
Found in lib/nestedtext/scanners.rb by rubocop

Cyclomatic complexity for detect_line_tag is too high. [11/7]
Open

def detect_line_tag
if @content.length.zero? # rubocop:disable Style/ZeroLengthPredicate
self.tag = :blank
elsif @content[0] == '#'
self.tag = :comment
Severity: Minor
Found in lib/nestedtext/scanners.rb by rubocop

Method has too many lines. [17/15]
Open

def parse_any(indentation)
return nil if @line_scanner.peek.nil?
 
case @line_scanner.peek.tag
when :list_item
Severity: Minor
Found in lib/nestedtext/parser.rb by rubocop

Cyclomatic complexity for parse_any is too high. [8/7]
Open

def parse_any(indentation)
return nil if @line_scanner.peek.nil?
 
case @line_scanner.peek.tag
when :list_item
Severity: Minor
Found in lib/nestedtext/parser.rb by rubocop

Method detect_line_tag has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def detect_line_tag
if @content.length.zero? # rubocop:disable Style/ZeroLengthPredicate
self.tag = :blank
elsif @content[0] == '#'
self.tag = :comment
Severity: Minor
Found in lib/nestedtext/scanners.rb - About 1 hr to fix

Method dump_custom_class has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def dump_custom_class(obj, **kwargs)
raise Errors::DumpUnsupportedTypeError.new(obj, traced_key) if @strict
 
if obj.is_a? Symbol
dump_string(obj.id2name, **kwargs)
Severity: Minor
Found in lib/nestedtext/dumper.rb - About 35 mins to fix

Method prepare_next_line has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def prepare_next_line
line = nil
loop do
linestr = @io.gets&.chomp
lineno = @io.lineno - 1 # Be 0-based
Severity: Minor
Found in lib/nestedtext/scanners.rb - About 35 mins to fix

Method dump_any has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def dump_any(obj, depth: 0, **kwargs)
trace_cycles(obj) do
case obj
when Hash then dump_hash(obj, depth: depth, **kwargs)
when Array then dump_array(obj, depth: depth, **kwargs)
Severity: Minor
Found in lib/nestedtext/dumper.rb - About 25 mins to fix

Assignment Branch Condition size for detect_line_tag is too high. [<14, 28, 14> 34.29/17]
Open

def detect_line_tag
if @content.length.zero? # rubocop:disable Style/ZeroLengthPredicate
self.tag = :blank
elsif @content[0] == '#'
self.tag = :comment
Severity: Minor
Found in lib/nestedtext/scanners.rb by rubocop
Severity
Category
Status
Source
Language