Showing 56 of 93 total issues
Method redis_key_for_participants
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def redis_key_for_participants(value)
if value.is_a?(Hash)
min = value[:min].blank? ? 0 : value[:min].to_i
max = value[:max].blank? ? 1000 : value[:max].to_i
nest[:temp][{participants: value}.hash].tap do |k|
- 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 new_third_party
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_third_party
if params[:user]
@signup_form = SignupFormThirdParty.new params[:user]
if @signup_form.valid?
create_member_from_third_party @signup_form
- 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 deeply nested control flow statements. Open
if(item.name === pickedApi) {
break;
}
Method redis_sorted_ids
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def redis_sorted_ids(set_key, options = {})
if options[:sort_by]
sort_options = {}
sort_options[:by] = nest[:sort][options[:sort_by]]['*']
order = []
- 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 getJsConnectString
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def JsConnect.getJsConnectString(user, request = {}, client_id = "", secret = "", secure = true)
Method put_apex_rest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.put_apex_rest(url_string, params={}, access_token=nil, user_type=:guest, version='v.9')
Method upsert_in_salesforce
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.upsert_in_salesforce(sobject, params, external_field_name, access_token=nil, user_type=:guest)
Method perform
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.perform(access_token, membername, campaign_source, campaign_medium, campaign_name)
Method post_apex_rest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.post_apex_rest(url_string, options, access_token=nil, user_type=:guest, version='v.9')
Method comment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def comment
comments = params[:comment][:comments]
if current_user.use_captcha?(@challenge, @current_member_participant)
unless verify_recaptcha
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def edit
# move the existing assets to a new array
@current_assets = @challenge.assets || []
# this array will only contain new assets being uploaded
- 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 register
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def register
redirect_to challenge_path, :error => 'Registration is closed for this challenge.' if current_challenge.closed_for_registration?
# puts CsPlatform.docusign_document(current_user.access_token, current_challenge.docusign_document) if current_challenge.docusign_document
# if default tos, let them register
if current_challenge.uses_default_tos?
- 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 validateForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function validateForm() {
var errors = [];
var startDate = new Date($('#date-range-hidden-start').val());
var endDate = new Date($('#date-range-hidden-end').val());
- 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 deleteAsset
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function deleteAsset(row, asset_id) {
$('#' + row).fadeOut();
$.ajax({
type: 'GET',
url: '/admin/challenges/delete_asset?asset_id=' + asset_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
Function validateForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function validateForm() {
var errors = [];
var startDate = new Date($('#date-range-hidden-start').val());
var endDate = new Date($('#date-range-hidden-end').val());
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
user = User.find_by_username(params[:user][:username].downcase)
attributes = params[:user]
if user and attributes[:password].present? and attributes[:password] == attributes[:password_confirmation]
resp = user.account.update_password(attributes[:reset_password_token], attributes[:password])
- 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"