Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge stats-logging to master #28

Merged
merged 86 commits into from
Jun 18, 2024
Merged

Merge stats-logging to master #28

merged 86 commits into from
Jun 18, 2024

Conversation

karan-batavia
Copy link

@karan-batavia karan-batavia commented Jun 18, 2024

This PR adds logs to capture various performance metrics in the frontend.

xavierpinho and others added 24 commits June 18, 2024 14:39
…ent (joernio#4559)

* [dataflowengineoss] globalFromLit trigger only when it's a standalone assignment

* fix unit-tests
* Add MethodRefeferenceExpr to javasrc asts

* Fix identifier as MethodReferenceExpr scope

* Fix formatting
* [javasrc]: keep maven dep fetching running after failure

There's also a --fail-at-end. But in my cursory testing, it still skips
over future steps after a failure, so --fail-never it is.

* add failure logging again
`configurations.default` can not be resolved by default.
The previous hack with `.setCanBeResolved(true)` will be deprecated with Gradle 9 and finally removed / disabled in future releases (same for `implementation`). The proper way to do this is by re-using a resolvable configuration (resolvable by default) in the `from` clause of the task.

More info: https://docs.gradle.org/current/userguide/declaring_dependencies.html#sec:resolvable-consumable-configs and https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_configurations_graph
Creating import nodes for `require_all`, `require_relative`, and `load` calls. `require_all` is interpreted as a wildcard import as it imports a whole directory.

Additionally, handling the `require_relative` and `require_all` correctly as per their semantics with accompanying tests.
* [kotlin] fix types for custom annotations

 * populates types where local imports are used for annotations
 * add tests for java as well as kotlin to demonstrate parity

---------

Co-authored-by: Max Leuthäuser <[email protected]>
Added a test that tests type flow to a method return which is inherited by another class and should then be propagated to the assigned identifier.

So far this test only fixes the bug where calls to the method return were discovered and resolved but not persisted. Additionally, made sure operator calls were not loaded into the symbol table.

Next steps: Investigate call resolution for superclass methods
A specific kind of lambda expression assigned to a function with a lambda block argument produces a "named function" under the initial lambda expression which is technically not true.

However, this leads to an issue where an assumption of only one AST in the lambda expression is returned when this is false as the second is the method declaration. The method declaration also has its <anonymous> tag escaped, leading to some weird full names.

This change:
* No longer escapes <anonymous> in the case where <anonymous> is the "name" of the "named function"
* Processes idx > 0 ASTs from a lambda body as other lambdas. Added warning if expectation is not true.
The parser rule that handles the conditional component in a conditional expression never expected an exclamation mark (negation). This change swaps out the old rule with one that does expect a "negatable" expression.

Resolves joernio#4518
…io#4576)

* [dataflowengineoss] handle python imports in globalFromLiteral

* Update dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/package.scala

name -> nameExact

Co-authored-by: David Baker Effendi <[email protected]>

---------

Co-authored-by: David Baker Effendi <[email protected]>
…rnio#4579)

The current AST of the try except does not keep the `except` bodies as `order=2` and pass empty block nodes for `finally` and `else` bodies if they are not there.

This change keeps the `except` bodies as `order=2` and groups the `finally` and `else` bodies under a single body, while discarding empty blocks if they are unimplemented.

Partially addresses joernio#4578, as the node is unfortunately still dangling. This could also be because `file` is a built-in function call and is re-assigned in `a9_lab` from the initial assignment under the parent `<module>`.

One note is that setting the source to `cpg.parameter.nameExact("request").l` does not work, and it may be due to the excessive AST depth under the assignment to `file`.
…oernio#4582)

* [dataflowengineoss] DdgGenerator using original globalFromLiteral's implementation

* simplify some tests
The [`facter`](https://github.com/puppetlabs/facter) repository causes this frontend to throw a lot of warnings. This PR fixes much of the low-hanging fruit, and improves the warning techniques to help make the warnings more meaningful. There are still, however, quite a few syntax errors to handle from this repository.

* Handles regexes generated from string formating.
* Handled the `!~` regex not match function. Long term any unrecognized functions are interpreted as calls.
* Added more cases for implicit returns
* [ruby] Fixed syntax and unhandled structure errors on logger repo

* [ruby] commented out other control structures for regex handling until testing at a later stage

* [ruby] added control structures for regex
* upgrade deps

* upgrade cpg and adapt (inverse builder api is gone)
Handles propagating types via chained call patterns, as well as `$this->` calls where the method being invoked is inherited.

Follows up from joernio#4569
Copy link
Member

@pandurangpatil pandurangpatil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karan-batavia wait for the comparison report to be generated. If it is all green we are good to go ahead and merge this one.

@karan-batavia karan-batavia merged commit cece5ea into master Jun 18, 2024
15 checks passed
@pandurangpatil pandurangpatil deleted the stats-logging branch September 19, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.