Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/coding_discovery_tools/macos/jetbrains/jetbrains.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import re
import xml.etree.ElementTree as ET
import defusedxml.ElementTree as DefusedET
import zipfile
from pathlib import Path
from typing import Optional, Dict, List, Set, Tuple
Expand Down Expand Up @@ -244,7 +245,7 @@ def _parse_plugin_xml(self, xml_content: str) -> Tuple[Optional[str], Optional[s
try:
# Remove XML namespace declarations for simpler parsing
xml_content_clean = re.sub(r'\sxmlns[^"]*"[^"]*"', '', xml_content)
root = ET.fromstring(xml_content_clean)
root = DefusedET.fromstring(xml_content_clean)

# Try to find <id> tag, can be at root level or nested
id_elem = root.find('.//id')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import os
import xml.etree.ElementTree as ET
import defusedxml.ElementTree as DefusedET
from pathlib import Path
from typing import Optional, Dict, List

Expand Down Expand Up @@ -198,7 +199,7 @@ def _parse_mcp_xml(self, xml_path: Path) -> List[Dict]:
"""Simplified 2025.x MCP XML parser."""
servers = []
try:
tree = ET.parse(xml_path)
tree = DefusedET.parse(xml_path)
for node in tree.findall(".//McpServerConfigurationProperties"):

def get_opt(n, name):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import re
import xml.etree.ElementTree as ET
import defusedxml.ElementTree as DefusedET
import zipfile
from pathlib import Path
from typing import Optional, Dict, List, Set, Tuple
Expand Down Expand Up @@ -322,7 +323,7 @@ def _parse_plugin_xml(self, xml_content: str) -> Tuple[Optional[str], Optional[s
try:
# Remove XML namespace declarations for simpler parsing
xml_content_clean = re.sub(r'\sxmlns[^"]*"[^"]*"', '', xml_content)
root = ET.fromstring(xml_content_clean)
root = DefusedET.fromstring(xml_content_clean)

# Try to find <id> tag, can be at root level or nested
id_elem = root.find('.//id')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import os
import xml.etree.ElementTree as ET
import defusedxml.ElementTree as DefusedET
from pathlib import Path
from typing import Optional, Dict, List

Expand Down Expand Up @@ -284,7 +285,7 @@ def _extract_project_paths_from_xml(self, xml_path: Path) -> set:
paths = set()

try:
tree = ET.parse(xml_path)
tree = DefusedET.parse(xml_path)
root = tree.getroot()

# Various path formats used by JetBrains
Expand Down
Loading