<commit_before># encoding: utf-8

module Rubocop
  module Cop
    # A basic wrapper around Parser's tokens.
    class Token
      attr_reader :pos, :type, :text

      def initialize(pos, type, text)
        @pos, @type, @text = pos, type, text
      end

      def to_s
        "[[#{@pos.line}, #{@pos.column}], #{@type}, #{@text.inspect}]"
      end
    end

    # A scaffold for concrete cops.
    #
    # The Cop class is meant to be extended.
    #
    # Cops track offences and can autocorrect them of the fly.<commit_msg>Add documentation about how to define custom processing in cops<commit_after># encoding: utf-8

module Rubocop
  module Cop
    # A basic wrapper around Parser's tokens.
    class Token
      attr_reader :pos, :type, :text

      def initialize(pos, type, text)
        @pos, @type, @text = pos, type, text
      end

      def to_s
        "[[#{@pos.line}, #{@pos.column}], #{@type}, #{@text.inspect}]"
      end
    end

    # A scaffold for concrete cops.
    #
    # The Cop class is meant to be extended.
    #
    # Cops track offences and can autocorrect them of the fly.
    #
    # A commissioner object is responsible for traversing the AST and invoking
    # the specific callbacks on each cop.
    # If a cop needs to do its own processing of the AST or depends on
    # something else it should define the #investigate method and do
    # the processing there.
    #
    # @example
    #
    # class CustomCop < Cop
    #   def investigate(source_buffer, source, tokens, ast, comments)
    #     # Do custom processing
    #   end
    # end
{'fraction_non_alphanumeric': 0.09487666034155598, 'fraction_numerical': 0.001265022137887413, 'mean_word_length': 2.3659574468085105, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6681413', 'n_tokens_mistral': 490, 'n_tokens_neox': 472, 'n_words': 190}