Roodi::Checks::CyclomaticComplexityCheck

Public Class Methods

new(complexity) click to toggle source
# File lib/roodi/checks/cyclomatic_complexity_check.rb, line 8
def initialize(complexity)
  super()
  @complexity = complexity
  @count = 0
  @counting = 0
end

Protected Instance Methods

count_complexity(node) click to toggle source
# File lib/roodi/checks/cyclomatic_complexity_check.rb, line 23
def count_complexity(node)
  count_branches(node) + 1
end
decrease_depth() click to toggle source
# File lib/roodi/checks/cyclomatic_complexity_check.rb, line 32
def decrease_depth
  @counting = @counting - 1
  if @counting <= 0
    @counting = 0
    evaluate_matching_end
  end
end
increase_depth() click to toggle source
# File lib/roodi/checks/cyclomatic_complexity_check.rb, line 27
def increase_depth
  @count = 1 unless counting?
  @counting = @counting + 1
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.