reitzig/texlogparser

View on GitHub

Showing 76 of 76 total issues

Assignment Branch Condition size for read is too high. [48.14/15]
Open

def read(lines)
# @type [Message] msg
msg, consumed = super(lines)
 
is_error = @start_match[1][0] == '!'

Method has too many lines. [31/25]
Open

def read(lines)
# @type [Message] msg
msg, consumed = super(lines)
 
is_error = @start_match[1][0] == '!'

Assignment Branch Condition size for parse_next_lines is too high. [19.82/15]
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 by rubocop

Cyclomatic complexity for scope_changes is too high. [10/6]
Open

def scope_changes(line)
pushed_dummy = false
 
result =
case line
Severity: Minor
Found in lib/tex_log_parser.rb by rubocop

Assignment Branch Condition size for scope_changes is too high. [19.65/15]
Open

def scope_changes(line)
pushed_dummy = false
 
result =
case line
Severity: Minor
Found in lib/tex_log_parser.rb by rubocop

Assignment Branch Condition size for read is too high. [19.87/15]
Open

def read(lines)
# @type [Message] msg
# @type [Int] consumed
msg, consumed = super(lines)
 
 

Perceived complexity for read is too high. [9/7]
Open

def read(lines)
# @type [Message] msg
msg, consumed = super(lines)
 
is_error = @start_match[1][0] == '!'

Assignment Branch Condition size for read is too high. [16.91/15]
Open

def read(lines)
# @type [Message] msg
msg, consumed = super(lines)
 
msg.level = :error

Assignment Branch Condition size for apply_scope_changes is too high. [16.52/15]
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 by rubocop

Cyclomatic complexity for read is too high. [7/6]
Open

def read(lines)
# @type [Message] msg
msg, consumed = super(lines)
 
is_error = @start_match[1][0] == '!'

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

Block has too many lines. [36/25]
Open

OptionParser.new do |opts|
opts.banner = 'Usage: texlogparser [options]'
opts.on('-d', '--debug', 'Output debug information') do
LogParser::Logger.debug = true
end
Severity: Minor
Found in bin/texlogparser by rubocop

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

    Avoid parameter lists longer than 5 parameters. [7/5]
    Open

    def initialize(message:, source_file: nil, source_lines: nil, log_lines: nil,
    preformatted: false, level: :info, pattern: nil)
    Severity: Minor
    Found in lib/log_parser/message.rb by rubocop

    Trailing spaces
    Open

    Note that the original log file will still be written to `example.log`,
    Severity: Info
    Found in README.md by markdownlint

    Trailing spaces
    Open

    Calling `parse` on it will yield a list of
    Severity: Info
    Found in README.md by markdownlint
    Severity
    Category
    Status
    Source
    Language