app/models/project.rb
Showing 6 of 6 total issues
File project.rb
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class Project < ActiveRecord::Base has_ancestry orphan_strategy: :adopt # we replace a 'path' method in the Git module include Autostart include Owner
Class Project
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Project < ActiveRecord::Base has_ancestry orphan_strategy: :adopt # we replace a 'path' method in the Git module include Autostart include Owner
Method autostart_build_lists
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
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)
- Read upRead up
Method autostart_build_lists
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Method build_for
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Method build_for
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def build_for(mass_build, repository_id, arch = Arch.find_by(name: 'i586'), priority = 0, increase_rt = false)