rosa-abf/rosa-build

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

Summary

Maintainability
B
6 hrs
Test Coverage

Showing 4 of 4 total issues

Method publish has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def publish
@build_list.update_type = params[:build_list][:update_type] if params[:build_list][:update_type].present?
 
if params[:attach_advisory].present? and params[:attach_advisory] != 'no' and !@build_list.advisory
 
 
Severity: Minor
Found in app/controllers/projects/build_lists_controller.rb - About 2 hrs to fix

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

def index
authorize :build_list
params[:filter].each{|k,v| params[:filter].delete(k) if v.blank? } if params[:filter]
 
respond_to do |format|
Severity: Minor
Found in app/controllers/projects/build_lists_controller.rb - About 1 hr to fix

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

def create
notices, errors = [], []
 
@repository = Repository.find build_list_params[:save_to_repository_id]
@platform = @repository.platform
Severity: Minor
Found in app/controllers/projects/build_lists_controller.rb - About 1 hr to fix

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

    def create
    notices, errors = [], []
     
    @repository = Repository.find build_list_params[:save_to_repository_id]
    @platform = @repository.platform
    Severity: Minor
    Found in app/controllers/projects/build_lists_controller.rb - About 1 hr to fix
    Category
    Status