Showing 97 of 137 total issues
Method edit
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
def edit(
name: Discorb::Unset,
position: Discorb::Unset,
category: Discorb::Unset,
parent: 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
File message.rb
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Discorb
#
# Represents a message.
#
class Message < DiscordModel
File forum.rb
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Discorb
#
# Represents a forum channel.
#
class ForumChannel < GuildChannel
File gateway_events.rb
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Discorb
module Gateway
#
# Represents an event.
# @abstract
Method to_hash
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def to_hash
options_payload =
options.map do |name, value|
ret = {
type:
- 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 27 (exceeds 5 allowed). Consider refactoring. Open
def edit(
name: Discorb::Unset,
position: Discorb::Unset,
category: Discorb::Unset,
parent: 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 to_hash
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_hash
options_payload =
options.map do |name, value|
ret = {
type:
Method clean_content
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def clean_content(
user: true,
channel: true,
role: true,
emoji: true,
- 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
File command.rb
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Discorb
module ApplicationCommand
#
# Represents a application command.
# @abstract
Method edit
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def edit(
type: Discorb::Unset,
name: Discorb::Unset,
description: Discorb::Unset,
start_time: 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 edit_message
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def edit_message(
message_id,
content = Discorb::Unset,
embed: Discorb::Unset,
embeds: 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 edit
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def edit(
type: Discorb::Unset,
name: Discorb::Unset,
description: Discorb::Unset,
start_time: Discorb::Unset,
File text.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Discorb
#
# Represents a text channel.
#
class TextChannel < GuildChannel
Method create_post
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def create_post(
title,
content = nil,
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 _set_data
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _set_data(data)
@id = Snowflake.new(data[:id])
@channel_id = data[:channel_id]
if data[:guild_id]
Method post
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post(
content = nil,
tts: false,
embed: nil,
embeds: nil,
Method edit
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def edit(
name: Discorb::Unset,
position: Discorb::Unset,
category: Discorb::Unset,
parent: Discorb::Unset,
Method edit
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def edit(
content,
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 initialize
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def initialize(name, tone: 0)
if EmojiTable::DISCORD_TO_UNICODE.key?(name)
@name = name
@value = EmojiTable::DISCORD_TO_UNICODE[name]
elsif EmojiTable::UNICODE_TO_DISCORD.key?(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 edit
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def edit(
name: Discorb::Unset,
archived: Discorb::Unset,
auto_archive_duration: Discorb::Unset,
archive_in: 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"