Class: Bulletproof::Analyzer
- Inherits:
-
Object
- Object
- Bulletproof::Analyzer
- Defined in:
- lib/bulletproof/analyzer.rb
Instance Method Summary collapse
- #call(path) ⇒ Report
-
#initialize(config = Bulletproof.config) ⇒ Analyzer
constructor
A new instance of Analyzer.
Constructor Details
#initialize(config = Bulletproof.config) ⇒ Analyzer
Returns a new instance of Analyzer.
5 6 7 8 9 10 |
# File 'lib/bulletproof/analyzer.rb', line 5 def initialize(config = Bulletproof.config) @config = config @detectors = [ Detectors::ExcessiveIncludesDetector.new(config) ] end |
Instance Method Details
#call(path) ⇒ Report
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bulletproof/analyzer.rb', line 14 def call(path) report = Report.new ruby_files(path).each do |file| source = File.read(file) @detectors.each do |detector| detector.call(source, file: file).each { |v| report.add_violation(v) } end end report end |