IntelLabs / control-flag

A system to flag anomalous source code expressions by learning typical expressions from training data
MIT License
1.24k stars 112 forks source link

[FEATURE]Support for the Cpp programming language #24

Open jiangwei007 opened 2 years ago

jiangwei007 commented 2 years ago

When I use ControlFlag to scan Unreal Engine, ControlFlag scans only .h && .c c-style files and does not scan any *.cpp files

Expect ControlFlag to support C Plus Plus Mine and scan

Or, what can I do to support CPP

jgottschlich commented 2 years ago

Hi @jiangwei007 - right now the parser is setup to only scan .h and .c files, however, you can modify that to include .cpp files. @nhasabni - can you point @jiangwei007 to the modification point in the script?

The reason why we don't add .cpp files by default is because we haven't yet added C++-specific learning to the system. However, you may still be able to find issues in your code in C++ due to C++ being somewhat of a superset of C. That said, once we've added proper C++ learning, we anticipate the results may be much better.

Best, The ControlFlag Team

nhasabni commented 2 years ago

hi @jiangwei007,

Thanks for interest in ControlFlag. Place to add those extensions would be in the scanning and mining scripts.

That being said, we are working on completing C++ support, by generating C++-specific training data. We plan to upstream the changes soon.