Class: Cane::AbcCheck

Inherits:
Struct
  • Object
show all
Defined in:
lib/cane/abc_check.rb

Overview

Creates violations for methods that are too complicated using a simple algorithm run against the parse tree of a file to count assignments, branches, and conditionals. Borrows heavily from metric_abc.

Defined Under Namespace

Classes: InvalidAst, RubyAst

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optsObject

Returns the value of attribute opts

Returns:

  • (Object)

    the current value of opts



11
12
13
# File 'lib/cane/abc_check.rb', line 11

def opts
  @opts
end

Instance Method Details

#violationsObject



12
13
14
15
16
# File 'lib/cane/abc_check.rb', line 12

def violations
  order file_names.map { |file_name|
    find_violations(file_name)
  }.flatten
end