Method do_backup
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def self.do_backup(now, backup, save_status = true)
trace :info, "Performing backup [#{backup.name}]..."
Audit.log :actor => '<system>', :action => 'backup.start', :desc => "Performing backup #{backup.name}"
- 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 perform
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.perform
now = Time.now.getutc
begin
- 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 do_backup
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.do_backup(now, backup, save_status = true)
trace :info, "Performing backup [#{backup.name}]..."
Audit.log :actor => '<system>', :action => 'backup.start', :desc => "Performing backup #{backup.name}"
File backup.rb
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'db_layer'
# from RCS::Common
require 'rcs-common/trace'
Method filter_for_partial_backup
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.filter_for_partial_backup(params)
# extract the id from the string
id = Moped::BSON::ObjectId.from_string(params[:what][-24..-1])
Method backup_index
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.backup_index
index = []
glob = File.join File.expand_path(Config.instance.global['BACKUP_DIR']), '*'
- 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 restore_backup
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.restore_backup(params)
trace :info, "Restoring backup: #{params['_id']}"
backup_path = File.join File.expand_path(Config.instance.global['BACKUP_DIR']), params['_id']
Method get_last_incremental_id
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.get_last_incremental_id(params)
session = DB.instance.session
incremental_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 filter_for_partial_backup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.filter_for_partial_backup(params)
# extract the id from the string
id = Moped::BSON::ObjectId.from_string(params[:what][-24..-1])
- 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"