Method judge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def judge(target, total)
double = (total / 10) == (total % 10)
total_text = format00(total)
if total <= target
double ? Result.critical("(#{total_text})クリティカル") : Result.success("(#{total_text})成功")
- 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 return_result
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def return_result(result1, result2, text)
if result1.critical? || result2.critical?
Result.critical(text)
elsif result1.success? || result2.success?
Result.success(text)
- 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 eval_game_system_specific_command
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
cmd = Command::Parser.new(/AES?/, round_type: round_type).enable_prefix_number
.has_suffix_number.parse(command)
return nil unless cmd
- 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"