Skip to content

[ AngularJS ] CodeQL for JS -- All classes seem to be based on angular.module calls but references to the returned instance are ignored #19188

Answered by Napalys
testgita asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @testgita

I have tried your example and yes, indeed only direct references were captured. The CodeQL library for JavaScript has limitations when analyzing the global scope because JavaScript's global context can be unpredictable. In global contexts, variables and references can be loosely defined, making it harder for CodeQL's analysis engine to capture them accurately. The global scope is shared between all the files, which makes the analysis of global variables extremely challenging.

By placing your code within a function scope, you define a more predictable, structured environment, which allows CodeQL to track variables and references more effectively. You can try this modified v…

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@testgita
Comment options

@testgita
Comment options

Answer selected by testgita
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants