mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
JS: classify the ApplicationInsights library instance
This commit is contained in:
@@ -816,6 +816,33 @@ private class RequireJS extends FrameworkLibraryWithGenericURL, FrameworkLibrary
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A copy of the Microsoft ApplicationInsights framework.
|
||||
*/
|
||||
private class ApplicationInsightsInstance extends FrameworkLibraryInstance {
|
||||
string version;
|
||||
|
||||
ApplicationInsightsInstance() {
|
||||
version = this.(TopLevel).getFile().getAbsolutePath().regexpCapture(any(ApplicationInsights t).getAURLRegex(), 1)
|
||||
}
|
||||
|
||||
override predicate info(FrameworkLibrary fl, string v) {
|
||||
fl instanceof ApplicationInsights and
|
||||
version = v
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Microsoft ApplicationInsights framework.
|
||||
*/
|
||||
private class ApplicationInsights extends FrameworkLibraryWithURLRegex {
|
||||
ApplicationInsights() { this = "ApplicationInsights" }
|
||||
|
||||
override string getAURLRegex() {
|
||||
result = ".*(?:^|/)ai\\.(" + semverRegex() + ")-build\\d+\\.js"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A `FrameworkLibraryReference` that refers to a recognised `FrameworkLibraryInstance`,
|
||||
* that is, a `<script>` tag where the `src` attribute can be resolved to a local file
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
| ai.1.2.3-build0123.js:0:0:0:0 | ai.1.2.3-build0123.js | library |
|
||||
| bundle-directive.js:0:0:0:0 | bundle-directive.js | generated |
|
||||
| jison-lex.js:0:0:0:0 | jison-lex.js | generated |
|
||||
| jison.js:0:0:0:0 | jison.js | generated |
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user