lib/etl/foundation_extraction.rb
Method foundation
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
def foundation
registration_number = identification_number = name = address = objective = ''
date_start = date_end = date_liquidation = date_registration = ''
assets_value = assets_currency = 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 foundation
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def foundation
registration_number = identification_number = name = address = objective = ''
date_start = date_end = date_liquidation = date_registration = ''
assets_value = assets_currency = nil
Method digest_founders
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def digest_founders(table)
founders = []
table.xpath(".//tr").each do |founder_row|
founder_identification = founder_row.xpath(".//td[1]").inner_text.strip.split("\n")
founder_contribution = founder_row.xpath(".//td[3]").inner_text[1..-2].strip.split(' ')
Method create_resources
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_resources(resource_type, resources, attributes)
all_ids = resources.map(&:_record_id)
active_objects = []
attributes.each do |obj_hash|
case resource_type
Method digest_founders
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def digest_founders(table)
founders = []
table.xpath(".//tr").each do |founder_row|
founder_identification = founder_row.xpath(".//td[1]").inner_text.strip.split("\n")
founder_contribution = founder_row.xpath(".//td[3]").inner_text[1..-2].strip.split(' ')
- 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"