Class: RuboCop::Cop::SketchupPerformance::OpenSSL

Inherits:
SketchUp::Cop show all
Defined in:
lib/rubocop/sketchup/cop/performance/openssl.rb

Overview

There are performance issue with the OpenSSL library that Ruby ship. In a clean SU session, default model there is a small delay observed in the Windows version of SU.

But with a larger model loaded, or session that have had larger files loaded the lag will be minutes.

‘SecureRandom` is also affected by this, as it uses OpenSSL to seed.

It also affects ‘Net::HTTP` if making HTTPS connections.

Constant Summary collapse

MSG =
'Avoid use of OpenSSL within SketchUp due to severe performance '\
'issues.'
OPEN_SSL_USAGE =
%w[openssl securerandom net/https net/http].freeze

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

inherited, #relevant_file?

Instance Method Details

#on_send(node) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/rubocop/sketchup/cop/performance/openssl.rb', line 31

def on_send(node)
  filename = require(node)
  return if filename.nil?
  return unless OPEN_SSL_USAGE.include?(filename.downcase)

  add_offense(node, location: :expression)
end