Class: RuboCop::Cop::SketchupSuggestions::ToolbarTimer
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::SketchupSuggestions::ToolbarTimer
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/sketchup/cop/suggestions/toolbar_timer.rb
Overview
Wrapping ‘toolbar.restore` in `UI.start_timer` is redundant. It was a workaround for an issue in a very old version of SketchUp. There is no need to still be using this workaround.
Constant Summary collapse
- MSG =
'Wrapping `toolbar.restore` in `UI.start_timer` is '\ 'redundant.'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/rubocop/sketchup/cop/suggestions/toolbar_timer.rb', line 45 def on_send(node) return unless (node) return unless node.parent.assignment? assignment_node = node.parent = assignment_node.children.first receiver = ui_start_timer_restore(assignment_node.parent).first return unless receiver&.variable? receiver_variable_name = receiver.children.first return unless receiver_variable_name == add_offense(receiver.parent) end |