Class Platform
has 28 methods (exceeds 20 allowed). Consider refactoring.
class Platform < ActiveRecord::Base
extend FriendlyId
friendly_id :name, use: [:finders]
include FileStoreClean
Method allowed?
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
def self.allowed?(path, token)
platform_name = path.gsub(/^[\/]+/, '')
.match(/^(#{NAME_PATTERN}\/|#{NAME_PATTERN}$)/)
return true unless platform_name
Method cached_chroot
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
def cached_chroot(arch)
return false if personal?
Rails.cache.fetch([:cached_chroot, name, arch], expires_in: 10.minutes) do
product = products.where(name: CACHED_CHROOT_PRODUCT_NAME).first
next false unless product
Method public_downloads_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def public_downloads_url(subplatform_name = nil, arch = nil, repo = nil)
"#{APP_CONFIG['downloads_url']}/#{name}/repository/".tap do |url|
url << "#{subplatform_name}/" if subplatform_name.present?
url << "#{arch}/" if arch.present?
url << "#{repo}/" if repo.present?
There are no issues that match your filters.