Class: ComplexityAnalyzers::Ruby

Inherits:
Object
  • Object
show all
Defined in:
lib/complexity_analyzers/ruby.rb

Overview

This class uses Flog <github.com/seattlerb/flog> to check the complexity of a Ruby file.

Instance Method Summary collapse

Instance Method Details

#analyze(file) ⇒ Object



8
9
10
11
12
# File 'lib/complexity_analyzers/ruby.rb', line 8

def analyze(file)
  flog.reset
  flog.flog(file)
  flog.total_score
end

#flogObject



14
15
16
# File 'lib/complexity_analyzers/ruby.rb', line 14

def flog
  @flog ||= Flog.new
end