lib/hqmf-parser/2.0/data_criteria_helpers/dc_specific_occurrences_and_source_data_criteria_extract.rb
Method handle_specific_and_source
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def handle_specific_and_source(occurrence_identifier, source_data_criteria_extension, source_data_criteria_root,
specific_occurrence_const, specific_occurrence)
source_data_criteria = "#{source_data_criteria_extension}_#{source_data_criteria_root}_source"
if !occurrence_identifier.blank?
# if it doesn't exist, add extracted occurrence to the map
- 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 handle_occurrence_var
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def handle_occurrence_var(stripped_id, stripped_lvn, stripped_sdc, occurrence_id_compare, occurrence_lvn_compare, occ_index)
Method handle_specific_and_source
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def handle_specific_and_source(occurrence_identifier, source_data_criteria_extension, source_data_criteria_root,
specific_occurrence_const, specific_occurrence)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(entry, id, local_variable_name, data_criteria_references, occurrences_map)
Method obtain_occurrence_identifier
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def obtain_occurrence_identifier(stripped_id, stripped_lvn, stripped_sdc, is_variable)
if is_variable || (stripped_sdc.include? 'qdm_var')
occurrence_lvn_regex = 'occ[A-Z]of_qdm_var'
occurrence_id_regex = 'occ[A-Z]of_qdm_var'
occ_index = 3
- 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"