rosa-abf/rosa-build

View on GitHub
app/models/project.rb

Summary

Maintainability
C
1 day
Test Coverage

Showing 6 of 6 total issues

File project.rb has 285 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Project < ActiveRecord::Base
has_ancestry orphan_strategy: :adopt # we replace a 'path' method in the Git module
 
include Autostart
include Owner
Severity: Minor
Found in app/models/project.rb - About 2 hrs to fix

    Class Project has 25 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Project < ActiveRecord::Base
    has_ancestry orphan_strategy: :adopt # we replace a 'path' method in the Git module
     
    include Autostart
    include Owner
    Severity: Minor
    Found in app/models/project.rb - About 2 hrs to fix

      Method autostart_build_lists has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      def self.autostart_build_lists(autostart_status)
      Project.where(autostart_status: autostart_status).find_each do |p|
      p.project_to_repositories.autostart_enabled.includes(repository: :platform).each do |p_to_r|
      repository = p_to_r.repository
      user = User.find(p_to_r.user_id)
      Severity: Minor
      Found in app/models/project.rb - About 2 hrs to fix

      Method autostart_build_lists has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def self.autostart_build_lists(autostart_status)
      Project.where(autostart_status: autostart_status).find_each do |p|
      p.project_to_repositories.autostart_enabled.includes(repository: :platform).each do |p_to_r|
      repository = p_to_r.repository
      user = User.find(p_to_r.user_id)
      Severity: Minor
      Found in app/models/project.rb - About 1 hr to fix

        Method build_for has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def build_for(mass_build, repository_id, arch = Arch.find_by(name: 'i586'), priority = 0, increase_rt = false)
        build_for_platform = mass_build.build_for_platform
        save_to_platform = mass_build.save_to_platform
        user = mass_build.user
        # Select main and project platform repository(contrib, non-free and etc)
        Severity: Minor
        Found in app/models/project.rb - About 1 hr to fix

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

          def build_for(mass_build, repository_id, arch = Arch.find_by(name: 'i586'), priority = 0, increase_rt = false)
          Severity: Minor
          Found in app/models/project.rb - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status