reitzig/texlogparser

View on GitHub

Showing 6 of 76 total issues

Method read has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def read(lines)
# @type [Message] msg
msg, consumed = super(lines)
 
is_error = @start_match[1][0] == '!'
Severity: Minor
Found in lib/tex_log_parser/patterns/highlighted_messages.rb - About 1 hr to fix

Method apply_scope_changes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def apply_scope_changes
# In the hope that scope changes happen not on the same
# line as messages. Gulp.
scope_changes(@lines.first).each do |op|
if op == :pop
Severity: Minor
Found in lib/log_parser/log_parser.rb - About 1 hr to fix

Method scope_changes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def scope_changes(line)
pushed_dummy = false
 
result =
case line
Severity: Minor
Found in lib/tex_log_parser.rb - About 1 hr to fix

Method read has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def read(lines)
# @type [Message] msg
msg, consumed = super(lines)
 
is_error = @start_match[1][0] == '!'
Severity: Minor
Found in lib/tex_log_parser/patterns/highlighted_messages.rb - About 1 hr to fix

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

    def [](offset, length = nil)
    base_length = length || 1
    while offset + base_length > @buffer.size
    return (length.nil? ? nil : @buffer[offset, @buffer.size]) if stream_is_done?
    @buffer.push(@stream.readline.rstrip)
    Severity: Minor
    Found in lib/log_parser/buffer.rb - About 1 hr to fix

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

    def parse_next_lines
    raise 'Parse already done!' if @lines.empty?
     
    line = @lines.first
    Logger.debug "\nLine #{@log_line_number}: '#{line.strip}'"
    Severity: Minor
    Found in lib/log_parser/log_parser.rb - About 35 mins to fix
    Severity
    Category
    Status
    Source
    Language