MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / _bracket_delta

Function _bracket_delta

scripts/code-verify.py:217–222  ·  view source on GitHub ↗

Signed open/close bracket count, ignoring strings and line comments.

(line: str)

Source from the content-addressed store, hash-verified

215
216
217def _bracket_delta(line: str) -> int:
218 """Signed open/close bracket count, ignoring strings and line comments."""
219 sanitized = _strip_strings_and_comments(line)
220 opens = sanitized.count("(") + sanitized.count("[") + sanitized.count("{")
221 closes = sanitized.count(")") + sanitized.count("]") + sanitized.count("}")
222 return opens - closes
223
224
225def _brace_delta_raw(line: str) -> int:

Callers 2

tokenizeFunction · 0.85

Calls 2

countMethod · 0.45

Tested by

no test coverage detected