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 22 * Helpers to generating meta metrics, that is, metrics about the CodeQL analysis and extractor.
33 */
44private import javascript
5+ private import semmle.javascript.dependencies.Dependencies
6+ private import semmle.javascript.dependencies.FrameworkLibraries
7+ private import semmle.javascript.frameworks.Testing
58
69/**
710 * Gets the root folder of the snapshot.
811 *
912 * This is selected as the location for project-wide metrics.
1013 */
1114Folder 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
1212
1313import meta.MetaMetrics
1414
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-
3215/** An call site that is relevant for analysis quality. */
3316class RelevantInvoke extends InvokeNode {
3417 RelevantInvoke ( ) { not getFile ( ) instanceof IgnoredFile }
You can’t perform that action at this time.
0 commit comments