Class: RuboCop::Cop::SketchupPerformance::OperationDisableUI
- Inherits:
-
SketchUp::Cop
- Object
- SketchUp::WorkaroundCop
- SketchUp::Cop
- RuboCop::Cop::SketchupPerformance::OperationDisableUI
- Defined in:
- lib/rubocop/sketchup/cop/performance/operation_disable_ui.rb
Overview
Operations should disable the UI for performance gain.
Constant Summary collapse
- MSG =
'Operations should disable the UI for performance gain.'
Constants inherited from SketchUp::Cop
SketchUp::Cop::SKETCHUP_DEPARTMENT_SEVERITY
Constants included from SketchUp::Config
SketchUp::Config::DEFAULT_CONFIGURATION
Instance Method Summary collapse
Methods inherited from SketchUp::Cop
Instance Method Details
#on_send(node) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rubocop/sketchup/cop/performance/operation_disable_ui.rb', line 16 def on_send(node) _, method_name, *args = *node return unless method_name == :start_operation if args.size < 2 add_offense(node, location: :selector) return end argument = args[1] disable_ui = argument.truthy_literal? return if disable_ui add_offense(argument, location: :expression) end |