rosa-abf/rosa-build

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

Summary

Maintainability
A
3 hrs
Test Coverage

Showing 3 of 3 total issues

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

def show
unless request.xhr?
render('empty') and return if @project.is_empty?
@tree = @tree / @path if @path.present?
@commit = @branch.present? ? @branch.commit() : @project.repo.log(@treeish, @path, max_count: 1).first
Severity: Minor
Found in app/controllers/projects/git/trees_controller.rb - About 1 hr to fix

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

def archive
format, @treeish = params[:format], params[:treeish]
raise Grit::NoSuchPathError unless @treeish =~ /^#{@project.name}-/ &&
@treeish !~ /[\s]+/ &&
format =~ /\A(zip|tar\.gz)\z/
Severity: Minor
Found in app/controllers/projects/git/trees_controller.rb - About 1 hr to fix

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

def get_sha1_of_archive
format, @treeish = params[:format], params[:treeish]
raise Grit::NoSuchPathError unless @treeish =~ /^#{@project.name}-/ &&
@treeish !~ /[\s]+/ &&
format =~ /\A(zip|tar\.gz)\z/
Severity: Minor
Found in app/controllers/projects/git/trees_controller.rb - About 35 mins to fix

There are no issues that match your filters.

Category
Status