scanoss 0.7.8 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/.idea/workspace.xml +47 -31
  2. package/.nyc_output/3da9f448-90e4-4399-887b-e4fd1b8d7052.json +1 -0
  3. package/.nyc_output/processinfo/3da9f448-90e4-4399-887b-e4fd1b8d7052.json +1 -0
  4. package/.nyc_output/processinfo/index.json +1 -0
  5. package/build/main/index.d.ts +2 -0
  6. package/build/main/index.js +3 -1
  7. package/build/main/sdk/FileCount/FileCount.d.ts +6 -0
  8. package/build/main/sdk/FileCount/FileCount.js +88 -0
  9. package/build/main/sdk/FileCount/FileCountFilter.d.ts +2 -0
  10. package/build/main/sdk/FileCount/FileCountFilter.js +10 -0
  11. package/build/main/sdk/FileCount/Interfaces.d.ts +19 -0
  12. package/build/main/sdk/FileCount/Interfaces.js +8 -0
  13. package/build/main/sdk/Filtering/DefaultFilterForDependencies.d.ts +2 -0
  14. package/build/main/sdk/Filtering/DefaultFilterForDependencies.js +144 -0
  15. package/build/main/sdk/Filtering/DefaultFilterForScanning.d.ts +2 -0
  16. package/build/main/sdk/Filtering/DefaultFilterForScanning.js +193 -0
  17. package/build/main/sdk/Filtering/Filtering.d.ts +80 -0
  18. package/build/main/sdk/Filtering/Filtering.js +259 -0
  19. package/build/main/sdk/tree/Filters/DependencyFilter.js +4 -4
  20. package/build/main/sdk/tree/Filters/ScanFilter.js +4 -4
  21. package/build/main/tsconfig.tsbuildinfo +81 -38
  22. package/build/module/index.d.ts +2 -0
  23. package/build/module/index.js +3 -1
  24. package/build/module/sdk/FileCount/FileCount.d.ts +6 -0
  25. package/build/module/sdk/FileCount/FileCount.js +63 -0
  26. package/build/module/sdk/FileCount/FileCountFilter.d.ts +2 -0
  27. package/build/module/sdk/FileCount/FileCountFilter.js +8 -0
  28. package/build/module/sdk/FileCount/Interfaces.d.ts +19 -0
  29. package/build/module/sdk/FileCount/Interfaces.js +6 -0
  30. package/build/module/sdk/Filtering/DefaultFilterForDependencies.d.ts +2 -0
  31. package/build/module/sdk/Filtering/DefaultFilterForDependencies.js +142 -0
  32. package/build/module/sdk/Filtering/DefaultFilterForScanning.d.ts +2 -0
  33. package/build/module/sdk/Filtering/DefaultFilterForScanning.js +191 -0
  34. package/build/module/sdk/Filtering/Filtering.d.ts +80 -0
  35. package/build/module/sdk/Filtering/Filtering.js +229 -0
  36. package/build/module/sdk/tree/Filters/DependencyFilter.js +4 -4
  37. package/build/module/sdk/tree/Filters/ScanFilter.js +4 -4
  38. package/build/module/tsconfig.module.tsbuildinfo +81 -38
  39. package/package-lock.json +2 -3
  40. package/package.json +3 -3
  41. package/src/index.ts +5 -0
  42. package/src/sdk/FileCount/FileCount.ts +81 -0
  43. package/src/sdk/FileCount/FileCountFilter.ts +14 -0
  44. package/src/sdk/FileCount/Interfaces.ts +23 -0
  45. package/src/sdk/Filtering/DefaultFilterForDependencies.ts +148 -0
  46. package/src/sdk/Filtering/DefaultFilterForScanning.ts +206 -0
  47. package/src/sdk/Filtering/Filtering.ts +273 -0
  48. package/src/sdk/tree/Filters/DependencyFilter.ts +4 -4
  49. package/src/sdk/tree/Filters/ScanFilter.ts +4 -4
  50. package/src/sdk/tree/Node.ts +1 -1
  51. package/src/sdk/tree/Tree.ts +1 -1
  52. package/tests/sdk/FileCount/FileCount.spec.ts +35 -0
  53. package/tests/sdk/FileCount/samples/16557/.y.ts +27 -0
  54. package/tests/sdk/FileCount/samples/16557/.z.ts +129 -0
  55. package/tests/sdk/FileCount/samples/16557/files/a.ts +195 -0
  56. package/tests/sdk/FileCount/samples/16557/files/b.ts +184 -0
  57. package/tests/sdk/FileCount/samples/16557/files/c.ts +47 -0
  58. package/tests/sdk/FileCount/samples/22036/files/a.ts +195 -0
  59. package/tests/sdk/FileCount/samples/22036/files/b.ts +184 -0
  60. package/tests/sdk/FileCount/samples/22036/files/c.ts +47 -0
  61. package/tests/sdk/FileCount/samples/22036/files/d.ts +48 -0
  62. package/tests/sdk/FileCount/samples/22036/y.ts +27 -0
  63. package/tests/sdk/FileCount/samples/22036/z.ts +129 -0
  64. package/yarn.lock +4938 -4938
  65. package/src/sdk/filters/DefaultFilterForDependencies.ts +0 -149
  66. package/src/sdk/filters/DefaultFilterForScanning.ts +0 -207
  67. package/src/sdk/filters/filtering.ts +0 -235
@@ -0,0 +1,81 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import {FileCountOptions, Format, IDirSummary, IFileSummary} from "./Interfaces";
4
+ import { FilterList } from '../Filtering/Filtering';
5
+ import { FileCountFilter } from './FileCountFilter';
6
+
7
+
8
+ export class FileCount {
9
+
10
+ public static async walk(rootPath: string, option?: FileCountOptions) {
11
+
12
+ //By default hidden folders and files are ignored
13
+ const filters = new FilterList(FileCountFilter);
14
+ if(option?.filters?.countHidden) filters.unload();
15
+
16
+ const data = await this.exploreBFS(rootPath,filters);
17
+
18
+ if (option?.output == Format.CSV) return this.produceCsv(data.fileSummary);
19
+ return data;
20
+ }
21
+
22
+
23
+
24
+ private static async exploreBFS(rootPath: string, filters: FilterList): Promise<IDirSummary> {
25
+
26
+ const results: IDirSummary = {fileSummary: new Map(), totalFileSize: 0};
27
+ const queue: Array<string> = [];
28
+
29
+ //TODO: Improve the queue implementation for a linked list
30
+ queue.push(rootPath)
31
+
32
+ while(queue.length) {
33
+ const currentPath = queue.shift() as string;
34
+ const entries = await fs.promises.readdir( currentPath , {withFileTypes: true});
35
+
36
+ for await (const entry of entries) {
37
+ const newPath = path.join(currentPath, entry.name);
38
+ if (filters.include(newPath)) {
39
+ if (entry.isDirectory()) queue.push(newPath);
40
+ else if (entry.isFile() && !entry.isSymbolicLink()) {
41
+ const currentExt = path.extname(entry.name);
42
+ const currentFileSize = (await fs.promises.stat(path.join(currentPath, entry.name))).size;
43
+ if (results.fileSummary.has(currentExt) ) {
44
+ const fileSum = results.fileSummary.get(currentExt)
45
+ fileSum.count++
46
+ fileSum.size += currentFileSize;
47
+ } else {
48
+ results.fileSummary.set(currentExt, {count: 1, size: currentFileSize, percentage: 0});
49
+ }
50
+ results.totalFileSize+= currentFileSize;
51
+ }
52
+ }
53
+ }
54
+ }
55
+
56
+ //Update percentage
57
+ for (const ext of results.fileSummary.keys()) {
58
+ const entry = results.fileSummary.get(ext);
59
+ entry.percentage = Number((entry.size / results.totalFileSize).toFixed(2));
60
+ }
61
+ return results;
62
+ }
63
+
64
+
65
+ private static produceCsv(data: Map<string,IFileSummary>): string {
66
+ let csv = '';
67
+ for (const key of data.keys()) {
68
+ const value = data.get(key);
69
+ const newLine = `${key},${value?.count},${value?.percentage}\n`
70
+ csv+=newLine;
71
+ }
72
+ return csv;
73
+ }
74
+
75
+
76
+ }
77
+
78
+
79
+
80
+
81
+
@@ -0,0 +1,14 @@
1
+ import {
2
+ FilterScope,
3
+ FilterType,
4
+ FilterListType,
5
+ NameFilter, IFilter
6
+ } from '../Filtering/Filtering';
7
+
8
+ export const FileCountFilter: IFilter = {
9
+ type: FilterListType.BANNED,
10
+ filters: [
11
+ { ftype: FilterType.NAME, condition: NameFilter.STARTS, value: '.', scope: FilterScope.ALL },
12
+ ],
13
+ };
14
+
@@ -0,0 +1,23 @@
1
+ export interface IDirSummary {
2
+ fileSummary: Map<string,IFileSummary>;
3
+ totalFileSize: number;
4
+ }
5
+
6
+ export interface IFileSummary {
7
+ count: number;
8
+ size: number;
9
+ percentage: number;
10
+ }
11
+
12
+
13
+ export enum Format {
14
+ RAW,
15
+ CSV
16
+ }
17
+ export interface FileCountOptions {
18
+ filters?: {
19
+ countHidden: boolean
20
+ }
21
+ output: Format;
22
+ }
23
+
@@ -0,0 +1,148 @@
1
+ // ------ FILTERS SYNC WITH PYTHON CLIENT 06/10/2021 ------ //
2
+ import { FilterListType, FilterScope, FilterType, IFilter } from './Filtering';
3
+
4
+
5
+ export const defaultFilterForDependencies: IFilter = {
6
+ type: FilterListType.BANNED,
7
+ filters: [
8
+ { condition: '=', value: '0', ftype: FilterType.SIZE, scope: FilterScope.FILE },
9
+
10
+ //Folders and files filters
11
+ { condition: 'starts', value: '.', ftype: FilterType.NAME, scope: FilterScope.ALL },
12
+
13
+ //Folder filters
14
+ { condition: 'ends', value: '.egg-info', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
15
+
16
+ { condition: 'fullmatch', value: 'nbproject', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
17
+ { condition: 'fullmatch', value: 'nbbuild', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
18
+ { condition: 'fullmatch', value: 'nbdist', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
19
+ { condition: 'fullmatch', value: '__pycache__', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
20
+ { condition: 'fullmatch', value: 'venv', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
21
+ { condition: 'fullmatch', value: '_yardoc', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
22
+ { condition: 'fullmatch', value: 'eggs', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
23
+ { condition: 'fullmatch', value: 'wheels', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
24
+ { condition: 'fullmatch', value: 'node_modules', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
25
+ { condition: 'fullmatch', value: '__pypackages__', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
26
+
27
+ { condition: '=', value: '.1', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
28
+ { condition: '=', value: '.2', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
29
+ { condition: '=', value: '.3', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
30
+ { condition: '=', value: '.4', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
31
+ { condition: '=', value: '.5', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
32
+ { condition: '=', value: '.6', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
33
+ { condition: '=', value: '.7', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
34
+ { condition: '=', value: '.8', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
35
+ { condition: '=', value: '.9', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
36
+ { condition: '=', value: '.ac', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
37
+ { condition: '=', value: '.adoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
38
+ { condition: '=', value: '.am', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
39
+ { condition: '=', value: '.asciidoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
40
+ { condition: '=', value: '.bmp', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
41
+ { condition: '=', value: '.build', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
42
+ { condition: '=', value: '.cfg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
43
+ { condition: '=', value: '.chm', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
44
+ { condition: '=', value: '.class', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
45
+ { condition: '=', value: '.cmake', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
46
+ { condition: '=', value: '.cnf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
47
+ { condition: '=', value: '.conf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
48
+ { condition: '=', value: '.contributors', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
49
+ { condition: '=', value: '.copying', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
50
+ { condition: '=', value: '.crt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
51
+ { condition: '=', value: '.css', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
52
+ { condition: '=', value: '.csv', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
53
+ { condition: '=', value: '.dat', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
54
+ { condition: '=', value: '.data', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
55
+ { condition: '=', value: '.doc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
56
+ { condition: '=', value: '.docx', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
57
+ { condition: '=', value: '.dtd', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
58
+ { condition: '=', value: '.dts', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
59
+ { condition: '=', value: '.iws', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
60
+ { condition: '=', value: '.c9', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
61
+ { condition: '=', value: '.c9revisions', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
62
+ { condition: '=', value: '.dtsi', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
63
+ { condition: '=', value: '.dump', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
64
+ { condition: '=', value: '.eot', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
65
+ { condition: '=', value: '.eps', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
66
+ { condition: '=', value: '.geojson', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
67
+ { condition: '=', value: '.gdoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
68
+ { condition: '=', value: '.gif', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
69
+ { condition: '=', value: '.glif', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
70
+ { condition: '=', value: '.gmo', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
71
+ { condition: '=', value: '.guess', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
72
+ { condition: '=', value: '.htm', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
73
+ { condition: '=', value: '.html', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
74
+ { condition: '=', value: '.ico', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
75
+ { condition: '=', value: '.iml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
76
+ { condition: '=', value: '.in', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
77
+ { condition: '=', value: '.inc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
78
+ { condition: '=', value: '.info', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
79
+ { condition: '=', value: '.ini', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
80
+ { condition: '=', value: '.jpeg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
81
+ { condition: '=', value: '.jpg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
82
+ { condition: '=', value: '.m4', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
83
+ { condition: '=', value: '.map', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
84
+ { condition: '=', value: '.markdown', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
85
+ { condition: '=', value: '.md', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
86
+ { condition: '=', value: '.md5', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
87
+ { condition: '=', value: '.meta', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
88
+ { condition: '=', value: '.mk', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
89
+ { condition: '=', value: '.mxml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
90
+ { condition: '=', value: '.o', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
91
+ { condition: '=', value: '.otf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
92
+ { condition: '=', value: '.out', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
93
+ { condition: '=', value: '.pbtxt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
94
+ { condition: '=', value: '.pdf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
95
+ { condition: '=', value: '.phtml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
96
+ { condition: '=', value: '.plist', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
97
+ { condition: '=', value: '.png', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
98
+ { condition: '=', value: '.po', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
99
+ { condition: '=', value: '.ppt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
100
+ { condition: '=', value: '.prefs', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
101
+ { condition: '=', value: '.properties', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
102
+ { condition: '=', value: '.qdoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
103
+ { condition: '=', value: '.result', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
104
+ { condition: '=', value: '.rgb', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
105
+ { condition: '=', value: '.rst', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
106
+ { condition: '=', value: '.scss', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
107
+ { condition: '=', value: '.sha', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
108
+ { condition: '=', value: '.sha1', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
109
+ { condition: '=', value: '.sha2', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
110
+ { condition: '=', value: '.sha256', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
111
+ { condition: '=', value: '.sln', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
112
+ { condition: '=', value: '.spec', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
113
+ { condition: '=', value: '.sql', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
114
+ { condition: '=', value: '.sub', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
115
+ { condition: '=', value: '.svg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
116
+ { condition: '=', value: '.svn-base', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
117
+ { condition: '=', value: '.tab', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
118
+ { condition: '=', value: '.template', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
119
+ { condition: '=', value: '.test', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
120
+ { condition: '=', value: '.tex', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
121
+ { condition: '=', value: '.tiff', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
122
+ { condition: '=', value: '.ttf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
123
+ { condition: '=', value: '.utf-8', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
124
+ { condition: '=', value: '.vim', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
125
+ { condition: '=', value: '.wav', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
126
+ { condition: '=', value: '.whl', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
127
+ { condition: '=', value: '.woff', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
128
+ { condition: '=', value: '.xht', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
129
+ { condition: '=', value: '.xhtml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
130
+ { condition: '=', value: '.xls', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
131
+ { condition: '=', value: '.xlsx', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
132
+ { condition: '=', value: '.xpm', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
133
+ { condition: '=', value: '.xsd', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
134
+ { condition: '=', value: '.xul', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
135
+ { condition: '=', value: '.wfp', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
136
+ { condition: '=', value: '.editorconfig', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
137
+ { condition: '=', value: '.dotcover', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
138
+ { condition: '=', value: '.pid', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
139
+ { condition: '=', value: '.lcov', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
140
+ { condition: '=', value: '.egg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
141
+ { condition: '=', value: '.manifest', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
142
+ { condition: '=', value: '.cache', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
143
+ { condition: '=', value: '.coverage', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
144
+ { condition: '=', value: '.cover', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
145
+ { condition: '=', value: '.lst', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
146
+ ],
147
+ };
148
+
@@ -0,0 +1,206 @@
1
+ // ------ FILTERS SYNC WITH PYTHON CLIENT 06/10/2021 ------ //
2
+ import { FilterListType, FilterScope, FilterType, IFilter } from './Filtering';
3
+
4
+
5
+ export const defaultFilterForScanning: IFilter = {
6
+ type: FilterListType.BANNED,
7
+ filters: [
8
+ { condition: '=', value: '0', ftype: FilterType.SIZE, scope: FilterScope.FILE },
9
+
10
+ //Folders and files filters
11
+ { condition: 'starts', value: '.', ftype: FilterType.NAME, scope: FilterScope.ALL },
12
+
13
+ //Folder filters
14
+ { condition: 'ends', value: '.egg-info', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
15
+
16
+ { condition: 'fullmatch', value: 'nbproject', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
17
+ { condition: 'fullmatch', value: 'nbbuild', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
18
+ { condition: 'fullmatch', value: 'nbdist', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
19
+ { condition: 'fullmatch', value: '__pycache__', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
20
+ { condition: 'fullmatch', value: 'venv', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
21
+ { condition: 'fullmatch', value: '_yardoc', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
22
+ { condition: 'fullmatch', value: 'eggs', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
23
+ { condition: 'fullmatch', value: 'wheels', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
24
+ { condition: 'fullmatch', value: 'htmlcov', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
25
+ { condition: 'fullmatch', value: '__pypackages__', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
26
+
27
+
28
+ //Files filters
29
+
30
+ { condition: 'fullmatch', value: 'gradlew', ftype: FilterType.NAME, scope: FilterScope.FILE },
31
+ { condition: 'fullmatch', value: 'gradlew.bat', ftype: FilterType.NAME, scope: FilterScope.FILE },
32
+ { condition: 'fullmatch', value: 'mvnw', ftype: FilterType.NAME, scope: FilterScope.FILE },
33
+ { condition: 'fullmatch', value: 'mvnw.cmd', ftype: FilterType.NAME, scope: FilterScope.FILE },
34
+ { condition: 'fullmatch', value: 'gradle-wrapper.jar', ftype: FilterType.NAME, scope: FilterScope.FILE },
35
+ { condition: 'fullmatch', value: 'maven-wrapper.jar', ftype: FilterType.NAME, scope: FilterScope.FILE },
36
+ { condition: 'fullmatch', value: 'thumbs.db', ftype: FilterType.NAME, scope: FilterScope.FILE },
37
+ { condition: 'fullmatch', value: 'babel.config.js', ftype: FilterType.NAME, scope: FilterScope.FILE },
38
+ { condition: 'fullmatch', value: 'license.txt', ftype: FilterType.NAME, scope: FilterScope.FILE },
39
+ { condition: 'fullmatch', value: 'license.md', ftype: FilterType.NAME, scope: FilterScope.FILE },
40
+ { condition: 'fullmatch', value: 'copying.lib', ftype: FilterType.NAME, scope: FilterScope.FILE },
41
+ { condition: 'fullmatch', value: 'makefile', ftype: FilterType.NAME, scope: FilterScope.FILE },
42
+
43
+
44
+ { condition: 'starts', value: '.asar', ftype: FilterType.NAME, scope: FilterScope.FILE },
45
+
46
+
47
+ { condition: 'ends', value: 'news', ftype: FilterType.NAME, scope: FilterScope.FILE },
48
+ { condition: 'ends', value: 'authors', ftype: FilterType.NAME, scope: FilterScope.FILE },
49
+
50
+
51
+ { condition: 'ends', value: '-doc', ftype: FilterType.NAME, scope: FilterScope.FILE },
52
+ { condition: 'ends', value: 'changelog', ftype: FilterType.NAME, scope: FilterScope.FILE },
53
+ { condition: 'ends', value: 'config', ftype: FilterType.NAME, scope: FilterScope.FILE },
54
+ { condition: 'ends', value: 'copying', ftype: FilterType.NAME, scope: FilterScope.FILE },
55
+ { condition: 'ends', value: 'license', ftype: FilterType.NAME, scope: FilterScope.FILE },
56
+ { condition: 'ends', value: 'licenses', ftype: FilterType.NAME, scope: FilterScope.FILE },
57
+ { condition: 'ends', value: 'notice', ftype: FilterType.NAME, scope: FilterScope.FILE },
58
+ { condition: 'ends', value: 'readme', ftype: FilterType.NAME, scope: FilterScope.FILE },
59
+ { condition: 'ends', value: 'swiftdoc', ftype: FilterType.NAME, scope: FilterScope.FILE },
60
+ { condition: 'ends', value: 'texidoc', ftype: FilterType.NAME, scope: FilterScope.FILE },
61
+ { condition: 'ends', value: 'todo', ftype: FilterType.NAME, scope: FilterScope.FILE },
62
+ { condition: 'ends', value: 'version', ftype: FilterType.NAME, scope: FilterScope.FILE },
63
+ { condition: 'ends', value: 'ignore', ftype: FilterType.NAME, scope: FilterScope.FILE },
64
+ { condition: 'ends', value: 'manifest', ftype: FilterType.NAME, scope: FilterScope.FILE },
65
+ { condition: 'ends', value: 'sqlite', ftype: FilterType.NAME, scope: FilterScope.FILE },
66
+ { condition: 'ends', value: 'sqlite3', ftype: FilterType.NAME, scope: FilterScope.FILE },
67
+
68
+ { condition: '=', value: '.1', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
69
+ { condition: '=', value: '.2', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
70
+ { condition: '=', value: '.3', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
71
+ { condition: '=', value: '.4', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
72
+ { condition: '=', value: '.5', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
73
+ { condition: '=', value: '.6', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
74
+ { condition: '=', value: '.7', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
75
+ { condition: '=', value: '.8', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
76
+ { condition: '=', value: '.9', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
77
+ { condition: '=', value: '.ac', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
78
+ { condition: '=', value: '.adoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
79
+ { condition: '=', value: '.am', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
80
+ { condition: '=', value: '.asciidoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
81
+ { condition: '=', value: '.bmp', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
82
+ { condition: '=', value: '.build', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
83
+ { condition: '=', value: '.cfg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
84
+ { condition: '=', value: '.chm', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
85
+ { condition: '=', value: '.class', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
86
+ { condition: '=', value: '.cmake', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
87
+ { condition: '=', value: '.cnf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
88
+ { condition: '=', value: '.conf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
89
+ { condition: '=', value: '.config', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
90
+ { condition: '=', value: '.contributors', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
91
+ { condition: '=', value: '.copying', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
92
+ { condition: '=', value: '.crt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
93
+ { condition: '=', value: '.csproj', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
94
+ { condition: '=', value: '.css', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
95
+ { condition: '=', value: '.csv', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
96
+ { condition: '=', value: '.dat', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
97
+ { condition: '=', value: '.data', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
98
+ { condition: '=', value: '.doc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
99
+ { condition: '=', value: '.docx', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
100
+ { condition: '=', value: '.dtd', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
101
+ { condition: '=', value: '.dts', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
102
+ { condition: '=', value: '.iws', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
103
+ { condition: '=', value: '.c9', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
104
+ { condition: '=', value: '.c9revisions', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
105
+ { condition: '=', value: '.dtsi', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
106
+ { condition: '=', value: '.dump', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
107
+ { condition: '=', value: '.eot', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
108
+ { condition: '=', value: '.eps', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
109
+ { condition: '=', value: '.geojson', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
110
+ { condition: '=', value: '.gdoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
111
+ { condition: '=', value: '.gif', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
112
+ { condition: '=', value: '.glif', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
113
+ { condition: '=', value: '.gmo', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
114
+ { condition: '=', value: '.gradle', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
115
+ { condition: '=', value: '.guess', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
116
+ { condition: '=', value: '.hex', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
117
+ { condition: '=', value: '.htm', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
118
+ { condition: '=', value: '.html', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
119
+ { condition: '=', value: '.ico', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
120
+ { condition: '=', value: '.iml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
121
+ { condition: '=', value: '.in', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
122
+ { condition: '=', value: '.inc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
123
+ { condition: '=', value: '.info', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
124
+ { condition: '=', value: '.ini', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
125
+ { condition: '=', value: '.ipynb', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
126
+ { condition: '=', value: '.jpeg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
127
+ { condition: '=', value: '.jpg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
128
+ { condition: '=', value: '.json', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
129
+ { condition: '=', value: '.jsonld', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
130
+ { condition: '=', value: '.lock', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
131
+ { condition: '=', value: '.log', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
132
+ { condition: '=', value: '.m4', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
133
+ { condition: '=', value: '.map', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
134
+ { condition: '=', value: '.markdown', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
135
+ { condition: '=', value: '.md', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
136
+ { condition: '=', value: '.md5', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
137
+ { condition: '=', value: '.meta', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
138
+ { condition: '=', value: '.mk', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
139
+ { condition: '=', value: '.mxml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
140
+ { condition: '=', value: '.o', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
141
+ { condition: '=', value: '.otf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
142
+ { condition: '=', value: '.out', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
143
+ { condition: '=', value: '.pbtxt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
144
+ { condition: '=', value: '.pdf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
145
+ { condition: '=', value: '.pem', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
146
+ { condition: '=', value: '.phtml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
147
+ { condition: '=', value: '.plist', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
148
+ { condition: '=', value: '.png', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
149
+ { condition: '=', value: '.po', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
150
+ { condition: '=', value: '.ppt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
151
+ { condition: '=', value: '.prefs', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
152
+ { condition: '=', value: '.properties', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
153
+ { condition: '=', value: '.pyc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
154
+ { condition: '=', value: '.qdoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
155
+ { condition: '=', value: '.result', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
156
+ { condition: '=', value: '.rgb', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
157
+ { condition: '=', value: '.rst', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
158
+ { condition: '=', value: '.scss', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
159
+ { condition: '=', value: '.sha', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
160
+ { condition: '=', value: '.sha1', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
161
+ { condition: '=', value: '.sha2', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
162
+ { condition: '=', value: '.sha256', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
163
+ { condition: '=', value: '.sln', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
164
+ { condition: '=', value: '.spec', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
165
+ { condition: '=', value: '.sql', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
166
+ { condition: '=', value: '.sub', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
167
+ { condition: '=', value: '.svg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
168
+ { condition: '=', value: '.svn-base', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
169
+ { condition: '=', value: '.tab', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
170
+ { condition: '=', value: '.template', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
171
+ { condition: '=', value: '.test', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
172
+ { condition: '=', value: '.tex', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
173
+ { condition: '=', value: '.tiff', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
174
+ { condition: '=', value: '.toml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
175
+ { condition: '=', value: '.ttf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
176
+ { condition: '=', value: '.txt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
177
+ { condition: '=', value: '.utf-8', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
178
+ { condition: '=', value: '.vim', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
179
+ { condition: '=', value: '.wav', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
180
+ { condition: '=', value: '.whl', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
181
+ { condition: '=', value: '.woff', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
182
+ { condition: '=', value: '.xht', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
183
+ { condition: '=', value: '.xhtml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
184
+ { condition: '=', value: '.xls', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
185
+ { condition: '=', value: '.xlsx', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
186
+ { condition: '=', value: '.xml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
187
+ { condition: '=', value: '.xpm', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
188
+ { condition: '=', value: '.xsd', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
189
+ { condition: '=', value: '.xul', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
190
+ { condition: '=', value: '.yaml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
191
+ { condition: '=', value: '.yml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
192
+ { condition: '=', value: '.wfp', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
193
+ { condition: '=', value: '.editorconfig', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
194
+ { condition: '=', value: '.dotcover', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
195
+ { condition: '=', value: '.pid', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
196
+ { condition: '=', value: '.lcov', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
197
+ { condition: '=', value: '.egg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
198
+ { condition: '=', value: '.manifest', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
199
+ { condition: '=', value: '.cache', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
200
+ { condition: '=', value: '.coverage', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
201
+ { condition: '=', value: '.cover', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
202
+ { condition: '=', value: '.gem', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
203
+ { condition: '=', value: '.lst', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
204
+ ],
205
+ };
206
+