Showing 33 of 40 total issues
Method required_refercne_not_exist?
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def required_refercne_not_exist?
return false unless use_reference?
return false unless reference_options[:required]
return false if bit_field.has_reference?
true
- 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 check_array_demension
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def check_array_demension
return unless register.array?
return if register.dimensions.size == 1
return if array_options[:support_multiple_dimensions]
error 'multiple dimensions array register is not allowed'
- 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 overlap_indirect_indexes?
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def overlap_indirect_indexes?(previous_register)
return false unless overlap_address_range?(register, previous_register)
return true unless unique_shadw_indexes?(register, previous_register)
return true unless unique_shadw_indexes?(previous_register, register)
false
- 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 select_target_item
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def select_target_item(cell)
@target_items.fetch(cell.value.type) do
next if cell.value.type == :default
error "unknown register type: #{cell.value.type}", cell
end unless cell.empty?
- 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 reference_width_mismatch?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def reference_width_mismatch?
return false unless use_reference?
return false unless bit_field.has_reference?
bit_field.reference.width != required_reference_width
end
- 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 parse_address
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_address(cell)
if pattern_matched?
addresses = captures.compact.map(&method(:Integer))
if addresses.size == 2
addresses
- 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 ==
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ==(other)
return false unless name == other.name
return true if [value, other.value].any?(&:nil?)
value == other.value
end
- 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 check_array_register_usage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_array_register_usage
return unless register.array?
return if support_array_register?
error 'array register is not allowed'
end
- 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 width_mismatch?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def width_mismatch?
return false if required_width.nil?
if required_width.respond_to?(:include?)
required_width.not.include?(bit_field.width)
else
- 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 required_reference_width
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def required_reference_width
return 1 unless reference_options[:width]
return bit_field.width if reference_options[:width] == same_width
reference_options[:width]
end
- 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 description
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def description(value = nil)
if value
@description = value
elsif @description || @default
''.tap do |d|
- 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 define_rggen_class
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def define_rggen_class(base_class, options, body)
if options.key?(:include) || body
Class.new(base_class) do
include(*Array(options[:include])) if options.key?(:include)
class_exec(&body) if body
- 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 required_width
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def required_width
width = self.class.required_width
return nil if width.nil?
return configuration.data_width if width == full_width
width
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create(*args)
parent = (child_factory? && args.shift) || nil
sources = args
create_component(parent, *sources).tap do |component|
create_items(component, *sources) if create_items?
- 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 not_aligned_with_data_width?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def not_aligned_with_data_width?
byte_width = configuration.byte_width
return true unless (@start_address + 0).multiple?(byte_width)
return true unless (@end_address + 1).multiple?(byte_width)
false
- 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 create_new_entry
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_new_entry(associated_category, body)
ComponentEntry.new.tap do |new_entry|
new_entry.instance_exec(&body)
@builder.categories.each do |name, category|
next if associated_category && name != associated_category
- 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 enable_item_entries
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def enable_item_entries(entry_name_or_names)
Array(entry_name_or_names).each do |entry_name|
next if @enabled_entries.include?(entry_name)
next unless @simple_item_entries.key?(entry_name) ||
@list_item_entries.key?(entry_name)
- 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 parse_address
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_address(cell)
if pattern_matched?
@start_address = Integer(captures[0])
@end_address = Integer(captures[1])
@byte_size = @end_address - @start_address + 1
- 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 check_byte_size
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_byte_size
return if required_byte_size == :any_size
return if register.byte_size == required_byte_size_value
error "byte size(#{register.byte_size}) is not matched with " \
"required size(#{required_byte_size_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 loop_variable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def loop_variable(level)
return nil unless array?
return nil if level >= dimensions.size
@loop_variables ||= Hash.new do |h, l|
h[l] = create_identifier("g_#{loop_index(l)}")
- 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"