rosa-abf/rosa-build

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

Summary

Maintainability
C
1 day
Test Coverage

Showing 5 of 5 total issues

Method index has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

def index
params[:kind] = params[:kind] == 'pull_requests' ? 'pull_requests' : 'issues'
raise Pundit::NotAuthorizedError if !@project.has_issues? && params[:kind] == 'issues'
 
params[:filter] = params[:filter].in?(['created', 'assigned']) ? params[:filter] : 'all'
Severity: Minor
Found in app/controllers/projects/issues_controller.rb - About 5 hrs to fix

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

def update
respond_to do |format|
format.html { render nothing: true, status: 200 }
 
format.json {
Severity: Minor
Found in app/controllers/projects/issues_controller.rb - About 2 hrs to fix

Method index has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def index
params[:kind] = params[:kind] == 'pull_requests' ? 'pull_requests' : 'issues'
raise Pundit::NotAuthorizedError if !@project.has_issues? && params[:kind] == 'issues'
 
params[:filter] = params[:filter].in?(['created', 'assigned']) ? params[:filter] : 'all'
Severity: Minor
Found in app/controllers/projects/issues_controller.rb - About 1 hr to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    respond_to do |format|
    if @label.save
    format.json { render partial: 'labels', locals: {project: @project} }
    else
    format.json { render text: @label.errors.full_messages, status: 422 }
    Severity: Minor
    Found in app/controllers/projects/issues_controller.rb and 1 other location - About 20 mins to fix
    app/controllers/projects/issues_controller.rb on lines 148..152

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    respond_to do |format|
    if @label.destroy
    format.json { render partial: 'labels', locals: {project: @project} }
    else
    format.json { render json: @label.errors.full_messages, status: 422 }
    Severity: Minor
    Found in app/controllers/projects/issues_controller.rb and 1 other location - About 20 mins to fix
    app/controllers/projects/issues_controller.rb on lines 128..132

    There are no issues that match your filters.

    Category
    Status