Showing 10 of 12 total issues
Method pagelet
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pagelet path, p_options = {}
Rails.logger.info "Rendering pagelet #{path}"
p_params = p_options.delete(:params) { {} }.with_indifferent_access
Method pagelet
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def pagelet path, p_options = {}
Rails.logger.info "Rendering pagelet #{path}"
p_params = p_options.delete(:params) { {} }.with_indifferent_access
- 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 pagelet_cache
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def pagelet_cache &block
# puts 'pagelet_cache'.blue
cache_enabled = pagelet_options.cache || pagelet_options.cache_path || pagelet_options.expires_in
if !cache_enabled
- 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 around
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def around(controller)
cache_layout = @cache_layout.respond_to?(:call) ? @cache_layout.call(controller) : @cache_layout
path_options = if @cache_path.is_a?(Proc)
controller.instance_exec(controller, &@cache_path)
- 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 processDataRemoteTags
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
root.processDataRemoteTags = function() {
$('form[data-remote]').each(function(index, elem){
var $el = $(elem);
var container = $el.closest('[data-pagelet-container]');
Method pagelet_cache
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pagelet_cache &block
# puts 'pagelet_cache'.blue
cache_enabled = pagelet_options.cache || pagelet_options.cache_path || pagelet_options.expires_in
if !cache_enabled
Function loadPagelets
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
root.loadPagelets = function(selector) {
selector = selector || '[data-pagelet-load]';
var groups = {};
$(selector).each(function(index, elem) {
Method render_remote_load
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def render_remote_load
# puts 'render_remote_load'.blue
render_remotely = pagelet_render_remotely?
if render_remotely && pagelet_options.has_cache
render_remotely = false
- 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 process_action
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_action *args
super.tap do
if params[:target_container] &&
action_has_layout? &&
request.format.js? # wrap to js only if requested js
- 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 expire_action
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def expire_action(options = {})
return unless cache_configured?
if options.is_a?(Hash) && options[:action].is_a?(Array)
options[:action].each { |action| expire_action(options.merge(action: action)) }
- 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"