Showing 837 of 1,278 total issues
Method result
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def result(value_groups)
r = Result.new
r.fumble = value_groups[0].values.all?(1)
Method eval_game_system_specific_command
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(string)
string = replace_text(string)
return nil unless /(^|\s)S?((\d+)[rR]6(\[([,\d]+)\])?)(\s|$)/i =~ string
Method mk_nick_a_table
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mk_nick_a_table(output, num)
table = [
[11, "“災い転じて福となす”"],
[12, "“七転び八起きの”"],
[13, "“冗談にも程がある”"],
Method eval_game_system_specific_command
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
case command
when /\d+VBS/
resolute_action(command)
when /\d+VF/
Method action_roll
has 28 lines of code (exceeds 25 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)
Method get_rg_roll_result
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_rg_roll_result(result_header_text, difficulty, feat_die_number, piercing_blows_number, total_dice_number, success_count, opts)
# 状態表示取得
condition_text = get_condition_text(opts)
success_count_text = "成功度 #{success_count}"
Method roll_sq
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_sq(command)
m = /(\d+)SQ([+\-\d]+)?(([>=]+)(\d+))?/i.match(command)
return nil unless m
dice_count = m[1].to_i
Method getCheckResult
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getCheckResult(command)
m = /^GS([-+]?\d+)?(?:(?:([@#])([-+]?\d+))(?:([@#])([-+]?\d+))?)?(?:(>=?)(\d+))?$/i.match(command)
unless m
return nil
end
Method resolute_investigation
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def resolute_investigation(command)
m = /^([-+]\d+)?AI<=(\d+),(\d)$/.match(command)
return nil unless m
num_bonus = m[1].to_i
Method rollFullAuto
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rollFullAuto(bullet_count, diff, broken_number, dice_num)
output = ""
loopCount = 0
counts = {
Method roll_mythos_madness_table
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_mythos_madness_table(command)
m = /^MMT(\[?([1-8],[1-8])\]?)?/.match(command)
return nil unless m
sequence = []
Method next_token
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def next_token
return [false, "$"] if @scanner.eos?
@notations.each do |n|
token = @scanner.scan(n)
- 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_1d100
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def result_1d100(total, _dice_total, cmp_op, target)
return nil unless cmp_op == :<=
if total <= 1
Result.critical("貫通") # 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 result_1d20
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def result_1d20(total, _dice_total, cmp_op, target)
return Result.nothing if target == '?'
return nil unless cmp_op == :<=
if total <= target
- 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 text
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def text
if critical && special
translate("Cthulhu.critical_special")
elsif critical
translate("Cthulhu.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 successful_or_failed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def successful_or_failed(total, diff)
case total
when 2
diff <= 1 ? '成功(大成功ではない)' : '大成功!'
when 12
- 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 mh_crc_table
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def mh_crc_table(suv, num)
header_parts = ['戦闘結果チャート', num]
separator = ' > '
suv = suv.to_s.upcase
- 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_ub
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def roll_ub(command)
parser = Command::Parser.new("UB", round_type: @round_type)
.has_prefix_number
.enable_critical
parsed = 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 roll_action
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def roll_action(command)
parser = Command::Parser.new("DS", round_type: @round_type)
.enable_prefix_number
.restrict_cmp_op_to(nil)
parsed = 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 check_roll
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_roll(command)
m = /^2D6([+\-\d]*)>=(\d+)(\[(\d+)?(,(\d+))?\])?$/i.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"