File tree Expand file tree Collapse file tree 2 files changed +20
-17
lines changed Expand file tree Collapse file tree 2 files changed +20
-17
lines changed Original file line number Diff line number Diff line change 2
2
* Helpers to generating meta metrics, that is, metrics about the CodeQL analysis and extractor.
3
3
*/
4
4
private import javascript
5
+ private import semmle.javascript.dependencies.Dependencies
6
+ private import semmle.javascript.dependencies.FrameworkLibraries
7
+ private import semmle.javascript.frameworks.Testing
5
8
6
9
/**
7
10
* Gets the root folder of the snapshot.
8
11
*
9
12
* This is selected as the location for project-wide metrics.
10
13
*/
11
14
Folder projectRoot ( ) { result .getRelativePath ( ) = "" }
15
+
16
+ /** A file we ignore because it is a test file or compiled/generated/bundled code. */
17
+ class IgnoredFile extends File {
18
+ IgnoredFile ( ) {
19
+ any ( Test t ) .getFile ( ) = this
20
+ or
21
+ getRelativePath ( ) .regexpMatch ( "(?i).*/test(case)?s?/.*" )
22
+ or
23
+ getBaseName ( ) .regexpMatch ( "(?i)(.*[._\\-]|^)(min|bundle|concat|spec|tests?)\\.[a-zA-Z]+" )
24
+ or
25
+ exists ( TopLevel tl | tl .getFile ( ) = this |
26
+ tl .isExterns ( )
27
+ or
28
+ tl instanceof FrameworkLibraryInstance
29
+ )
30
+ }
31
+ }
Original file line number Diff line number Diff line change @@ -12,23 +12,6 @@ private import DataFlow
12
12
13
13
import meta.MetaMetrics
14
14
15
- /** A file we ignore because it is a test file or compiled/generated/bundled code. */
16
- class IgnoredFile extends File {
17
- IgnoredFile ( ) {
18
- any ( Test t ) .getFile ( ) = this
19
- or
20
- getRelativePath ( ) .regexpMatch ( "(?i).*/test(case)?s?/.*" )
21
- or
22
- getBaseName ( ) .regexpMatch ( "(?i)(.*[._\\-]|^)(min|bundle|concat|spec|tests?)\\.[a-zA-Z]+" )
23
- or
24
- exists ( TopLevel tl | tl .getFile ( ) = this |
25
- tl .isExterns ( )
26
- or
27
- tl instanceof FrameworkLibraryInstance
28
- )
29
- }
30
- }
31
-
32
15
/** An call site that is relevant for analysis quality. */
33
16
class RelevantInvoke extends InvokeNode {
34
17
RelevantInvoke ( ) { not getFile ( ) instanceof IgnoredFile }
You can’t perform that action at this time.
0 commit comments