rosa-abf/rosa-build

View on GitHub
app/controllers/projects/pull_requests_controller.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 4 of 4 total issues

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

def create
unless pull_params
redirect :back
end
to_project = find_destination_project
Severity: Minor
Found in app/controllers/projects/pull_requests_controller.rb - About 2 hrs to fix

Method create has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def create
unless pull_params
redirect :back
end
to_project = find_destination_project
Severity: Minor
Found in app/controllers/projects/pull_requests_controller.rb - About 1 hr to fix

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

    def new
    to_project = find_destination_project(false)
    authorize to_project, :show?
     
    @pull = to_project.pull_requests.new
    Severity: Minor
    Found in app/controllers/projects/pull_requests_controller.rb - About 35 mins to fix

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

    def update
    authorize @pull
    status = 422
    if (action = params[:pull_request_action]) && %w(close reopen).include?(params[:pull_request_action])
    if @pull.send("can_#{action}?")
    Severity: Minor
    Found in app/controllers/projects/pull_requests_controller.rb - About 35 mins to fix

    There are no issues that match your filters.

    Category
    Status