Class: Klee::FileAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/klee/file_analyzer.rb

Constant Summary collapse

ATTR_METHODS =
%i[attr attr_reader attr_writer attr_accessor].freeze
INDEX_OPERATORS =
Set[:[], :[]=].freeze
OPERATORS =
Set.new(
  %i[! != !~ + +@ - -@ * / % ** << >> & | ^ ~ <=> > >= < <= == === =~] +
  INDEX_OPERATORS.to_a
).freeze
CHAIN_NOISE =
%w[
  to_s to_str to_i to_int to_a to_ary to_h to_hash to_f to_sym to_proc
  intern itself dup clone freeze tap new
  where includes joins order limit offset eager_load preload
  unscope merge distinct group having lock reselect reorder
  first last take count map select collect compact flatten uniq
  sort sort_by reverse each
  Hash Array Set Rails Data Logger Kernel Object
].to_set.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FileAnalyzer

Returns a new instance of FileAnalyzer.



25
26
27
28
29
30
31
32
# File 'lib/klee/file_analyzer.rb', line 25

def initialize(path)
  @path = path
  @class_names = []
  @method_names = []
  @collaborators = []
  @method_collaborators = Hash.new { |h, k| h[k] = [] }
  parse
end

Instance Attribute Details

#class_names ⇒ Object (readonly)

Returns the value of attribute class_names.



23
24
25
# File 'lib/klee/file_analyzer.rb', line 23

def class_names
  @class_names
end

#collaborators ⇒ Object (readonly)

Returns the value of attribute collaborators.



23
24
25
# File 'lib/klee/file_analyzer.rb', line 23

def collaborators
  @collaborators
end

#method_collaborators ⇒ Object (readonly)

Returns the value of attribute method_collaborators.



23
24
25
# File 'lib/klee/file_analyzer.rb', line 23

def method_collaborators
  @method_collaborators
end

#method_names ⇒ Object (readonly)

Returns the value of attribute method_names.



23
24
25
# File 'lib/klee/file_analyzer.rb', line 23

def method_names
  @method_names
end

#path ⇒ Object (readonly)

Returns the value of attribute path.



23
24
25
# File 'lib/klee/file_analyzer.rb', line 23

def path
  @path
end