Showing 1,031 of 1,643 total issues
Avoid too many return
statements within this method. Open
return render partial: "comment/comment", collection: @comments
Avoid too many return
statements within this method. Open
return "%1.1f TB" % value
Avoid too many return
statements within this method. Open
redirect_to_translation && (return) if @page.profile.redirect_l10n
Function validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
validate: function(form) {
for (var i=0; tinymce.editors[i]; i++) {
var editor = tinymce.editors[i]
var textarea = editor.getElement()
textarea.value = editor.getContent()
- 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 cropImage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function cropImage(element) {
$("#crop-image-button").click()
if( jcrop_api != null ) jcrop_api.destroy()
- 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 edit_in_place_submit_image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function edit_in_place_submit_image(form, field) {
var formData = new FormData(form[0]);
$.ajax({
- 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 unlocalize_currency
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function unlocalize_currency(value, from) {
if (!value)
return 0;
if (!from)
from = locale;
- 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 autoCompleteStateCity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function autoCompleteStateCity($) {
var country_selected = $('[id$="_country"] option:selected').val()
if(country_selected == "BR")
{
$('#state_field').autocomplete({
- 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 body_ending
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def body_ending
domain = context.environment.piwik_domain
site_id = context.environment.piwik_site_id
unless domain.blank? || site_id.blank?
piwik_url = "#{domain}/#{context.environment.piwik_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
Method search_scope
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.search_scope(scope, params)
scope = scope.with_status params[:status] if params[:status].present?
scope = scope.for_consumer_id params[:consumer_id] if params[:consumer_id].present?
scope = scope.for_profile_id params[:supplier_id] if params[:supplier_id].present?
scope = scope.with_code params[:code] if params[:code].present?
- 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 holder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def holder
return nil if self.box.nil? || self.owner.nil?
if self.owner.kind_of?(Environment)
return nil if self.owner.portal_community.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 user_can_rate_now?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def user_can_rate_now?
return false unless user
ratings = OrganizationRating.where(
organization_id: profile.id,
- 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 set_seed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_seed(new_seed = false)
block = self
proc do
if block.order == "random"
if new_seed || cookies[:_noosfero_community_tracks_rand_seed].blank?
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def index
if request.post?
if params[:environment][:piwik_domain]
params[:environment][:piwik_domain].sub! /^https?:\/\//, ""
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 check_comment_actions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_comment_actions(comment)
proc do
if user
comment.marked_as_read?(user) ? "#comment-action-mark-as-not-read-#{comment.id}" : "#comment-action-mark-as-read-#{comment.id}"
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 filter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def filter
if id = params[:id]
@order = OrdersCyclePlugin::Sale.find id rescue nil
@cycle = @order.cycle
else
- 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 distribute_products_to_consumer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def distribute_products_to_consumer
self.distribute_products_on_create = true if self.distribute_products_on_create.nil?
return if self.self? || self.consumer.person? || (not self.distribute_products_on_create)
already_supplied = self.consumer.distributed_products.unarchived.from_supplier_id(self.id).all
- 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 edit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def edit
@provider = params[:id] ? environment.oauth_providers.find(params[:id]) : environment.oauth_providers.new
if request.post?
if @provider.update(params["oauth_client_plugin_provider"])
session[:notice] = _("Saved!")
- 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 get_node
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_node(block, articles)
nodes = []
articles.map do |article|
node = {}
node[:data] = article.title
- 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 docs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def docs
order_string = "published_at"
order_string += " DESC" if order_by_recent
limit_final = [limit_to_show, 0].max
- 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"