Parent

Roodi::Checks::NpathComplexityMethodCheck

Checks Npath complexity of a method against a specified limit.

Constants

DEFAULT_COMPLEXITY

Public Class Methods

new(options = {}) click to toggle source
# File lib/roodi/checks/npath_complexity_method_check.rb, line 9
def initialize(options = {})
  complexity = options['complexity'] || DEFAULT_COMPLEXITY
  super(complexity)
end

Public Instance Methods

evaluate_end_defn(node) click to toggle source
# File lib/roodi/checks/npath_complexity_method_check.rb, line 23
def evaluate_end_defn(node)
  add_error "Method name \"#{@method_name}\" n-path complexity is #{@current_value}.  It should be #{@complexity} or less." unless @current_value <= @complexity
end
evaluate_start_defn(node) click to toggle source
# File lib/roodi/checks/npath_complexity_method_check.rb, line 18
def evaluate_start_defn(node)
  @method_name = @node[1]
  push_value
end
interesting_nodes() click to toggle source
# File lib/roodi/checks/npath_complexity_method_check.rb, line 14
def interesting_nodes
  [:defn] + COMPLEXITY_NODE_TYPES
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.