Showing 837 of 1,278 total issues
Avoid too many return
statements within this method. Open
return roll_hope(Regexp.last_match(1).to_i)
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return '', []
Avoid too many return
statements within this method. Open
return ret if ret
Avoid too many return
statements within this method. Open
return 'Poor(お粗末)' if stepTotal >= poor
Avoid too many return
statements within this method. Open
return "失敗"
Avoid too many return
statements within this method. Open
return Result.failure(output)
Avoid too many return
statements within this method. Open
return output
Method getBulletResults
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getBulletResults(bullet_count, hit_type, diff)
bullet_set_count = getSetOfBullet(diff)
hit_bullet_count_base = getHitBulletCountBase(diff, bullet_set_count)
impale_bullet_count_base = (bullet_set_count / 2.to_f)
- 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 pick_item
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def pick_item(index)
if index <= 6
translate("LogHorizon.TRS.below_lower_limit", value: 6) # 6以下の出目は未定義です
elsif index <= 62
@items[index]
- 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_roll
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_roll(command)
m = /^(\d+)?ATK([1-6]{0,6})$/.match(command)
return nil unless m
dice_count = m[1]&.to_i || 1
- 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_nw
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_nw(string)
m = /^([-+]?\d+)?#{@nw_command}((?:[-+]\d+)+)?(?:@(\d+(?:,\d+)*))?(?:#(\d+(?:,\d+)*))?(?:\$(\d+))?((?:[-+]\d+)+)?(?:([>=]+)(\d+))?$/.match(string)
unless m
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 pick_item
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def pick_item(index)
if index <= 6
translate("LogHorizon.TRS.below_lower_limit", value: 6)
elsif index <= 162
@items[index]
- 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 roll
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def roll(cr, modifier, randomizer)
return nil if cr == 0 && modifier == 0
index =
if cr == 0 && modifier != 0
- 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 roll_ot
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def roll_ot(command)
m = /^(\d+)OT>=(\d+)$/.match(command)
return nil unless m
times = m[1].to_i
- 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 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 parse_2r6
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_2r6(string)
m = /^2R6m\[([-+]?\d+(?:[-+]\d+)*)(?:,([-+]?\d+(?:[-+]\d+)*))?\](?:c\[(\d+(?:,\d+)*)\])?(?:f\[(\d+(?:,\d+)*)\])?(?:([>=]+)(\d+))?/i.match(string)
unless m
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 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"
Further reading
Method roll
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def roll(randomizer)
dice = randomizer.roll_once(@items.length)
chosen = @items[dice - 1]
critical = chosen == CRITICAL
- 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"