Showing 332 of 436 total issues
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return -1;
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return this.opts.width;
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
return;
Method generate_sql_through_link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_sql_through_link(source_identifer_mapping, criterium_source_identifer_mapping)
result_hash = criterium.mapping.source.sql_codes(current_user)
sql_open = result_hash[:open]
sql_close = result_hash[:close]
- 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 user_can_view?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def user_can_view?(current_user, actions_required)
sensitive_variable = (self.variable.sensitivity != '0')
return true if actions_required.include?('download files') and self.source.user_has_action?(current_user, 'download files')
return true if actions_required.include?('download dataset') and self.source.user_has_action?(current_user, 'download dataset')
return true if actions_required.include?('view data distribution') and self.source.user_has_action?(current_user, 'view data distribution')
- 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 simple_date
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def simple_date(past_date)
return '' if past_date.blank?
if past_date == Date.today
'Today'
elsif past_date == Date.today - 1.day
- 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 apply_omniauth
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apply_omniauth(omniauth)
unless omniauth['info'].blank?
self.first_name = omniauth['info']['first_name'] if first_name.blank?
self.last_name = omniauth['info']['last_name'] if last_name.blank?
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"
Further reading
Method create_matches
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_matches(include_extra)
@matches = []
cases_matrix = []
controls_matrix = []
- 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"