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

Method __repr__

addons/misra_9.py:20–37  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18 self.structureViolationToken = None
19
20 def __repr__(self):
21 inits = ""
22 if self.isPositional:
23 inits += 'P'
24 if self.isDesignated:
25 inits += 'D'
26 if not (self.isPositional or self.isDesignated) and self.numInits == 0:
27 inits += '_'
28 if self.numInits > 1:
29 inits += str(self.numInits)
30
31 attrs = ["childIndex", "elementType", "valueType"]
32 return "{}({}, {}, {})".format(
33 "ElementDef",
34 self.getLongName(),
35 inits,
36 ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
37 )
38
39 @property
40 def isArray(self):

Callers

nothing calls this directly

Calls 4

getLongNameMethod · 0.95
strFunction · 0.85
formatMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected