Showing 65 of 117 total issues
Method applied_font_format_value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def applied_font_format_value(text_index = nil, font_option)
text_index ||= @tk.index('insert')
region_start = text_index
region_end = @tk.index("#{text_index} + 1 chars")
tag_names = applied_font_format_tags_and_regions(region_start, region_end).map(&:first)
- 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 center_within_screen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def center_within_screen
monitor_width, monitor_height = wm_maxsize
update :idletasks
current_width = width
current_height = height
- 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 image_argument
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def image_argument(args)
if args.first.is_a?(::TkPhotoImage)
args.first
else
image_args = {}
- 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 make_droppable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_droppable
self.on_drop_block = Proc.new do |event|
event.target.text = event.data if event.target.has_attribute?('text')
event.target.items += [event.data] if event.target.has_attribute?('items')
event.target.selection += [event.data] if event.target.has_attribute?('selection')
- 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 variable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def variable(auto_create: true)
if @variable.nil? && auto_create
sibling_variable = sibling_radio_menu_items.map {|mi| mi.variable(auto_create: false)}.compact.first
@variable = sibling_variable.nil? ? ::TkVariable.new : sibling_variable
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"