Showing 7 of 7 total issues
Method sub_entities
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def sub_entities(input_text, entities, display = false, &block)
# Adjust output text for each entity
output_text = input_text
offset = 0
entities.each do |entity|
- 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 extract_users
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def extract_users
Twitter::Extractor::extract_mentioned_screen_names_with_indices(@working_text).each do |entity|
display_text = '@' + entity[:screen_name]
username = entity[:screen_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 replace_emoji
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def replace_emoji
codes = {}
# Replace codes with shas
i = 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 extract_hashtags
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def extract_hashtags
Twitter::Extractor::extract_hashtags_with_indices(@working_text).each do |entity|
hashtag = entity[:hashtag]
# Validate
- 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 q_truncate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def q_truncate(truncate_at, options = {})
return dup unless length > truncate_at
# Default omission to '...'
options[:omission] ||= '...'
- 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 extract_markdown
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_markdown
extract_markdown_code if @options[:markdown_code]
if @options[:markdown_links]
extract_markdown_autolink_links
- 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 extract
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract(text)
@original_text = text.dup
# Emoji colon-syntax
replace_emoji if @options[:emoji]
- 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"