Showing 16 of 16 total issues
Method libreoffice
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def libreoffice( format: )
suffixes = {
'pdf' => {
'.*' => 'pdf',
},
Class Document
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Document
attr_reader :base_dir
attr_reader :doc_key
CURRENT = 'current'
Method libreoffice
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def libreoffice( format: )
suffixes = {
'pdf' => {
'.*' => 'pdf',
},
- 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
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process email, mail_to, is_rts=false
documents = []
unless email.has_attachments?
logger.info "From: #{email.from} Subject: (#{email.subject}) Files: no attachments"
Method to_hash
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def to_hash
v_list = {}
versions.each do |v|
v_list[v] = {}
Dir.glob(directory + v + '*').each do |file|
- 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 deliver_onward
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def deliver_onward email, documents, mail_to
logger.info "Sending response mail to #{mail_to}"
email.cc [] # No CCing, just send to the recipient
email.to mail_to
email.subject "#{'Fwd: ' unless email.subject.to_s.start_with? 'Fwd:'}#{email.subject}"
- 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 to_hash
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_hash
v_list = {}
versions.each do |v|
v_list[v] = {}
Dir.glob(directory + v + '*').each do |file|
Method deliver_rts
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def deliver_rts email, documents, mail_to
logger.info "Sending response mail to #{mail_to}"
mail = Mail.new
mail.from @cfg[:from]
mail.to mail_to
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process email, mail_to, is_rts=false
documents = []
unless email.has_attachments?
logger.info "From: #{email.from} Subject: (#{email.subject}) Files: no attachments"
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def perform doc_key_str, version, action, new_filename, callback_url, status, description
Method symbolize_keys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def symbolize_keys(hash)
(hash||{}).inject({}){|result, (key, value)|
new_key = key.is_a?(String) ? key.to_sym : key
new_value = value.is_a?(Hash) ? symbolize_keys(value) : value
result[new_key] = new_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 execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def execute(*argv)
options = argv.last.class == Hash ? argv.pop : {}
started = Time.now.to_f
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def perform doc_key_str, version, filename, action, callback_url=nil
Method _wkhtmltopdf_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _wkhtmltopdf_options(content)
html = Nokogiri.parse(content)
attrs = html.xpath("//meta[starts-with(@name, 'colore')]").inject({}) do |h, meta|
name = meta.attributes['name'].value.sub(/^colore/, '-')
- 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 _execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _execute(*argv, options)
builder = java.lang.ProcessBuilder.new
builder.command(argv)
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def perform
purge_seconds = (C_.legacy_purge_days || 1).to_f * 86400.0
dir = LegacyConverter.new.legacy_dir
dir.each_entry do |file|
next if (dir+file).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"