Class: FiberAudit::Static::Rules::IOSelect

Inherits:
Base
  • Object
show all
Defined in:
lib/fiber_audit/static/rules/io_select.rb

Overview

FA1005: Detects explicit IO.select calls that may bypass scheduler-aware I/O and block the scheduler thread.

Constant Summary collapse

TITLE =
'Explicit IO.select call'
CATEGORY =
:blocking_io
MESSAGE =
'IO.select may bypass scheduler-aware I/O and block the thread running the fiber scheduler.'
REMEDIATION =
'Use scheduler-aware I/O APIs or allow the active Fiber scheduler to manage readiness.'
TARGETS =
OperationVocabulary::FA1005_TARGETS

Constants inherited from Base

Base::CONTEXT_CEILING

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

confidence, default_confidence, default_severity, description, id, #initialize, severity

Constructor Details

This class inherits a constructor from FiberAudit::Static::Rules::Base

Class Method Details

.categoryObject



30
# File 'lib/fiber_audit/static/rules/io_select.rb', line 30

def category = CATEGORY

.titleObject



29
# File 'lib/fiber_audit/static/rules/io_select.rb', line 29

def title = TITLE

Instance Method Details

#analyze(call_sites:) ⇒ Object



33
34
35
# File 'lib/fiber_audit/static/rules/io_select.rb', line 33

def analyze(call_sites:)
  call_sites.filter_map { |site| match(site) }
end