cppcheck.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:SoCFoundationFlow 作者: mattaw 项目源码 文件源码
def _get_defects(self, xml_string):
        '''evaluate the xml string returned by cppcheck (on sdterr) and use it to create
        a list of defects.
        '''
        defects = []
        for error in ElementTree.fromstring(xml_string).iter('error'):
            defect = {}
            defect['id'] = error.get('id')
            defect['severity'] = error.get('severity')
            defect['msg'] = str(error.get('msg')).replace('<','&lt;')
            defect['verbose'] = error.get('verbose')
            for location in error.findall('location'):
                defect['file'] = location.get('file')
                defect['line'] = str(int(location.get('line')) - 1)
            defects.append(defect)
        return defects
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号