Showing 54 of 66 total issues
Method initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(tag, ascending: nil)
self.class.ensure_tag!(tag)
@tag = tag.to_sym
@use_scope = ACCEPTED_FILTERS.dig(@tag, :use_scope)
- 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 show
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show
slug_or_id = params[:show_id] || params[:id]
if (@show = Show.find_by_slug(slug_or_id) || Show.find_by(id: slug_or_id))
Shows::Kitsu::Get.perform(kitsu_id: @show.reference_id, force_update: true) if @show.kitsu?
render('show')
- 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 provider_info
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def provider_info(provider)
info = PROVIDERS_MAP[provider.to_s]
oauth_class = info && info[:class]
oauth_class = oauth_class.constantize unless oauth_class.is_a?(Class)
raise "Invalid OAuth provider: #{provider}" if oauth_class.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 categories
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.categories(context:, filters: {}, include_others: false)
categories_classes = include_others ? all_categories_classes : main_categories_classes
categories_classes.map do |category_class|
category = category_class.new(context: context, filters: filters)
- 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 name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def name(format: DEFAULT_FORMAT)
return unless valid?
properties = format.scan(FORMAT_RE).flatten
- 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 streaming_platforms_from_anilist!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def streaming_platforms_from_anilist!(show)
anilist_id = show.anilist_id
return unless anilist_id.present?
show_urls = Shows::Anilist::Streamers.perform(
- 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 badge_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def badge_options
options = {}
if show_type == 'movie'
options.merge!({ type: :info, text: t('anime.shows.movie') })
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute
variables = prepare_variables(params[:variables])
query = params[:query]
operation_name = params[:operationName]
- 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
Function getResults
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getResults() {
$.ajax({
url: "/api/get/shows",
method: 'post',
data: 'token='+ token + '&get_host=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
Method execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute
variables = prepare_variables(params[:variables])
query = params[:query]
operation_name = params[:operationName]
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute
printf('Generating for shows: ')
@successful_ids = []
shows.each do |show|
result = show.update_banner_and_poster_urls!(force: force)
- 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 airing_in
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def airing_in(starts_on)
difference = (starts_on - current_time.to_date).to_i
difference_this_week = difference.abs % 7
return { title: 'time.airing.today.title', content: 'time.airing.today.content' } if difference_this_week == 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 ensure_url_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ensure_url_type
return if url_type.present? || !value.present?
url_to_type_regex = /(\w+\.)?(\w+)(\.\w+)/
url_type = platform&.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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute
return empty_search_result unless any_search_attributes?
final_results = if (platform = Platform.find_by(name: search))
platform.shows.order(:status)
- 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"