(base, target_ext)
| 700 | excluded = {"vendor", "node_modules", ".git", "quality", "repos"} |
| 701 | |
| 702 | def present(base, target_ext): |
| 703 | stack = [(Path(base), 1)] |
| 704 | while stack: |
| 705 | curr, depth = stack.pop() |
| 706 | try: |
| 707 | for entry in os.scandir(curr): |
| 708 | name = entry.name |
| 709 | if entry.is_dir(follow_symlinks=False): |
| 710 | if name in excluded: |
| 711 | continue |
| 712 | if depth < 3: |
| 713 | stack.append((Path(entry.path), depth + 1)) |
| 714 | elif entry.is_file(follow_symlinks=False): |
| 715 | if name.endswith(target_ext): |
| 716 | return True |
| 717 | except (OSError, PermissionError): |
| 718 | continue |
| 719 | return False |
| 720 | |
| 721 | for lang, ext in language_order: |
| 722 | if present(repo_dir, ext): |
no outgoing calls
no test coverage detected