class Doxyparser::Function

Public Instance Methods

afferent(all = nil) click to toggle source
# File lib/entruby.rb, line 46
def afferent(all = nil)
  all.to_a.empty? ? referenced_by : referenced_by.map { |ref| ref.reveal(all) }.compact
end
coupling_metric(all = nil) click to toggle source
# File lib/entruby.rb, line 58
def coupling_metric(all = nil)
  fan_out = fan_out(all).to_f
  fan_in = fan_in(all).to_f
  denominator = fan_out + fan_in
  denominator == 0 ? 0 : fan_out / (denominator)
end
efferent(all = nil) click to toggle source
# File lib/entruby.rb, line 42
def efferent(all = nil)
  all.to_a.empty? ? references : references.map { |ref| ref.reveal(all) }.compact
end
fan_in(all = nil) click to toggle source
# File lib/entruby.rb, line 54
def fan_in(all = nil)
  afferent(all).size
end
fan_out(all = nil) click to toggle source
# File lib/entruby.rb, line 50
def fan_out(all = nil)
  efferent(all).size
end
global_name() click to toggle source
# File lib/entruby.rb, line 65
def global_name
  "global::#{signature}"
end
referenced_by() click to toggle source
# File lib/entruby.rb, line 38
def referenced_by
  node.css('referencedby').map { |ref| Reference.new(ref) }
end
references() click to toggle source

@return Array

# File lib/entruby.rb, line 34
def references
  node.css('references').map { |ref| Reference.new(ref) }
end
report(all) click to toggle source

@return Report

# File lib/entruby.rb, line 78
def report(all)
  {id: id, name: basename, signature: signature, location: location, metric: coupling_metric(all), col: col,
   params: valid_params.map(&:as_json),
   imports: efferent(all).map(&:signature)}
end
signature() click to toggle source
# File lib/entruby.rb, line 73
def signature
  "#{basename}(#{valid_params.map { |p| p.type.name }.join(', ')})"
end
valid_params() click to toggle source
# File lib/entruby.rb, line 69
def valid_params
  params.reject { |p| p.type.name == 'void' }
end