rosa-abf/rosa-build

View on GitHub
app/controllers/api/v1/pull_requests_controller.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Showing 4 of 4 total issues

Method update has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

def update
@pull = @project.pull_requests.includes(:issue).where(issues: {serial_id: params[:id]}).first
authorize @pull
 
if pull_params.present?
Severity: Minor
Found in app/controllers/api/v1/pull_requests_controller.rb - About 2 hrs to fix

Method render_pulls_list has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def render_pulls_list
@pulls = @pulls.includes(issue: [:user, :assignee])
if params[:status] == 'closed'
@pulls = @pulls.closed_or_merged
else
Severity: Minor
Found in app/controllers/api/v1/pull_requests_controller.rb - About 1 hr to fix

Method render_pulls_list has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def render_pulls_list
@pulls = @pulls.includes(issue: [:user, :assignee])
if params[:status] == 'closed'
@pulls = @pulls.closed_or_merged
else
Severity: Minor
Found in app/controllers/api/v1/pull_requests_controller.rb - About 1 hr to fix

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

    def create
    from_project = Project.find_by(id: pull_params[:from_project_id])
    from_project ||= @project
    authorize from_project, :show?
     
     
    Severity: Minor
    Found in app/controllers/api/v1/pull_requests_controller.rb - About 1 hr to fix
    Category
    Status