Showing 30 of 30 total issues
Method sort
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def sort
setting = CodeReviewProjectSetting.find_or_create(@project)
@auto_assign = setting.auto_assign_settings
filters = params[:auto_assign][:filters].values unless params[:auto_assign][:filters].blank?
filters = [] unless filters
- 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 setAddReviewButton
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function setAddReviewButton(url, change_id, image_tag, is_readonly, is_diff, attachment_id) {
Method view_issues_show_details_bottom_org
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def view_issues_show_details_bottom_org(context = {})
project = context[:project]
return '' unless project
unless User.current.allowed_to?({:controller => 'code_review', :action => 'show'}, project)
return ''
- 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_filter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def edit_filter
setting = CodeReviewProjectSetting.find_or_create(@project)
@auto_assign = setting.auto_assign_settings
num = params[:num].to_i
filters = params[:auto_assign][:filters].values unless params[:auto_assign][:filters].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 select_assign_to_with_list
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def select_assign_to_with_list(project, list, commiter_id = nil)
return nil unless list
return nil if list.empty?
list.collect! { |item| item.to_i }
list.delete(commiter_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 create_with_changeset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.create_with_changeset(changeset)
project = changeset.project
setting = CodeReviewProjectSetting.find_or_create(project)
auto_assign = setting.auto_assign_settings
assignment = CodeReviewAssignment.new
- 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 method. Open
return unless auto_assign.match_with_change?(self)
Avoid too many return
statements within this method. Open
return ex.to_s
Function getReviewObjById
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getReviewObjById(review_id) {
for (var reviewlist in code_reviews_map) {
for (var i = 0; i < reviewlist.length; i++) {
var review = reviewlist[i];
if (review.id == review_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 open_assignment_issues
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def open_assignment_issues(user_id)
issues = []
assignments = []
assignments = change.code_review_assignments if change
assignments = assignments + changeset.code_review_assignments if changeset
- 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"