MCPcopy
hub / github.com/qazbnm456/awesome-web-security / make_section_key

Function make_section_key

scripts/migrate.py:248–263  ·  view source on GitHub ↗
(title: str, parent: str | None)

Source from the content-addressed store, hash-verified

246 order = 0
247
248 def make_section_key(title: str, parent: str | None) -> str:
249 # Special cases for unwieldy / ambiguous titles
250 if parent == "browser-exploitation":
251 if title.lower().startswith("frontend"):
252 return "browser-frontend"
253 if title.lower().startswith("backend"):
254 return "browser-backend"
255 base = slugify(title)
256 if parent in ("evasions", "tricks", "pocs", "tools", "practices"):
257 if not base.startswith(parent + "-"):
258 return f"{parent}-{base}"
259 if parent in ("tools-reconnaissance", "tools-offensive"):
260 if base.startswith("tools-"):
261 return base
262 return f"tools-{base}"
263 return base
264
265 for idx, line in enumerate(lines):
266 line_no = idx + 1

Callers 1

parse_readmeFunction · 0.85

Calls 1

slugifyFunction · 0.70

Tested by

no test coverage detected