ts2famix 2.0.0 → 2.0.3
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.
- package/LICENSE +1 -0
- package/README.md +29 -60
- package/dist/analyze.js +1 -1
- package/dist/analyze_functions/process_functions.js +49 -43
- package/dist/famix_functions/EntityDictionary.js +309 -182
- package/dist/famix_functions/helpers_creation.js +36 -5
- package/dist/fqn.js +76 -114
- package/dist/lib/famix/famix_JSON_exporter.js +55 -0
- package/dist/lib/famix/famix_base_element.js +18 -0
- package/dist/lib/famix/famix_repository.js +224 -0
- package/dist/lib/famix/{src/index.js → index.js} +1 -1
- package/dist/lib/famix/model/famix/access.js +40 -0
- package/dist/lib/famix/model/famix/accessor.js +17 -0
- package/dist/lib/famix/model/famix/alias.js +33 -0
- package/dist/lib/famix/model/famix/arrow_function.js +17 -0
- package/dist/lib/famix/model/famix/behavioral_entity.js +79 -0
- package/dist/lib/famix/model/famix/class.js +71 -0
- package/dist/lib/famix/model/famix/comment.js +39 -0
- package/dist/lib/famix/model/famix/concretisation.js +31 -0
- package/dist/lib/famix/model/famix/container_entity.js +126 -0
- package/dist/lib/famix/model/famix/decorator.js +32 -0
- package/dist/lib/famix/model/famix/entity.js +17 -0
- package/dist/lib/famix/model/famix/enum.js +31 -0
- package/dist/lib/famix/model/famix/enum_value.js +25 -0
- package/dist/lib/famix/model/famix/function.js +17 -0
- package/dist/lib/famix/model/famix/import_clause.js +41 -0
- package/dist/lib/famix/{src/model → model}/famix/index.js +6 -10
- package/dist/lib/famix/model/famix/indexed_file_anchor.js +38 -0
- package/dist/lib/famix/model/famix/inheritance.js +33 -0
- package/dist/lib/famix/model/famix/interface.js +64 -0
- package/dist/lib/famix/model/famix/invocation.js +54 -0
- package/dist/lib/famix/model/famix/method.js +67 -0
- package/dist/lib/famix/model/famix/module.js +60 -0
- package/dist/lib/famix/model/famix/named_entity.js +78 -0
- package/dist/lib/famix/model/famix/parameter.js +25 -0
- package/dist/lib/famix/model/famix/parameter_concretisation.js +44 -0
- package/dist/lib/famix/model/famix/parameter_type.js +45 -0
- package/dist/lib/famix/model/famix/parametric_arrow_function.js +31 -0
- package/dist/lib/famix/model/famix/parametric_class.js +44 -0
- package/dist/lib/famix/model/famix/parametric_function.js +31 -0
- package/dist/lib/famix/model/famix/parametric_interface.js +44 -0
- package/dist/lib/famix/model/famix/parametric_method.js +31 -0
- package/dist/lib/famix/model/famix/primitive_type.js +17 -0
- package/dist/lib/famix/model/famix/property.js +73 -0
- package/dist/lib/famix/model/famix/reference.js +33 -0
- package/dist/lib/famix/model/famix/scoping_entity.js +36 -0
- package/dist/lib/famix/model/famix/script_entity.js +29 -0
- package/dist/lib/famix/model/famix/source_anchor.js +27 -0
- package/dist/lib/famix/model/famix/source_language.js +35 -0
- package/dist/lib/famix/model/famix/sourced_entity.js +60 -0
- package/dist/lib/famix/model/famix/structural_entity.js +39 -0
- package/dist/lib/famix/model/famix/type.js +73 -0
- package/dist/lib/famix/model/famix/variable.js +24 -0
- package/dist/lib/ts-complex/cyclomatic-service.js +2 -2
- package/dist/refactorer/refactor-getter-setter.js +142 -0
- package/dist/ts2famix-cli-wrapper.js +29 -3
- package/dist/ts2famix-cli.js +1 -1
- package/doc-uml/famix-typescript-model.puml +390 -341
- package/doc-uml/famix-typescript-model.svg +1 -1
- package/package.json +26 -9
- package/src/analyze.ts +2 -2
- package/src/analyze_functions/process_functions.ts +49 -44
- package/src/famix_functions/EntityDictionary.ts +345 -216
- package/src/famix_functions/helpers_creation.ts +36 -4
- package/src/fqn.ts +76 -125
- package/src/lib/famix/famix_JSON_exporter.ts +56 -0
- package/src/lib/famix/famix_base_element.ts +22 -0
- package/src/lib/famix/famix_repository.ts +243 -0
- package/src/lib/famix/model/famix/access.ts +50 -0
- package/src/lib/famix/model/famix/alias.ts +39 -0
- package/src/lib/famix/model/famix/behavioral_entity.ts +97 -0
- package/src/lib/famix/model/famix/class.ts +85 -0
- package/src/lib/famix/model/famix/comment.ts +47 -0
- package/src/lib/famix/model/famix/concretisation.ts +40 -0
- package/src/lib/famix/model/famix/container_entity.ts +160 -0
- package/src/lib/famix/model/famix/decorator.ts +37 -0
- package/src/lib/famix/model/famix/enum.ts +30 -0
- package/src/lib/famix/model/famix/enum_value.ts +28 -0
- package/src/lib/famix/model/famix/import_clause.ts +51 -0
- package/src/lib/famix/{src/model → model}/famix/index.ts +2 -4
- package/src/lib/famix/model/famix/indexed_file_anchor.ts +46 -0
- package/src/lib/famix/model/famix/inheritance.ts +40 -0
- package/src/lib/famix/model/famix/interface.ts +75 -0
- package/src/lib/famix/model/famix/invocation.ts +65 -0
- package/src/lib/famix/model/famix/method.ts +89 -0
- package/src/lib/famix/model/famix/module.ts +71 -0
- package/src/lib/famix/model/famix/named_entity.ts +95 -0
- package/src/lib/famix/{src/model → model}/famix/parameter.ts +11 -12
- package/src/lib/famix/model/famix/parameter_concretisation.ts +51 -0
- package/src/lib/famix/model/famix/parameter_type.ts +58 -0
- package/src/lib/famix/model/famix/parametric_arrow_function.ts +32 -0
- package/src/lib/famix/model/famix/parametric_class.ts +49 -0
- package/src/lib/famix/model/famix/parametric_function.ts +32 -0
- package/src/lib/famix/model/famix/parametric_interface.ts +49 -0
- package/src/lib/famix/model/famix/parametric_method.ts +32 -0
- package/src/lib/famix/model/famix/primitive_type.ts +15 -0
- package/src/lib/famix/model/famix/property.ts +94 -0
- package/src/lib/famix/model/famix/reference.ts +40 -0
- package/src/lib/famix/model/famix/scoping_entity.ts +35 -0
- package/src/lib/famix/model/famix/script_entity.ts +34 -0
- package/src/lib/famix/model/famix/source_anchor.ts +30 -0
- package/src/lib/famix/model/famix/source_language.ts +35 -0
- package/src/lib/famix/model/famix/sourced_entity.ts +70 -0
- package/src/lib/famix/model/famix/structural_entity.ts +43 -0
- package/src/lib/famix/model/famix/type.ts +87 -0
- package/src/lib/famix/model/famix/variable.ts +27 -0
- package/src/lib/famix/package.json +1 -1
- package/src/lib/ts-complex/cyclomatic-service.ts +10 -10
- package/src/refactorer/refactor-getter-setter.ts +140 -0
- package/src/ts2famix-cli-wrapper.ts +6 -2
- package/src/ts2famix-cli.ts +1 -1
- package/tsconfig.check-tests.json +14 -0
- package/tsconfig.json +70 -68
- package/dist/famix2puml.js +0 -126
- package/dist/lib/famix/src/famix_JSON_exporter.js +0 -55
- package/dist/lib/famix/src/famix_base_element.js +0 -18
- package/dist/lib/famix/src/famix_repository.js +0 -223
- package/dist/lib/famix/src/model/famix/access.js +0 -40
- package/dist/lib/famix/src/model/famix/accessor.js +0 -17
- package/dist/lib/famix/src/model/famix/alias.js +0 -33
- package/dist/lib/famix/src/model/famix/arrowFunction.js +0 -17
- package/dist/lib/famix/src/model/famix/behavioral_entity.js +0 -79
- package/dist/lib/famix/src/model/famix/class.js +0 -71
- package/dist/lib/famix/src/model/famix/comment.js +0 -39
- package/dist/lib/famix/src/model/famix/concretisation.js +0 -31
- package/dist/lib/famix/src/model/famix/container_entity.js +0 -126
- package/dist/lib/famix/src/model/famix/decorator.js +0 -32
- package/dist/lib/famix/src/model/famix/entity.js +0 -17
- package/dist/lib/famix/src/model/famix/enum.js +0 -31
- package/dist/lib/famix/src/model/famix/enum_value.js +0 -25
- package/dist/lib/famix/src/model/famix/function.js +0 -17
- package/dist/lib/famix/src/model/famix/implicit_variable.js +0 -17
- package/dist/lib/famix/src/model/famix/import_clause.js +0 -41
- package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +0 -52
- package/dist/lib/famix/src/model/famix/inheritance.js +0 -33
- package/dist/lib/famix/src/model/famix/interface.js +0 -64
- package/dist/lib/famix/src/model/famix/invocation.js +0 -54
- package/dist/lib/famix/src/model/famix/method.js +0 -67
- package/dist/lib/famix/src/model/famix/module.js +0 -84
- package/dist/lib/famix/src/model/famix/named_entity.js +0 -78
- package/dist/lib/famix/src/model/famix/parameter.js +0 -25
- package/dist/lib/famix/src/model/famix/parameterConcretisation.js +0 -44
- package/dist/lib/famix/src/model/famix/parameter_type.js +0 -45
- package/dist/lib/famix/src/model/famix/parametric_arrow_function.js +0 -31
- package/dist/lib/famix/src/model/famix/parametric_class.js +0 -44
- package/dist/lib/famix/src/model/famix/parametric_function.js +0 -31
- package/dist/lib/famix/src/model/famix/parametric_interface.js +0 -44
- package/dist/lib/famix/src/model/famix/parametric_method.js +0 -31
- package/dist/lib/famix/src/model/famix/primitive_type.js +0 -17
- package/dist/lib/famix/src/model/famix/property.js +0 -126
- package/dist/lib/famix/src/model/famix/reference.js +0 -33
- package/dist/lib/famix/src/model/famix/scoping_entity.js +0 -37
- package/dist/lib/famix/src/model/famix/script_entity.js +0 -29
- package/dist/lib/famix/src/model/famix/source_anchor.js +0 -27
- package/dist/lib/famix/src/model/famix/source_language.js +0 -35
- package/dist/lib/famix/src/model/famix/sourced_entity.js +0 -60
- package/dist/lib/famix/src/model/famix/structural_entity.js +0 -39
- package/dist/lib/famix/src/model/famix/text_anchor.js +0 -38
- package/dist/lib/famix/src/model/famix/type.js +0 -73
- package/dist/lib/famix/src/model/famix/variable.js +0 -24
- package/jest.config-old.ts +0 -199
- package/src/famix2puml.ts +0 -119
- package/src/lib/famix/package-lock.json +0 -301
- package/src/lib/famix/readme.md +0 -5
- package/src/lib/famix/src/famix_JSON_exporter.ts +0 -56
- package/src/lib/famix/src/famix_base_element.ts +0 -22
- package/src/lib/famix/src/famix_repository.ts +0 -243
- package/src/lib/famix/src/model/famix/access.ts +0 -53
- package/src/lib/famix/src/model/famix/alias.ts +0 -41
- package/src/lib/famix/src/model/famix/behavioral_entity.ts +0 -100
- package/src/lib/famix/src/model/famix/class.ts +0 -86
- package/src/lib/famix/src/model/famix/comment.ts +0 -50
- package/src/lib/famix/src/model/famix/concretisation.ts +0 -42
- package/src/lib/famix/src/model/famix/container_entity.ts +0 -165
- package/src/lib/famix/src/model/famix/decorator.ts +0 -39
- package/src/lib/famix/src/model/famix/enum.ts +0 -31
- package/src/lib/famix/src/model/famix/enum_value.ts +0 -29
- package/src/lib/famix/src/model/famix/implicit_variable.ts +0 -15
- package/src/lib/famix/src/model/famix/import_clause.ts +0 -54
- package/src/lib/famix/src/model/famix/indexed_file_anchor.ts +0 -71
- package/src/lib/famix/src/model/famix/inheritance.ts +0 -41
- package/src/lib/famix/src/model/famix/interface.ts +0 -75
- package/src/lib/famix/src/model/famix/invocation.ts +0 -68
- package/src/lib/famix/src/model/famix/method.ts +0 -96
- package/src/lib/famix/src/model/famix/module.ts +0 -97
- package/src/lib/famix/src/model/famix/named_entity.ts +0 -98
- package/src/lib/famix/src/model/famix/parameterConcretisation.ts +0 -54
- package/src/lib/famix/src/model/famix/parameter_type.ts +0 -60
- package/src/lib/famix/src/model/famix/parametric_arrow_function.ts +0 -32
- package/src/lib/famix/src/model/famix/parametric_class.ts +0 -49
- package/src/lib/famix/src/model/famix/parametric_function.ts +0 -32
- package/src/lib/famix/src/model/famix/parametric_interface.ts +0 -49
- package/src/lib/famix/src/model/famix/parametric_method.ts +0 -32
- package/src/lib/famix/src/model/famix/primitive_type.ts +0 -15
- package/src/lib/famix/src/model/famix/property.ts +0 -152
- package/src/lib/famix/src/model/famix/reference.ts +0 -42
- package/src/lib/famix/src/model/famix/scoping_entity.ts +0 -36
- package/src/lib/famix/src/model/famix/script_entity.ts +0 -36
- package/src/lib/famix/src/model/famix/source_anchor.ts +0 -31
- package/src/lib/famix/src/model/famix/source_language.ts +0 -36
- package/src/lib/famix/src/model/famix/sourced_entity.ts +0 -73
- package/src/lib/famix/src/model/famix/structural_entity.ts +0 -44
- package/src/lib/famix/src/model/famix/text_anchor.ts +0 -49
- package/src/lib/famix/src/model/famix/type.ts +0 -89
- package/src/lib/famix/src/model/famix/variable.ts +0 -28
- package/src/lib/famix/tsconfig.json +0 -27
- package/src/lib/famix/tslint.json +0 -15
- /package/src/lib/famix/{src/index.ts → index.ts} +0 -0
- /package/src/lib/famix/{src/model → model}/famix/accessor.ts +0 -0
- /package/src/lib/famix/{src/model/famix/arrowFunction.ts → model/famix/arrow_function.ts} +0 -0
- /package/src/lib/famix/{src/model → model}/famix/entity.ts +0 -0
- /package/src/lib/famix/{src/model → model}/famix/function.ts +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { SourceAnchor } from "./source_anchor";
|
|
3
|
+
|
|
4
|
+
export class IndexedFileAnchor extends SourceAnchor {
|
|
5
|
+
|
|
6
|
+
private _startPos!: number;
|
|
7
|
+
private _endPos!: number;
|
|
8
|
+
private _fileName!: string;
|
|
9
|
+
|
|
10
|
+
public getJSON(): string {
|
|
11
|
+
const json: FamixJSONExporter = new FamixJSONExporter("IndexedFileAnchor", this);
|
|
12
|
+
this.addPropertiesToExporter(json);
|
|
13
|
+
return json.getJSON();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
17
|
+
super.addPropertiesToExporter(exporter);
|
|
18
|
+
exporter.addProperty("startPos", this.startPos);
|
|
19
|
+
exporter.addProperty("endPos", this.endPos);
|
|
20
|
+
exporter.addProperty("fileName", this.fileName);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get startPos(): number {
|
|
24
|
+
return this._startPos;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
set startPos(startPos: number) {
|
|
28
|
+
this._startPos = startPos;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get endPos(): number {
|
|
32
|
+
return this._endPos;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
set endPos(endPos: number) {
|
|
36
|
+
this._endPos = endPos;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get fileName(): string {
|
|
40
|
+
return this._fileName;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set fileName(fileName: string) {
|
|
44
|
+
this._fileName = fileName;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { Class } from "./class";
|
|
3
|
+
import { Entity } from "./entity";
|
|
4
|
+
import { Interface } from "./interface";
|
|
5
|
+
|
|
6
|
+
export class Inheritance extends Entity {
|
|
7
|
+
|
|
8
|
+
private _superclass!: Class | Interface;
|
|
9
|
+
private _subclass!: Class | Interface;
|
|
10
|
+
|
|
11
|
+
public getJSON(): string {
|
|
12
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Inheritance", this);
|
|
13
|
+
this.addPropertiesToExporter(json);
|
|
14
|
+
return json.getJSON();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
18
|
+
super.addPropertiesToExporter(exporter);
|
|
19
|
+
exporter.addProperty("superclass", this.superclass);
|
|
20
|
+
exporter.addProperty("subclass", this.subclass);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get superclass() {
|
|
24
|
+
return this._superclass;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
set superclass(superclass: Class | Interface) {
|
|
28
|
+
this._superclass = superclass;
|
|
29
|
+
superclass.addSubInheritance(this);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get subclass() {
|
|
33
|
+
return this._subclass;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
set subclass(subclass: Class | Interface) {
|
|
37
|
+
this._subclass = subclass;
|
|
38
|
+
subclass.addSuperInheritance(this);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { Type } from "./type";
|
|
3
|
+
import { Method } from "./method";
|
|
4
|
+
import { Property } from "./property";
|
|
5
|
+
import { Inheritance } from "./inheritance";
|
|
6
|
+
|
|
7
|
+
export class Interface extends Type {
|
|
8
|
+
|
|
9
|
+
private _properties: Set<Property> = new Set();
|
|
10
|
+
|
|
11
|
+
public addProperty(property: Property): void {
|
|
12
|
+
if (!this._properties.has(property)) {
|
|
13
|
+
this._properties.add(property);
|
|
14
|
+
property.parentEntity = this;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private _methods: Set<Method> = new Set();
|
|
19
|
+
|
|
20
|
+
public addMethod(method: Method): void {
|
|
21
|
+
if (!this._methods.has(method)) {
|
|
22
|
+
this._methods.add(method);
|
|
23
|
+
method.parentEntity = this;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private _superInheritances: Set<Inheritance> = new Set();
|
|
28
|
+
|
|
29
|
+
public addSuperInheritance(superInheritance: Inheritance): void {
|
|
30
|
+
if (!this._superInheritances.has(superInheritance)) {
|
|
31
|
+
this._superInheritances.add(superInheritance);
|
|
32
|
+
superInheritance.subclass = this;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private _subInheritances: Set<Inheritance> = new Set();
|
|
37
|
+
|
|
38
|
+
public addSubInheritance(subInheritance: Inheritance): void {
|
|
39
|
+
if (!this._subInheritances.has(subInheritance)) {
|
|
40
|
+
this._subInheritances.add(subInheritance);
|
|
41
|
+
subInheritance.superclass = this;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
public getJSON(): string {
|
|
47
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Interface", this);
|
|
48
|
+
this.addPropertiesToExporter(json);
|
|
49
|
+
return json.getJSON();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
53
|
+
super.addPropertiesToExporter(exporter);
|
|
54
|
+
exporter.addProperty("attributes", this.properties);
|
|
55
|
+
exporter.addProperty("methods", this.methods);
|
|
56
|
+
exporter.addProperty("superInheritances", this.superInheritances);
|
|
57
|
+
exporter.addProperty("subInheritances", this.subInheritances);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
get properties() {
|
|
61
|
+
return this._properties;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get methods() {
|
|
65
|
+
return this._methods;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get superInheritances() {
|
|
69
|
+
return this._superInheritances;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get subInheritances() {
|
|
73
|
+
return this._subInheritances;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { NamedEntity } from "./named_entity";
|
|
3
|
+
import { BehavioralEntity } from "./behavioral_entity";
|
|
4
|
+
import { ContainerEntity } from "./container_entity";
|
|
5
|
+
import { Entity } from "./entity";
|
|
6
|
+
|
|
7
|
+
export class Invocation extends Entity {
|
|
8
|
+
|
|
9
|
+
private _candidates: Set<BehavioralEntity> = new Set();
|
|
10
|
+
|
|
11
|
+
public addCandidate(candidate: BehavioralEntity): void {
|
|
12
|
+
if (!this._candidates.has(candidate)) {
|
|
13
|
+
this._candidates.add(candidate);
|
|
14
|
+
candidate.addIncomingInvocation(this);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private _receiver!: NamedEntity;
|
|
19
|
+
private _sender!: ContainerEntity;
|
|
20
|
+
private _signature!: string;
|
|
21
|
+
|
|
22
|
+
public getJSON(): string {
|
|
23
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Invocation", this);
|
|
24
|
+
this.addPropertiesToExporter(json);
|
|
25
|
+
return json.getJSON();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
29
|
+
super.addPropertiesToExporter(exporter);
|
|
30
|
+
exporter.addProperty("candidates", this.candidates);
|
|
31
|
+
exporter.addProperty("receiver", this.receiver);
|
|
32
|
+
exporter.addProperty("sender", this.sender);
|
|
33
|
+
exporter.addProperty("signature", this.signature);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get candidates() {
|
|
37
|
+
return this._candidates;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get receiver() {
|
|
41
|
+
return this._receiver;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
set receiver(receiver: NamedEntity) {
|
|
45
|
+
this._receiver = receiver;
|
|
46
|
+
receiver.addReceivedInvocation(this);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get sender() {
|
|
50
|
+
return this._sender;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
set sender(sender: ContainerEntity) {
|
|
54
|
+
this._sender = sender;
|
|
55
|
+
sender.addOutgoingInvocation(this);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get signature() {
|
|
59
|
+
return this._signature;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set signature(signature: string) {
|
|
63
|
+
this._signature = signature;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { BehavioralEntity } from "./behavioral_entity";
|
|
3
|
+
import { Class } from "./class";
|
|
4
|
+
import { Interface } from "./interface";
|
|
5
|
+
|
|
6
|
+
export class Method extends BehavioralEntity {
|
|
7
|
+
|
|
8
|
+
private _parentEntity!: Class | Interface;
|
|
9
|
+
private _kind!: string;
|
|
10
|
+
private _isAbstract!: boolean;
|
|
11
|
+
private _isClassSide!: boolean;
|
|
12
|
+
private _isPrivate!: boolean;
|
|
13
|
+
private _isPublic!: boolean;
|
|
14
|
+
private _isProtected!: boolean;
|
|
15
|
+
|
|
16
|
+
public getJSON(): string {
|
|
17
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Method", this);
|
|
18
|
+
this.addPropertiesToExporter(json);
|
|
19
|
+
return json.getJSON();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
23
|
+
super.addPropertiesToExporter(exporter);
|
|
24
|
+
exporter.addProperty("parentType", this.parentEntity);
|
|
25
|
+
exporter.addProperty("kind", this.kind);
|
|
26
|
+
exporter.addProperty("isAbstract", this.isAbstract);
|
|
27
|
+
exporter.addProperty("isClassSide", this.isClassSide);
|
|
28
|
+
exporter.addProperty("isPrivate", this.isPrivate);
|
|
29
|
+
exporter.addProperty("isPublic", this.isPublic);
|
|
30
|
+
exporter.addProperty("isProtected", this.isProtected);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get parentEntity() {
|
|
34
|
+
return this._parentEntity;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
set parentEntity(parentEntity: Class | Interface) {
|
|
38
|
+
this._parentEntity = parentEntity;
|
|
39
|
+
parentEntity.addMethod(this);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get kind() {
|
|
43
|
+
return this._kind;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
set kind(kind: string) {
|
|
47
|
+
this._kind = kind;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
get isAbstract() {
|
|
51
|
+
return this._isAbstract;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
set isAbstract(isAbstract: boolean) {
|
|
55
|
+
this._isAbstract = isAbstract;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get isClassSide() {
|
|
59
|
+
return this._isClassSide;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set isClassSide(isClassSide: boolean) {
|
|
63
|
+
this._isClassSide = isClassSide;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get isPrivate() {
|
|
67
|
+
return this._isPrivate;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set isPrivate(isPrivate: boolean) {
|
|
71
|
+
this._isPrivate = isPrivate;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get isPublic() {
|
|
75
|
+
return this._isPublic;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
set isPublic(isPublic: boolean) {
|
|
79
|
+
this._isPublic = isPublic;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
get isProtected() {
|
|
83
|
+
return this._isProtected;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
set isProtected(isProtected: boolean) {
|
|
87
|
+
this._isProtected = isProtected;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { ImportClause } from "./import_clause";
|
|
3
|
+
import { ScopingEntity } from "./scoping_entity";
|
|
4
|
+
import { ScriptEntity } from "./script_entity";
|
|
5
|
+
|
|
6
|
+
export class Module extends ScriptEntity {
|
|
7
|
+
|
|
8
|
+
public get isAmbient() {
|
|
9
|
+
return this._isAmbient;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public set isAmbient(value: boolean) {
|
|
13
|
+
this._isAmbient = value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
private _isAmbient: boolean = false;
|
|
17
|
+
|
|
18
|
+
public get isNamespace() {
|
|
19
|
+
return this._isNamespace;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public set isNamespace(value: boolean) {
|
|
23
|
+
this._isNamespace = value;
|
|
24
|
+
}
|
|
25
|
+
private _isNamespace: boolean = false;
|
|
26
|
+
|
|
27
|
+
public get isModule() {
|
|
28
|
+
return this._isModule;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public set isModule(value: boolean) {
|
|
32
|
+
this._isModule = value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private _isModule: boolean = true;
|
|
36
|
+
|
|
37
|
+
private _parentScope!: ScopingEntity;
|
|
38
|
+
// incomingImports are in NamedEntity
|
|
39
|
+
private _outgoingImports: Set<ImportClause> = new Set();
|
|
40
|
+
|
|
41
|
+
addOutgoingImport(importClause: ImportClause) {
|
|
42
|
+
if (!this._outgoingImports.has(importClause)) {
|
|
43
|
+
this._outgoingImports.add(importClause);
|
|
44
|
+
importClause.importingEntity = this; // opposite
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public getJSON(): string {
|
|
49
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Module", this);
|
|
50
|
+
this.addPropertiesToExporter(json);
|
|
51
|
+
return json.getJSON();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
55
|
+
super.addPropertiesToExporter(exporter);
|
|
56
|
+
exporter.addProperty("outgoingImports", this.outgoingImports);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
get parentScope() {
|
|
60
|
+
return this._parentScope;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
set parentScope(parentScope: ScopingEntity) {
|
|
64
|
+
this._parentScope = parentScope;
|
|
65
|
+
parentScope.addModule(this);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get outgoingImports() {
|
|
69
|
+
return this._outgoingImports;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { SourcedEntity } from "./sourced_entity";
|
|
3
|
+
import { Invocation } from "./invocation";
|
|
4
|
+
import { ImportClause } from "./import_clause";
|
|
5
|
+
import { Alias } from "./alias";
|
|
6
|
+
import { Decorator } from "./decorator";
|
|
7
|
+
|
|
8
|
+
export class NamedEntity extends SourcedEntity {
|
|
9
|
+
|
|
10
|
+
private _fullyQualifiedName!: string;
|
|
11
|
+
private _receivedInvocations: Set<Invocation> = new Set();
|
|
12
|
+
|
|
13
|
+
public addReceivedInvocation(receivedInvocation: Invocation): void {
|
|
14
|
+
if (!this._receivedInvocations.has(receivedInvocation)) {
|
|
15
|
+
this._receivedInvocations.add(receivedInvocation);
|
|
16
|
+
receivedInvocation.receiver = this;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
private _incomingImports: Set<ImportClause> = new Set();
|
|
21
|
+
|
|
22
|
+
public addIncomingImport(anImport: ImportClause): void {
|
|
23
|
+
if (!this._incomingImports.has(anImport)) {
|
|
24
|
+
this._incomingImports.add(anImport);
|
|
25
|
+
anImport.importedEntity = this; // opposite
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private _name!: string;
|
|
30
|
+
private _aliases: Set<Alias> = new Set();
|
|
31
|
+
|
|
32
|
+
public addAlias(alias: Alias): void {
|
|
33
|
+
if (!this._aliases.has(alias)) {
|
|
34
|
+
this._aliases.add(alias);
|
|
35
|
+
alias.parentEntity = this;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private _decorators: Set<Decorator> = new Set();
|
|
40
|
+
|
|
41
|
+
public addDecorator(decorator: Decorator): void {
|
|
42
|
+
if (!this._decorators.has(decorator)) {
|
|
43
|
+
this._decorators.add(decorator);
|
|
44
|
+
decorator.decoratedEntity = this;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public getJSON(): string {
|
|
49
|
+
const json: FamixJSONExporter = new FamixJSONExporter("NamedEntity", this);
|
|
50
|
+
this.addPropertiesToExporter(json);
|
|
51
|
+
return json.getJSON();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
55
|
+
super.addPropertiesToExporter(exporter);
|
|
56
|
+
// exporter.addProperty("fullyQualifiedName", this.getFullyQualifiedName());
|
|
57
|
+
// exporter.addProperty("incomingInvocations", this.getReceivedInvocations());
|
|
58
|
+
exporter.addProperty("incomingImports", this.incomingImports);
|
|
59
|
+
exporter.addProperty("name", this.name);
|
|
60
|
+
// exporter.addProperty("aliases", this.getAliases()); /* since these generate Unknown property messages */
|
|
61
|
+
exporter.addProperty("decorators", this.decorators);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get fullyQualifiedName() {
|
|
65
|
+
return this._fullyQualifiedName;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
set fullyQualifiedName(fullyQualifiedName: string) {
|
|
69
|
+
this._fullyQualifiedName = fullyQualifiedName;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get receivedInvocations() {
|
|
73
|
+
return this._receivedInvocations;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
get incomingImports() {
|
|
77
|
+
return this._incomingImports;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get name() {
|
|
81
|
+
return this._name;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
set name(name: string) {
|
|
85
|
+
this._name = name;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
get aliases() {
|
|
89
|
+
return this._aliases;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
get decorators() {
|
|
93
|
+
return this._decorators;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -4,17 +4,7 @@ import { BehavioralEntity } from "./behavioral_entity";
|
|
|
4
4
|
|
|
5
5
|
export class Parameter extends StructuralEntity {
|
|
6
6
|
|
|
7
|
-
private
|
|
8
|
-
|
|
9
|
-
public getParentEntity(): BehavioralEntity {
|
|
10
|
-
return this.parentEntity;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public setParentEntity(parentEntity: BehavioralEntity): void {
|
|
14
|
-
this.parentEntity = parentEntity;
|
|
15
|
-
parentEntity.addParameter(this);
|
|
16
|
-
}
|
|
17
|
-
|
|
7
|
+
private _parentEntity!: BehavioralEntity;
|
|
18
8
|
|
|
19
9
|
public getJSON(): string {
|
|
20
10
|
const json: FamixJSONExporter = new FamixJSONExporter("Parameter", this);
|
|
@@ -24,6 +14,15 @@ export class Parameter extends StructuralEntity {
|
|
|
24
14
|
|
|
25
15
|
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
26
16
|
super.addPropertiesToExporter(exporter);
|
|
27
|
-
exporter.addProperty("parentBehaviouralEntity", this.
|
|
17
|
+
exporter.addProperty("parentBehaviouralEntity", this.parentEntity);
|
|
28
18
|
}
|
|
19
|
+
|
|
20
|
+
get parentEntity() {
|
|
21
|
+
return this._parentEntity;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
set parentEntity(parentEntity: BehavioralEntity) {
|
|
25
|
+
this._parentEntity = parentEntity;
|
|
26
|
+
parentEntity.addParameter(this);
|
|
27
|
+
}
|
|
29
28
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { Concretisation } from "./concretisation";
|
|
3
|
+
import { Entity } from "./entity";
|
|
4
|
+
import { ParameterType } from "./parameter_type";
|
|
5
|
+
import { PrimitiveType } from "./primitive_type";
|
|
6
|
+
|
|
7
|
+
export class ParameterConcretisation extends Entity {
|
|
8
|
+
|
|
9
|
+
private _genericParameter!: ParameterType;
|
|
10
|
+
private _concreteParameter!: PrimitiveType;
|
|
11
|
+
private _concretisations: Set<Concretisation> = new Set();
|
|
12
|
+
|
|
13
|
+
public addConcretisation(concretisation: Concretisation): void {
|
|
14
|
+
if (!this._concretisations.has(concretisation)) {
|
|
15
|
+
this._concretisations.add(concretisation);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public getJSON(): string {
|
|
20
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ParameterConcretisation", this);
|
|
21
|
+
this.addPropertiesToExporter(json);
|
|
22
|
+
return json.getJSON();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
26
|
+
super.addPropertiesToExporter(exporter);
|
|
27
|
+
exporter.addProperty("genericEntity", this.genericParameter);
|
|
28
|
+
exporter.addProperty("concreteEntity", this.concreteParameter);
|
|
29
|
+
exporter.addProperty("concretisations", this.concretisations);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get genericParameter() {
|
|
33
|
+
return this._genericParameter;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
set genericParameter(genericEntity: ParameterType) {
|
|
37
|
+
this._genericParameter = genericEntity;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get concreteParameter() {
|
|
41
|
+
return this._concreteParameter;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
set concreteParameter(concreteParameter: PrimitiveType) {
|
|
45
|
+
this._concreteParameter = concreteParameter;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get concretisations() {
|
|
49
|
+
return this._concretisations;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { Type } from "./type";
|
|
3
|
+
import { ParametricClass } from "./parametric_class";
|
|
4
|
+
import { ParametricInterface } from "./parametric_interface";
|
|
5
|
+
import { Method } from "./method";
|
|
6
|
+
import { Function as FamixFunction } from "./function";
|
|
7
|
+
import { Accessor } from "./accessor";
|
|
8
|
+
import { ParametricMethod } from "./parametric_method";
|
|
9
|
+
import { ParametricFunction } from "./parametric_function";
|
|
10
|
+
import { ArrowFunction } from "./arrow_function";
|
|
11
|
+
import { ParametricArrowFunction } from "./parametric_arrow_function";
|
|
12
|
+
|
|
13
|
+
export class ParameterType extends Type {
|
|
14
|
+
|
|
15
|
+
private _parentGeneric!: ParametricClass | ParametricInterface | Method | ParametricMethod | Accessor | FamixFunction | ParametricFunction | ArrowFunction | ParametricArrowFunction;
|
|
16
|
+
private _baseType!: Type;
|
|
17
|
+
private _arguments: Set<Type> = new Set();
|
|
18
|
+
|
|
19
|
+
public addArgument(argument: Type): void {
|
|
20
|
+
if (!this._arguments.has(argument)) {
|
|
21
|
+
this._arguments.add(argument);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public getJSON(): string {
|
|
26
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ParameterType", this);
|
|
27
|
+
this.addPropertiesToExporter(json);
|
|
28
|
+
return json.getJSON();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
32
|
+
super.addPropertiesToExporter(exporter);
|
|
33
|
+
exporter.addProperty("parentGeneric", this.parentGeneric);
|
|
34
|
+
exporter.addProperty("baseType", this.baseType);
|
|
35
|
+
exporter.addProperty("arguments", this.arguments);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get parentGeneric() {
|
|
39
|
+
return this._parentGeneric;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set parentGeneric(parentGeneric: ParametricClass | ParametricInterface | Method | ParametricMethod | Accessor | FamixFunction | ParametricFunction | ArrowFunction | ParametricArrowFunction) {
|
|
43
|
+
this._parentGeneric = parentGeneric;
|
|
44
|
+
parentGeneric.addGenericParameter(this);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get baseType() {
|
|
48
|
+
return this._baseType;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
set baseType(baseType: Type) {
|
|
52
|
+
this._baseType = baseType;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
get arguments() {
|
|
56
|
+
return this._arguments;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { ArrowFunction } from "./arrow_function";
|
|
3
|
+
import { Class } from "./class";
|
|
4
|
+
import { Interface } from "./interface";
|
|
5
|
+
import { PrimitiveType } from "./primitive_type";
|
|
6
|
+
|
|
7
|
+
export class ParametricArrowFunction extends ArrowFunction {
|
|
8
|
+
|
|
9
|
+
private _concreteParameters: Set<PrimitiveType | Class | Interface> = new Set();
|
|
10
|
+
|
|
11
|
+
public addConcreteParameter(concreteParameter: PrimitiveType | Class | Interface): void {
|
|
12
|
+
if (!this._concreteParameters.has(concreteParameter)) {
|
|
13
|
+
this._concreteParameters.add(concreteParameter);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public getJSON(): string {
|
|
18
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ParametricArrowFunction", this);
|
|
19
|
+
this.addPropertiesToExporter(json);
|
|
20
|
+
return json.getJSON();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
24
|
+
super.addPropertiesToExporter(exporter);
|
|
25
|
+
exporter.addProperty("genericParameters", this.genericParameters);
|
|
26
|
+
exporter.addProperty("concreteParameters", this.concreteParameters);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get concreteParameters() {
|
|
30
|
+
return this._concreteParameters;
|
|
31
|
+
}
|
|
32
|
+
}
|