Commit Graph

20 Commits

Author SHA1 Message Date
amai2012 2fa837c716
threadsafety shall not warn about const vars (in C++11) (#2847)
threadsafety shall not warn about const vars (in C++11) 
For C++03 a new id threadsafety-const was created.
2020-10-23 11:58:25 +02:00
Daniel Marjamäki c6d2e0fae1 Fixed #9830 (Addons should return 0 when success) 2020-08-29 07:44:32 +02:00
Daniel Marjamäki 33c8b71467 Revert "addons; import cppcheckdata from local folder"
This reverts commit 05b96d42e9.
2019-12-30 17:30:17 +01:00
Daniel Marjamäki 05b96d42e9 addons; import cppcheckdata from local folder 2019-12-30 09:13:04 +01:00
Georgy Komarov d977761e76 addons: Reduce memory consumption (#2395)
* addons: Reduce memory consumption

Parse dump files incrementaly using ElementTree.iterparse. Clean unused
resources during parsing.  This method is explained in following
article: https://www.ibm.com/developerworks/xml/library/x-hiperfparse/

Memory consumption was reduced about 30% (measured with mprof),
execution time increased about 5% (measured with time utility).
More description available in PR.

* Switch to lxml and update iterparse routines

Use lxml module instead default xml.etree. Lxml provides convenient
wrappers around iterparse method that accepts `tag` argument. That
easer incremental parsing routines to select specific tags from roottree
like `dump` and `dumps`.

Element.clear() method was replaced by `lxml_clean` because lxml
keeps additional information to nodes that should be removed.

Added note about large consumption RAM on large dump files.
This commit doesn't solve this problem completely, but provides a way
to improve current parser to add incremental Configuration serialization
later.

* Working on iterative parser

* Added iterative Configurations parser

* fix

* Fix varlist iteration

* make sure that standards node was loaded
2019-12-27 08:50:56 +01:00
Sebastian 8a32a210f8
addons: Change shebang to use Python 3 instead of Python 2 (#2361)
Use Python 3 instead of Python 2 if addons are executed directly.
Running cert.py and misra.py against test/cfg/std.c.dump shows that
Python 3 needs only half the time compared to Python 2. I have tested
it repeatedly and the results are always the same. This is no surprise
at all. The memory footprint is very likely also significantly better
but i have not tested it.
2019-11-15 21:38:20 +01:00
Daniel Marjamäki 97157046f7 addons: /reportErrorCli/reportError/ 2019-04-14 08:54:53 +02:00
Daniel Marjamäki 7b6d7b9335 threadsafety.py: allow execution with --addon 2019-04-10 21:06:40 +02:00
Daniel Marjamäki f2889d5c82 Try to unify addon output 2019-04-09 20:36:24 +02:00
Matthias Krüger 4c8bb9ac6f fix a few typos 2018-05-14 13:11:59 +02:00
amai ed25e21929 Set executable bit for addons/ python scripts 2018-03-20 20:54:59 +01:00
Daniel Marjamäki b8d0da31de threadsafety.py: warn for local static non-class variables also 2018-03-14 11:55:01 +01:00
Daniel Marjamäki 2ca46ceae9 threadsafety.py: reformat output 2017-08-15 21:44:21 +02:00
Ayaz Salikhov 2dd6168258 Improve Python code 2017-06-04 22:51:48 +02:00
Matthias Krüger 8f84f139d7 addons: threadsafety: print name of local static object in message. 2016-01-12 20:31:18 +01:00
Albert ARIBAUD (3ADEV) e7fdb1c825 Fix multiple config dumps
With multiple configurations, option --dump only dumps
the last configuration.

Fix it to dump every configuration.

Also update all Python addons so that they can handle
multiple-configuration dumps.

Additionally run autopep8 on addons/*.py.

The results of 'make test' before and after applying
this commit are identical.
2015-12-14 18:20:35 +01:00
XhmikosR 7d0075357e PEP8 fixes.
[ci skip]
2015-08-21 11:59:52 +03:00
Daniel Marjamäki abbe11f3b7 Addons: Added cert.py 2015-08-18 16:14:53 +02:00
Daniel Marjamäki 1df0204bbe addons: Use bool instead of string for cppcheckdata properties is... 2015-06-21 09:54:07 +02:00
Daniel Marjamäki 94e2018904 addons/threadsafety.py: Add simple addon that analyses threadsafety. 2015-06-20 22:06:22 +02:00