Load all index files from specified directory
(indexes_directory: str)
| 63 | |
| 64 | |
| 65 | def load_index_files_from_directory(indexes_directory: str) -> Dict[str, Dict]: |
| 66 | """Load all index files from specified directory""" |
| 67 | indexes_path = Path(indexes_directory).resolve() |
| 68 | |
| 69 | if not indexes_path.exists(): |
| 70 | logger.warning(f"Indexes directory does not exist: {indexes_path}") |
| 71 | return {} |
| 72 | |
| 73 | index_cache = {} |
| 74 | |
| 75 | for index_file in indexes_path.glob("*.json"): |
| 76 | try: |
| 77 | with open(index_file, "r", encoding="utf-8") as f: |
| 78 | index_data = json.load(f) |
| 79 | index_cache[index_file.stem] = index_data |
| 80 | logger.info(f"Loaded index file: {index_file.name}") |
| 81 | except Exception as e: |
| 82 | logger.error(f"Failed to load index file {index_file.name}: {e}") |
| 83 | |
| 84 | logger.info(f"Loaded {len(index_cache)} index files from {indexes_path}") |
| 85 | return index_cache |
| 86 | |
| 87 | |
| 88 | def extract_code_references(index_data: Dict) -> List[CodeReference]: |
no outgoing calls
no test coverage detected