Since `runtimeExprInStaticInitializer` only looks at expressions at the top level of an initializer or directly below some number of top-level aggregate literals, there is no need for `inStaticInitializer` to include expressions strictly below those in the AST. I tested this on Wireshark, which has very large static initializers, but found no measureable difference in run time. There are some differences in tuple counts and iteration counts, though: - `inStaticInitializer` changes from 6,241,153 rows (86 iterations) to 5,031,617 rows (7 iterations). - `runtimeExprInStaticInitializer` changes from 386,350 rows to 4,705 rows. - `hasDynamicInitialization` has 410 rows both before and after, which suggests that this change does not affect results. Even though there is no impact on this snapshot at this time, things might look different if/when the restriction on aggregate literals to 100 children is removed in the extractor.
CodeQL
This open source repository contains the standard CodeQL libraries and queries that power LGTM and the other CodeQL products that GitHub makes available to its customers worldwide.
How do I learn CodeQL and run queries?
There is extensive documentation on getting started with writing CodeQL. You can use the interactive query console on LGTM.com or the CodeQL for Visual Studio Code extension to try out your queries on any open source project that's currently being analyzed.
Contributing
We welcome contributions to our standard library and standard checks. Do you have an idea for a new check, or how to improve an existing query? Then please go ahead and open a pull request! Before you do, though, please take the time to read our contributing guidelines. You can also consult our style guides to learn how to format your code for consistency and clarity, how to write query metadata, and how to write query help documentation for your query.
License
The code in this repository is licensed under Apache License 2.0 by GitHub.