Fraunhofer-AISEC / cpg

A library to extract Code Property Graphs from C/C++, Java, Go, Python, Ruby and every other language through LLVM-IR.
https://fraunhofer-aisec.github.io/cpg/
Apache License 2.0
288 stars 62 forks source link

LLVM Refactoring and Test coverage #1827

Closed KuechA closed 1 week ago

KuechA commented 2 weeks ago

This PR adds several tests for the LLVM-IR Frontend but also refactors some of the code in the frontend and pass.

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 60.84337% with 65 lines in your changes missing coverage. Please review.

Project coverage is 76.14%. Comparing base (afad877) to head (5f476ce). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt 28.12% 22 Missing and 1 partial :warning:
...de/fraunhofer/aisec/cpg/passes/CompressLLVMPass.kt 58.92% 10 Missing and 13 partials :warning:
...hofer/aisec/cpg/frontends/llvm/StatementHandler.kt 75.64% 16 Missing and 3 partials :warning:
Additional details and impacted files | [Files with missing lines](https://app.codecov.io/gh/Fraunhofer-AISEC/cpg/pull/1827?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fraunhofer-AISEC) | Coverage Δ | | |---|---|---| | [...hofer/aisec/cpg/frontends/llvm/StatementHandler.kt](https://app.codecov.io/gh/Fraunhofer-AISEC/cpg/pull/1827?src=pr&el=tree&filepath=cpg-language-llvm%2Fsrc%2Fmain%2Fkotlin%2Fde%2Ffraunhofer%2Faisec%2Fcpg%2Ffrontends%2Fllvm%2FStatementHandler.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fraunhofer-AISEC#diff-Y3BnLWxhbmd1YWdlLWxsdm0vc3JjL21haW4va290bGluL2RlL2ZyYXVuaG9mZXIvYWlzZWMvY3BnL2Zyb250ZW5kcy9sbHZtL1N0YXRlbWVudEhhbmRsZXIua3Q=) | `84.65% <75.64%> (+21.65%)` | :arrow_up: | | [...ofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt](https://app.codecov.io/gh/Fraunhofer-AISEC/cpg/pull/1827?src=pr&el=tree&filepath=cpg-language-llvm%2Fsrc%2Fmain%2Fkotlin%2Fde%2Ffraunhofer%2Faisec%2Fcpg%2Ffrontends%2Fllvm%2FExpressionHandler.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fraunhofer-AISEC#diff-Y3BnLWxhbmd1YWdlLWxsdm0vc3JjL21haW4va290bGluL2RlL2ZyYXVuaG9mZXIvYWlzZWMvY3BnL2Zyb250ZW5kcy9sbHZtL0V4cHJlc3Npb25IYW5kbGVyLmt0) | `74.37% <28.12%> (+13.21%)` | :arrow_up: | | [...de/fraunhofer/aisec/cpg/passes/CompressLLVMPass.kt](https://app.codecov.io/gh/Fraunhofer-AISEC/cpg/pull/1827?src=pr&el=tree&filepath=cpg-language-llvm%2Fsrc%2Fmain%2Fkotlin%2Fde%2Ffraunhofer%2Faisec%2Fcpg%2Fpasses%2FCompressLLVMPass.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fraunhofer-AISEC#diff-Y3BnLWxhbmd1YWdlLWxsdm0vc3JjL21haW4va290bGluL2RlL2ZyYXVuaG9mZXIvYWlzZWMvY3BnL3Bhc3Nlcy9Db21wcmVzc0xMVk1QYXNzLmt0) | `76.28% <58.92%> (+10.54%)` | :arrow_up: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/Fraunhofer-AISEC/cpg/pull/1827/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fraunhofer-AISEC)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: