# File lib/brakeman/processors/controller_processor.rb, line 29
  def process_class exp
    name = class_name(exp.class_name)
    parent = class_name(exp.parent_name)

    #If inside a real controller, treat any other classes as libraries.
    #But if not inside a controller already, then the class may include
    #a real controller, so we can't take this shortcut.
    if @current_class and @current_class.name.to_s.end_with? "Controller"
      Brakeman.debug "[Notice] Treating inner class as library: #{name}"
      Brakeman::LibraryProcessor.new(@tracker).process_library exp, @file_name
      return exp
    end

    if not name.to_s.end_with? "Controller"
      Brakeman.debug "[Notice] Adding noncontroller as library: #{name}"
      #Set the class to be a module in order to get the right namespacing.
      #Add class to libraries, in case it is needed later (e.g. it's used
      #as a parent class for a controller.)
      #However, still want to process it in this class, so have to set
      #@current_class to this not-really-a-controller thing.
      process_module exp, parent

      return exp
    end

    handle_class(exp, @tracker.controllers, Brakeman::Controller) do
      set_layout_name
    end

    exp
  end