MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / isNoReturnScope

Function isNoReturnScope

addons/misra.py:1261–1275  ·  view source on GitHub ↗
(tok)

Source from the content-addressed store, hash-verified

1259
1260
1261def isNoReturnScope(tok):
1262 if tok is None or tok.str != '}':
1263 return False
1264 if tok.previous is None or tok.previous.str != ';':
1265 return False
1266 if simpleMatch(tok.previous.previous, 'break ;'):
1267 return True
1268 prev = tok.previous.previous
1269 while prev and prev.str not in ';{}':
1270 if prev.str in '])':
1271 prev = prev.link
1272 prev = prev.previous
1273 if prev and prev.next.str in ['throw', 'return']:
1274 return True
1275 return False
1276
1277
1278# Return the token which the value is assigned to

Callers 1

misra_16_6Method · 0.85

Calls 1

simpleMatchFunction · 0.70

Tested by

no test coverage detected