Showing 837 of 1,278 total issues
Method check_strike_rank
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_strike_rank(strikeRank)
strikeRank = strikeRank.to_i
dice = ''
dice_add = ''
- 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 result
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result(total)
if total <= @critical
Result.critical("クリティカル!")
elsif total >= @fumble
Result.fumble("ファンブル!")
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
case command
when /^Gr(\d+)?/i
if command =~ /^Gr(\d+)/i
growth(Regexp.last_match(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 result_r
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result_r(dice_total, total)
if dice_total <= @fumble
"ファンブル!"
elsif dice_total >= @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"
Further reading
Method sum_of_largest_straight
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sum_of_largest_straight(sorted_dice_values)
# 出目が3個未満ならば、ストレートは存在しない
return 0 if sorted_dice_values.length < 3
# ストレートの和の最大値
- 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_ability
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def roll_ability(command)
parser = Command::Parser.new("MS", round_type: @round_type)
.has_prefix_number
.disable_modifier
.restrict_cmp_op_to(:<=)
- 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 getCriticalResult
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def getCriticalResult(string)
# クリティカル効果データ
whh = [
'01:打撃で状況が把握出来なくなる。次ターンは1回の半アクションしか行なえない。',
'02:耳を強打された為、耳鳴りが酷く目眩がする。1Rに渡って一切のアクションを行なえない。',
- 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_action
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_action(command)
case command
when "ID"
eval_common_command("3TY6")
when "IE"
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.parse(command)
if (m = /^(\d[+\-\d]*)-(\d+)FW(?:@(\d+))?(?:\#(\d+))?$/.match(command))
new.tap do |fw|
fw.dice_count = m[2].to_i
fw.target = Arithmetic.eval(m[1], RoundType::FLOOR)
- 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 result_2d6
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result_2d6(total, dice_total, dice_list, cmp_op, target)
return nil if target == '?'
return nil unless cmp_op == :>=
result =
- 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 result_2d6
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result_2d6(total, dice_total, _dice_list, cmp_op, target)
return nil unless cmp_op == :>=
if dice_total <= 2
Result.fumble("ファンブル")
- 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 twohands_damage_roll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def twohands_damage_roll(command)
m = /^2H(\d+)D(\d+)([+-]\d+)?/.match(command)
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 check_seigou
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_seigou(string)
debug("check_seigou begin string", string)
sr_parser = Command::Parser.new("SR", round_type: round_type)
.has_suffix_number
- 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_shusoku
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def roll_shusoku(command)
m = /^KRS(?:\((\d),([-+\d]+)\))$/.match(command)
return nil unless m
dice_size = 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 result_2d6
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result_2d6(total, dice_total, _dice_list, cmp_op, target)
return nil unless cmp_op == :>=
if dice_total <= 2
Result.fumble("ファンブル(判定失敗。失敗表(FT)を追加で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 resolute_action
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def resolute_action(command)
m = /(\d)KU/.match(command)
return nil unless m
num_dices = 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 additional_result
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def additional_result(total, target_number)
tens, ones = split_d100(total)
if (total > target_number) || (total > 95) # 自動失敗時のファンブル処理も
if ones == tens
"ファンブル"
- 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 action_roll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def action_roll(command)
parser = Command::Parser.new("DC", round_type: round_type)
.enable_prefix_number()
.restrict_cmp_op_to(:>=, nil)
cmd = parser.parse(command)
- 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_critical
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_critical(humanity, atmark)
humanity = humanity ? humanity.to_i : 99
atmark_value = atmark ? ArithmeticEvaluator.eval(atmark) : 0
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"
Further reading
Method result_2d6
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result_2d6(total, dice_total, _dice_list, cmp_op, target)
return nil unless cmp_op == :>=
if dice_total <= 2
Result.fumble("ファンブル(【余裕】が 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"