Showing 377 of 529 total issues
Method create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
begin
@media_resource= MediaResource.find params[:id]
raise UserForbiddenError unless create_url_authorized?
if not current_user.act_as_uberadmin and
- 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 update_institutional_groups_from_ldap_localfile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_institutional_groups_from_ldap_localfile
JSON.parse(File.read("db/ldap.json")).each do |entry|
entry = entry["myhash"]
begin
next unless (entry["name"] and entry["extensionattribute1"] and entry["extensionattribute3"])
- 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 check_and_initialize_for_view
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_and_initialize_for_view
@filter_set = find_media_resource
raise "Wrong type" unless @filter_set.is_a? FilterSet
raise UserUnauthorizedError unless current_user.login.present? || current_user.authorized?(:view, @filter_set)
raise UserForbiddenError unless current_user.authorized?(:view,@filter_set)
- 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 index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def index
begin
params[:page] ||= 1
query_params = params.select{|k| [:page,:type].include? k.to_sym}.clone
- 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 index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def index
@meta_keys = MetaKey.page(params[:page]).per(12)
if (label = params.try(:[], :filter).try(:[], :label)).present?
label = label.strip
- 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 index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def index
@media_resource= MediaResource.find params[:id]
raise UserUnauthorizedError unless current_user.login.present? || current_user.authorized?(:view, @media_resource)
begin
raise "Forbidden" unless current_user.authorized?(:view, @media_resource)
- 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
Avoid too many return
statements within this function. Open
return 'other';
Avoid too many return
statements within this function. Open
return 'one';
Avoid too many return
statements within this function. Open
return 'one';
Avoid too many return
statements within this function. Open
return 'other';
Avoid too many return
statements within this function. Open
return 'other';
Avoid too many return
statements within this function. Open
return 'other';
Avoid too many return
statements within this function. Open
return WidgetAnnotation;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return i;
Avoid too many return
statements within this function. Open
return i;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return params;
Avoid too many return
statements within this function. Open
return TextWidgetAnnotation;
Avoid too many return
statements within this function. Open
return Annotation;