From 2730b16326e6bfc1683885fbac9f7ab74623ea14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 28 Oct 2018 20:47:44 +0100 Subject: [PATCH] cppcheckdata.py: read more data from dumps --- addons/cppcheckdata.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/addons/cppcheckdata.py b/addons/cppcheckdata.py index 87d168e0b..133b82d14 100755 --- a/addons/cppcheckdata.py +++ b/addons/cppcheckdata.py @@ -445,23 +445,45 @@ class ValueFlow: Value class Attributes: - intvalue integer value - tokvalue token value - condition condition where this Value comes from + intvalue integer value + tokvalue token value + floatvalue float value + containerSize container size + condition condition where this Value comes from + valueKind 'known' or 'possible' + inconclusive Is value inconclusive? """ intvalue = None tokvalue = None + floatvalue = None + containerSize = None condition = None + valueKind = None + inconclusive = False + + def isKnown(self): + return self.valueKind and self.valueKind == 'known' + + def isPossible(self): + return self.valueKind and self.valueKind == 'possible' def __init__(self, element): self.intvalue = element.get('intvalue') if self.intvalue: self.intvalue = int(self.intvalue) self.tokvalue = element.get('tokvalue') + self.floatvalue = element.get('floatvalue') + self.containerSize = element.get('container-size') self.condition = element.get('condition-line') if self.condition: self.condition = int(self.condition) + if element.get('known'): + valueKind = 'known' + elif element.get('possible'): + valueKind = 'possible' + if element.get('inconclusive'): + inconclusive = 'known' def __init__(self, element): self.Id = element.get('id')