Showing 38 of 48 total issues
Method _set_data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _set_data(data)
super
@name = data[:name]
@messages = {}
@attachments = {}
Method initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(client, data, before, after)
@client = client
@data = data
@before = before
@after = after
Method edit_original_message
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def edit_original_message(
content = nil,
embed: nil,
embeds: nil,
attachment: nil,
Method initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(
title = nil,
description = nil,
color: nil,
url: nil,
- 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 to_hash
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def to_hash(other = nil)
payload = { parse: %w[everyone roles users] }
replied_user = nil_merge(@replied_user, other&.replied_user)
everyone = nil_merge(@everyone, other&.everyone)
roles = nil_merge(@roles, other&.roles)
- 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 post
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def post(
content = nil,
tts: false,
embed: nil,
embeds: nil,
- 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 yard_replace
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def yard_replace(dir, version)
sha = `git rev-parse HEAD`.strip
tag = `git describe --exact-match #{sha}`
tag = tag.empty? ? "(main)" : tag.strip
Dir.glob("#{dir}/**/*.html") do |file|
- 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 edit
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def edit(
name: Discorb::Unset,
description: Discorb::Unset,
tag: Discorb::Unset,
reason: Discorb::Unset
- 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 wait
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def wait(path)
# return if path.url.start_with?("https://")
if @global && @global > Time.now.to_f
time = @global - Time.now.to_f
@client.logger.info(
- 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 modify_option_map
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def modify_option_map(option_map, options, guild, members, attachments)
Method initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(client, data, before, after)
@client = client
@data = data
@before = before
@after = after
- 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 _set_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _set_data(data, gateway)
@code = data[:code]
if gateway
@channel_data = { id: data[:channel_id] }
@guild_data = { id: data[:guild_id] }
- 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 edit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def edit(name: Discorb::Unset, avatar: Discorb::Unset)
Async do
payload = {}
payload[:username] = name unless name == Discorb::Unset
if avatar == Discorb::Unset
- 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 _set_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _set_data(data)
@data = data
@guild_id = data[:guild_id]
@channel_id = data[:channel_id]
@user_id = data[:user_id]
- 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 _set_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _set_data(data)
@username = data[:username]
@global_name = data[:global_name]
@verified = data[:verified]
@id = Snowflake.new(data[:id])
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(client, data)
@client = client
@id = Snowflake.new(data[:id])
@application_id = Snowflake.new(data[:application_id])
@type = self.class.interaction_name
- 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 modify_localization_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def modify_localization_hash(hash)
hash.to_h do |rkey, value|
key = rkey.to_s.gsub("_", "-")
if VALID_LOCALES.none? { |valid| valid.downcase == key.downcase } &&
key != "default"
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(data)
@name = data[:name]
@type = ACTIVITY_TYPES[data[:type]]
@url = data[:url]
@created_at = Time.at(data[:created_at])
- 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"