Method get_and_process_file
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_and_process_file from_url=true,from_jerm=false
if from_url
data_hash = get_data_hash_from_url
#delete the previous conversion to refresh, but only if a copy of the original exists
pdf_path = @content_blob.filepath("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 get_pdf
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_pdf
if @content_blob.url.blank?
begin
pdf_or_convert
rescue Exception=>e
- 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 find_and_authorize_associated_asset
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_and_authorize_associated_asset
asset = asset_object
if asset
if asset.can_download? || (params[:code] && asset.auth_by_code?(params[:code]))
@asset = asset
- 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"