rosa-abf/rosa-build

View on GitHub
app/models/concerns/git.rb

Summary

Maintainability
C
1 day
Test Coverage

Showing 5 of 5 total issues

Method run_mass_import has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

def run_mass_import(url, srpms_list, visibility, owner, add_to_repository_id)
doc = Nokogiri::HTML(open(url))
links = doc.css("a[href$='.src.rpm']")
return if links.count == 0
filter = srpms_list.lines.map(&:chomp).map(&:strip).select(&:present?)
Severity: Minor
Found in app/models/concerns/git.rb - About 6 hrs to fix

Method run_mass_import has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def run_mass_import(url, srpms_list, visibility, owner, add_to_repository_id)
doc = Nokogiri::HTML(open(url))
links = doc.css("a[href$='.src.rpm']")
return if links.count == 0
filter = srpms_list.lines.map(&:chomp).map(&:strip).select(&:present?)
Severity: Major
Found in app/models/concerns/git.rb - About 2 hrs to fix

    Method process_hook has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def process_hook(owner_uname, repo, newrev, oldrev, ref, newrev_type, user = nil, message = nil)
    Severity: Major
    Found in app/models/concerns/git.rb - About 1 hr to fix

      Method fork_git_repo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def fork_git_repo
      dummy = Grit::Repo.new(path) rescue nil
      # Do nothing if GIT repo already exist
      unless dummy
      if alias_from_id
      Severity: Minor
      Found in app/models/concerns/git.rb - About 45 mins to fix

      Method run_mass_import has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def run_mass_import(url, srpms_list, visibility, owner, add_to_repository_id)
      Severity: Minor
      Found in app/models/concerns/git.rb - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status