rosa-abf/rosa-build

View on GitHub
app/controllers/projects/git/commits_controller.rb

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 2 total issues

Method diff has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def diff
res = params[:diff].split(/\A(.*)\.\.\.(.*)\z/).select {|e| e.present?}
if res[1].present?
params1 = res[0]
params2 = res[1] == 'HEAD' ? @project.resolve_default_branch : res.last
Severity: Minor
Found in app/controllers/projects/git/commits_controller.rb - About 1 hr to fix

Method show has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def show
@commit = @commentable = @project.repo.commit(params[:id]) || raise(ActiveRecord::RecordNotFound)
@comments = Comment.for_commit(@commit)
 
respond_to do |format|
Severity: Minor
Found in app/controllers/projects/git/commits_controller.rb - About 35 mins to fix
Category
Status