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

Function getAssignedVariableToken

addons/misra.py:1279–1287  ·  view source on GitHub ↗
(vartok)

Source from the content-addressed store, hash-verified

1277
1278# Return the token which the value is assigned to
1279def getAssignedVariableToken(vartok):
1280 if not vartok:
1281 return None
1282 parent = vartok.astParent
1283 while parent and parent.isArithmeticalOp:
1284 parent = parent.astParent
1285 if parent and parent.isAssignmentOp:
1286 return parent.astOperand1
1287 return None
1288
1289# If the value is used as a return value, return the function definition
1290def getFunctionUsingReturnValue(valueToken):

Callers 1

misra_7_4Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected