Showing 809 of 1,233 total issues
Method getSuccess
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def getSuccess(targetNumber, stepTotal)
return '自動失敗' if @isFailed
successTable = getSuccessTable
successInfo = get_table_by_number(targetNumber, successTable)
- 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 check_result
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def check_result(total, rand_results, cmp_op, target)
ret = check_result_legacy(total, rand_results, cmp_op, target)
return ret if ret
sides_list = rand_results.map(&:sides)
- 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
Open
return Result.failure("Failure")
Avoid too many return
statements within this method. Open
Open
return Result.critical("Colossal Success")
Avoid too many return
statements within this method. Open
Open
return fumble_text
Avoid too many return
statements within this method. Open
Open
return getCombineRoll(command)
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return fumble_text if total == 100
Avoid too many return
statements within this method. Open
Open
return fumble_text if fumbleable
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return "실패"
Avoid too many return
statements within this method. Open
Open
return Result.success("Low Success")
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return Result.success("High Success")
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return getHitResult(count, damageFunc, tail)
Avoid too many return
statements within this method. Open
Open
return getRegistResult(command)
Avoid too many return
statements within this method. Open
Open
return output
Avoid too many return
statements within this method. Open
Open
return 0, 0
Avoid too many return
statements within this method. Open
Open
return roll_bms_table()