Showing 8 of 8 total issues
Method init_fog_file
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def init_fog_file(filename, body, options={})
# If the "filename" or the "body" are empty then return nil
return nil if filename.nil? || body.nil?
# Set file's access control list (ACL).
- 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 fog_options
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def fog_options
#If the CloudTempfile is disabled then revert to local file creation
@fog_provider = 'Local' if (@enabled != true)
options = { :provider => fog_provider }
- 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 fog_options
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fog_options
#If the CloudTempfile is disabled then revert to local file creation
@fog_provider = 'Local' if (@enabled != true)
options = { :provider => fog_provider }
Method load_yml!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def load_yml!
self.enabled = yml["enabled"] if yml.has_key?('enabled')
self.fog_provider = yml["fog_provider"] if yml.has_key?('fog_provider')
self.fog_directory = yml["fog_directory"]
- 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 with_config
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def with_config(&block)
return unless CloudTempfile.enabled?
errors = config.valid? ? "" : config.errors.full_messages.join(', ')
- 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 write
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def write(options = {})
_file_name = ((options.has_key?(:file_name))? options[:file_name] : self.file_name)
_file_raw_data = ((options.has_key?(:file_raw_data))? options[:file_raw_data] : self.file_raw_data)
return false if _file_name.nil? || _file_name.blank? || _file_raw_data.nil?
- 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 local_root
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def local_root(options={})
prefix = options.has_key?(:prefix)? options[:prefix] : self.config.prefix
begin
if !connection.directories.get(prefix).nil?
- 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 delete_expired_tempfiles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete_expired_tempfiles
return if !self.config.clean_up? || !self.config.enabled?
log "CloudTempfile.delete_expired_tempfiles is running..."
# Delete expired temp files
fog_files = (self.config.local?)? local_root.files : get_remote_files
- 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"