Showing 123 of 172 total issues
Method find_profile_subject
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_profile_subject
SocialStream.profile_subject_keys.each do |type|
id = params["#{ type }_id"]
next if id.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 setRosterForBidirectionalTie
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def setRosterForBidirectionalTie(userASid,userBSid,userANick,userBNick,groupForA,groupForB)
Method populate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def populate klass, author, owner, relation_ids, &block
Method addBuddyToRoster
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def addBuddyToRoster(userSid,buddySid,buddyNick,buddyGroup,subscription_type)
Method title_of
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def title_of(act_obj)
if act_obj.is_a? Comment
'Re: ' + title_of(act_obj.parent_post)
elsif act_obj.respond_to? :title and (not act_obj.title.nil?)
act_obj.title.truncate(30, :separator => ' ')
- 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 notify
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def notify
return true unless notificable?
#Avaible verbs: follow, like, make-friend, post, update, join
case
- 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 find_or_create_for_oauth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find_or_create_for_oauth(info, signed_in_user = nil)
auth = Authentication.find_by_provider_and_uid(info["provider"], info["uid"])
if auth.present?
if signed_in_user.present? && auth.user != signed_in_user
- 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_ability_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_ability_file
ability_code = [
"# Generator social_stream:install has modified this file. Please,", #0
"# check everything is working ok, specially if the former `Ability`", #1
"# class inherited from another class or included another module", #2
- 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 defaults_for
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def defaults_for(actor)
subject_type = actor.subject.class.to_s.underscore
cfg_rels = SocialStream.custom_relations.with_indifferent_access[subject_type]
- 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 parseWord(subwords[0]) + imageLink + parseWord(subwords[1])
Avoid too many return
statements within this function. Open
return parseWord(subwords[0]) + link + parseWord(subwords[1])
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this method. Open
return ( params[:password] and params[:password] == SocialStream::Presence.xmpp_server_password )
Avoid too many return
statements within this function. Open
return parseWord(subwords[0]) + youtubeLink + parseWord(subwords[1])
Avoid too many return
statements within this function. Open
return word
Function Wall
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
SocialStream.Wall = (function(SS, $, undefined){
var callback = new SS.Callback();
var initInputAutosize = function() {
- 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 find_or_initialize_with_error_by_email
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_or_initialize_with_error_by_email(value, error)
if value.present?
record = find_by_email(value)
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 current_subject_from_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def current_subject_from_params
return unless params[:s].present?
subject = Actor.find_by_slug!(params[:s]).subject
- 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 FullCalendar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
SocialStream.FullCalendar = (function(SS, $, Scheduler, undefined){
var callback = new SS.Callback(),
current,
eventColor = 'gray';
- 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 recursiveCopyFolder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def recursiveCopyFolder(localPath,remotePath,sftp)
#Check if localPath is a file
if File.file?(localPath) and File.file?(remotePath)
puts "Copy files..."
- 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"