{
  "source_file": "src/triage/scanner.py",
  "generated_at": "2026-01-10T22:55:11.155230",
  "summary": {
    "purpose": "This file contains functions and classes for scanning and building file metadata schema in a repository, including language detection, file categorization, and heuristic flag computation.",
    "exports": [
      "_matches_any_pattern",
      "_should_ignore",
      "_detect_language",
      "_categorize_directory",
      "_compute_heuristic_flags",
      "_count_lines",
      "FileMetadata",
      "RepositorySchema",
      "HeuristicFlags",
      "DirectoryCategory",
      "TriageResult"
    ],
    "imports": [
      "os",
      "re",
      "datetime",
      "pathlib",
      "typing",
      "collections",
      "fnmatch",
      "schema"
    ],
    "key_components": [
      {
        "name": "_matches_any_pattern",
        "type": "function",
        "description": "Determines if a file name matches any of the provided patterns."
      },
      {
        "name": "_should_ignore",
        "type": "function",
        "description": "Checks if a file path should be ignored based on the provided ignore patterns."
      },
      {
        "name": "_detect_language",
        "type": "function",
        "description": "Detects the programming language of a file based on its extension."
      },
      {
        "name": "_categorize_directory",
        "type": "function",
        "description": "Categorizes a directory based on its path relative to the repository root."
      },
      {
        "name": "_compute_heuristic_flags",
        "type": "function",
        "description": "Computes heuristic flags for a file based on its metadata."
      },
      {
        "name": "_count_lines",
        "type": "function",
        "description": "Counts the number of lines in a file."
      },
      {
        "name": "FileMetadata",
        "type": "class",
        "description": "Represents metadata for a file, including its path, language, and other properties."
      },
      {
        "name": "RepositorySchema",
        "type": "class",
        "description": "Represents the schema for the repository, including file metadata and other properties."
      },
      {
        "name": "HeuristicFlags",
        "type": "class",
        "description": "Represents heuristic flags used for triage."
      },
      {
        "name": "DirectoryCategory",
        "type": "class",
        "description": "Represents the category of a directory."
      },
      {
        "name": "TriageResult",
        "type": "class",
        "description": "Represents the result of a triage operation."
      }
    ],
    "data_structures": "FileMetadata, RepositorySchema, HeuristicFlags, DirectoryCategory, TriageResult",
    "algorithms": "Language detection via extension mapping, heuristic flag computation based on file metadata, directory categorization based on path relative to the repository root",
    "configuration": "Configurable ignore patterns for file paths, reference counting via simple text search for import detection, language detection via extension mapping (extensible)",
    "notes": "The file contains a mapping of file extensions to programming languages, which is used for language detection. The functions handle various aspects of file metadata, including categorization, heuristic flag computation, and line counting. The imports and exports are organized to ensure that the necessary dependencies are available for the operations."
  }
}