Method process_ctest_results
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
def process_ctest_results(src_dir, build_dir, test_dir)
unless File.directory?(test_dir)
$logger.error("Error: test_dir #{test_dir} does not exist, cannot parse test results")
return nil, []
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method process_cmake_results
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def process_cmake_results(src_dir, build_dir, stderr, cmake_exit_code, is_package)
results = []
file = nil
line = nil
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File resultsprocessor.rb
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/all'
require 'find'
require_relative 'codemessage'
require_relative 'testresult'
Method process_ctest_results
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_ctest_results(src_dir, build_dir, test_dir)
unless File.directory?(test_dir)
$logger.error("Error: test_dir #{test_dir} does not exist, cannot parse test results")
return nil, []
end
Method parse_msvc_line
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def parse_msvc_line(src_dir, build_dir, line)
return nil if line.nil?
/(?<filename>.+)\((?<line_number>[0-9]+)\): (?<message_type>.+?) (?<message_code>\S+): (?<message>.*) \[.*\]?/ =~ line
pattern_found = !filename.nil? && !message_type.nil?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method process_cmake_results
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_cmake_results(src_dir, build_dir, stderr, cmake_exit_code, is_package)
results = []
file = nil
line = nil
Method process_lcov_results
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def process_lcov_results(out)
# Overall coverage rate:
# lines......: 67.9% (173188 of 255018 lines)
# functions..: 83.8% (6228 of 7433 functions)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_msvc_line
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_msvc_line(src_dir, build_dir, line)
return nil if line.nil?
/(?<filename>.+)\((?<line_number>[0-9]+)\): (?<message_type>.+?) (?<message_code>\S+): (?<message>.*) \[.*\]?/ =~ line
pattern_found = !filename.nil? && !message_type.nil?
Method process_gcc_results
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process_gcc_results(src_path, build_path, stderr, gcc_exit_code)
results = []
linker_msg = nil
stderr.encode('UTF-8', :invalid => :replace).split("\n").each do |line|
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_gcc_line
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_gcc_line(src_path, build_path, line)
# 'Something.cc:32:4: multiple definition of variable'
/(?<filename>.*):(?<line_number>[0-9]+):(?<column_number>[0-9]+): (?<message_type>.+?): (?<message>.*)/ =~ line
pattern_found = !filename.nil? && !message_type.nil?
message_is_error = !(%w[info note].include? message_type)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method process_cmake_results
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_cmake_results(src_dir, build_dir, stderr, cmake_exit_code, is_package)
Method process_python_results
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_python_results(src_dir, build_dir, stdout, stderr, python_exit_code)
Method parse_error_messages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_error_messages(src_dir, build_dir, output)
results = []
output.encode('UTF-8', :invalid => :replace).split("\n").each do |l|
msg = parse_gcc_line(src_dir, build_dir, l)
msg = parse_msvc_line(src_dir, build_dir, l) if msg.nil?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method process_python_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_python_results(src_dir, build_dir, stdout, stderr, python_exit_code)
results = []
stdout.encode('UTF-8', :invalid => :replace).split("\n").each do |err|
msg = parse_python_or_latex_line(src_dir, build_dir, err)
results << msg unless msg.nil?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method relative_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def relative_path(path, src_dir, build_dir)
Pathname.new("#{src_dir}/#{path}").realpath.relative_path_from(Pathname.new(this_src_dir).realdirpath)
rescue
begin
Pathname.new("#{build_dir}/#{path}").realpath.relative_path_from(Pathname.new(this_src_dir).realdirpath)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_python_or_latex_line
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Wontfix
def parse_python_or_latex_line(src_dir, build_dir, line)
line_number = nil
# Since we are just doing line-by-line parsing, it really limits what we can get, but we'll try our best anyway
if line.include? 'LaTeX Error'
# ! LaTeX Error: Environment itemize undefined.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"