Class: ComplexityAnalyser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#functionsObject

Returns the value of attribute functions.



5
6
7
# File 'lib/complexity_analyser.rb', line 5

def functions
  @functions
end

Instance Method Details

#parse(code) ⇒ Object



7
8
9
10
11
# File 'lib/complexity_analyser.rb', line 7

def parse code
  @functions = []
  @js_lint = JSLint.new code
  parse_multiple_expressions @js_lint.tree
end