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

Method misra_15_7

addons/misra.py:3276–3289  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

3274 self.reportError(tok1, 15, 6)
3275
3276 def misra_15_7(self, data):
3277 for scope in data.scopes:
3278 if scope.type != 'Else':
3279 continue
3280 if not simpleMatch(scope.bodyStart, '{ if ('):
3281 continue
3282 if scope.bodyStart.column > 0:
3283 continue
3284 tok = scope.bodyStart.next.next.link
3285 if not simpleMatch(tok, ') {'):
3286 continue
3287 tok = tok.next.link
3288 if not simpleMatch(tok, '} else'):
3289 self.reportError(tok, 15, 7)
3290
3291 def misra_16_1(self, cfg):
3292 for scope in cfg.scopes:

Callers

nothing calls this directly

Calls 2

reportErrorMethod · 0.95
simpleMatchFunction · 0.70

Tested by

no test coverage detected