Method parse_loop
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
def parse_loop(io, yield_non_keyword_lines, remove_quotes, size, rx)
line_continuation = false
@line_number = 0
@keyword = 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 calculate_range_value
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.calculate_range_value(type, data_type, bit_size)
value = 0 # Default for UINT minimum
case data_type
when :INT
- 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
Avoid deeply nested control flow statements. Open
if !((string.length > 1) && (string[1] == '{'))
break
end
Method parse_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_file(filename,
yield_non_keyword_lines = false,
remove_quotes = true,
run_erb = true,
variables = {},
Method parse_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_file(filename,
yield_non_keyword_lines = false,
remove_quotes = true,
run_erb = true,
variables = {},
- 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_loop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_loop(io, yield_non_keyword_lines, remove_quotes, size, rx)
Method create_parsed_output_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_parsed_output_file(filename, run_erb, variables)
begin
output = nil
if run_erb
Cosmos.set_working_dir(File.dirname(filename)) do
- 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
Avoid too many return
statements within this method. Open
return 2147483647
Avoid too many return
statements within this method. Open
return 0
Avoid too many return
statements within this method. Open
return -Float::MAX
Avoid too many return
statements within this method. Open
return -9223372036854775808
Avoid too many return
statements within this method. Open
return 18446744073709551615
Avoid too many return
statements within this method. Open
return Float::INFINITY
Avoid too many return
statements within this method. Open
return 255
Avoid too many return
statements within this method. Open
return Float::MAX
Avoid too many return
statements within this method. Open
return value
Avoid too many return
statements within this method. Open
return -3.402823e38
Avoid too many return
statements within this method. Open
return 65535
Avoid too many return
statements within this method. Open
return 4294967295
Avoid too many return
statements within this method. Open
return 3.402823e38
Avoid too many return
statements within this method. Open
return 32767
Avoid too many return
statements within this method. Open
return 9223372036854775807
Avoid too many return
statements within this method. Open
return -Float::INFINITY
Avoid too many return
statements within this method. Open
return -2147483648