Showing 38 of 53 total issues
Class Release
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Release < ApplicationRecord
extend ActionView::Helpers::TranslationHelper
include ActionView::Helpers::TranslationHelper
include ReleaseUrl
include ReleaseAuth
Class Manager
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Manager
include Zealot::Backup::Helper
TEMPDIR_PREFIX = 'zealot-backup'
DEFAULT_BACKUP_PATH = 'public/backup'
Method stardford_app
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def stardford_app(user)
app_name = t('demo.app_name1')
app_bundle_id = 'com.zealot.app-demo'
channels = %i[Android iOS]
schemes = [
Method perform
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform(debug_file, user_id = nil)
parser = AppInfo.parse(debug_file.file.path)
case parser.format
when AppInfo::Format::DSYM
Method convert_changelog
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def convert_changelog
if json_string?(changelog)
self.changelog = JSON.parse(changelog)
elsif changelog.blank?
self.changelog = []
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method set_disk_volumes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def set_disk_volumes
@disks = Sys::Filesystem.mounts.each_with_object([]) do |mount, obj|
mount_options = mount.options.split(',').map(&:strip)
# next if (EXCLUDED_MOUNT_OPTIONS & mount_options).any?
next if (EXCLUDED_MOUNT_TYPES & [mount.mount_type]).any?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_dsym
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_dsym(debug_file, parser)
bundle_ids = debug_file.app.bundle_ids
if bundle_ids.present?
upload_bundle_ids = []
Method process_signature_certs
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_signature_certs(parser, metadata)
metadata.developer_certs = parser.signatures.each_with_object([]) do |sign, certs|
signature = { scheme: sign[:version] }
signature[:verified] = sign[:verified]
signature[:certificates] = sign[:certificates]&.each_with_object([]) do |cert, obj|
Method register_device
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def register_device(udid, name = nil)
if (existed_device = Device.find_by(udid: udid))
return existed_device
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method fetch_icon
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fetch_icon(parser)
file = case parser.platform
when AppInfo::Platform::IOS
return if parser.icons.blank?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method update
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def update
authorize @setting
@title = t('.title')
@value = setting_param[:value]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method dump
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dump
FileUtils.rm_f(db_file_name)
compress_rd, compress_wr = IO.pipe
compress_pid = spawn(gzip_cmd, in: compress_rd, out: [db_file_name, 'w', 0600])
Function received
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
received(data) {
if (Zealot.isDevelopment) {
console.debug("Received data", data)
}
Method register_device
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def register_device(udid, name = nil)
if (existed_device = Device.find_by(udid: udid))
return existed_device
end
Method parse_dsym
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_dsym(debug_file, parser)
bundle_ids = debug_file.app.bundle_ids
if bundle_ids.present?
upload_bundle_ids = []
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method release_versions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def release_versions(limit = 10)
versions = releases.select(:release_version)
.where.not(release_version: nil)
.group(:release_version)
.map(&:release_version)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method remove_old
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def remove_old(max_keeps = nil)
logger.debug 'Deleting old backups ... '
Dir.chdir(backup_path) do
max_keeps ||= Setting.backup[:max_keeps]
backup_file_count = backup_file_list.size
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function dialogElement
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
get dialogElement() {
const root = document.createElement("div")
root.id = DIALOG_ID
root.classList.add("modal")
root.classList.add("fade")
Method all_idenfiters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def all_idenfiters(device_type: nil)
schemes.all.each_with_object({}) do |scheme, obj|
channels = scheme.channels
channels = device_type ? channels.where(device_type: device_type) : channels.all
channels.each do |channel|
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method process_ios
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process_ios(parser, metadata)
process_app_common(parser, metadata)
process_mobileprovision(parser.mobileprovision, metadata) if parser.mobileprovision?
metadata.bundle_id = parser.bundle_id
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"