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

Function getForLoopExpressions

addons/misra.py:857–869  ·  view source on GitHub ↗
(forToken)

Source from the content-addressed store, hash-verified

855
856
857def getForLoopExpressions(forToken):
858 if not forToken or forToken.str != 'for':
859 return None
860 lpar = forToken.next
861 if not lpar or lpar.str != '(':
862 return None
863 if not lpar.astOperand2 or lpar.astOperand2.str != ';':
864 return None
865 if not lpar.astOperand2.astOperand2 or lpar.astOperand2.astOperand2.str != ';':
866 return None
867 return [lpar.astOperand2.astOperand1,
868 lpar.astOperand2.astOperand2.astOperand1,
869 lpar.astOperand2.astOperand2.astOperand2]
870
871
872def get_function_scope(cfg, func):

Callers 2

misra_14_1Method · 0.85
misra_14_2Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected