ts2famix 2.1.0-beta.2 → 3.0.0
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/.eslintrc.json +24 -24
- package/LICENSE +24 -24
- package/README.md +78 -78
- package/dist/analyze.js +3 -3
- package/dist/analyze_functions/process_functions.js +92 -62
- package/dist/famix_functions/EntityDictionary.js +672 -597
- package/dist/famix_functions/helpers_creation.js +18 -12
- package/dist/fqn.js +351 -18
- package/dist/lib/famix/famix_JSON_exporter.js +1 -1
- package/dist/lib/famix/famix_base_element.js +1 -1
- package/dist/lib/famix/famix_repository.js +14 -5
- package/dist/lib/famix/index.js +1 -1
- package/dist/lib/famix/model/famix/access.js +1 -1
- package/dist/lib/famix/model/famix/accessor.js +1 -1
- package/dist/lib/famix/model/famix/alias.js +1 -1
- package/dist/lib/famix/model/famix/arrow_function.js +1 -1
- package/dist/lib/famix/model/famix/behavioral_entity.js +1 -1
- package/dist/lib/famix/model/famix/class.js +1 -1
- package/dist/lib/famix/model/famix/comment.js +1 -1
- package/dist/lib/famix/model/famix/concretisation.js +1 -1
- package/dist/lib/famix/model/famix/container_entity.js +1 -1
- package/dist/lib/famix/model/famix/decorator.js +1 -1
- package/dist/lib/famix/model/famix/entity.js +1 -1
- package/dist/lib/famix/model/famix/enum.js +1 -1
- package/dist/lib/famix/model/famix/enum_value.js +1 -1
- package/dist/lib/famix/model/famix/function.js +1 -1
- package/dist/lib/famix/model/famix/import_clause.js +1 -1
- package/dist/lib/famix/model/famix/index.js +1 -1
- package/dist/lib/famix/model/famix/indexed_file_anchor.js +1 -1
- package/dist/lib/famix/model/famix/inheritance.js +1 -1
- package/dist/lib/famix/model/famix/interface.js +1 -1
- package/dist/lib/famix/model/famix/invocation.js +1 -1
- package/dist/lib/famix/model/famix/method.js +1 -1
- package/dist/lib/famix/model/famix/module.js +2 -2
- package/dist/lib/famix/model/famix/named_entity.js +1 -1
- package/dist/lib/famix/model/famix/parameter.js +1 -1
- package/dist/lib/famix/model/famix/parameter_concretisation.js +1 -1
- package/dist/lib/famix/model/famix/parameter_type.js +1 -1
- package/dist/lib/famix/model/famix/parametric_arrow_function.js +1 -1
- package/dist/lib/famix/model/famix/parametric_class.js +1 -1
- package/dist/lib/famix/model/famix/parametric_function.js +1 -1
- package/dist/lib/famix/model/famix/parametric_interface.js +1 -1
- package/dist/lib/famix/model/famix/parametric_method.js +1 -1
- package/dist/lib/famix/model/famix/primitive_type.js +1 -1
- package/dist/lib/famix/model/famix/property.js +1 -1
- package/dist/lib/famix/model/famix/reference.js +1 -1
- package/dist/lib/famix/model/famix/scoping_entity.js +1 -1
- package/dist/lib/famix/model/famix/script_entity.js +1 -1
- package/dist/lib/famix/model/famix/source_anchor.js +1 -1
- package/dist/lib/famix/model/famix/source_language.js +1 -1
- package/dist/lib/famix/model/famix/sourced_entity.js +1 -1
- package/dist/lib/famix/model/famix/structural_entity.js +1 -1
- package/dist/lib/famix/model/famix/type.js +1 -1
- package/dist/lib/famix/model/famix/variable.js +1 -1
- package/dist/lib/ts-complex/cyclomatic-service.js +1 -1
- package/dist/refactorer/refactor-getter-setter.js +1 -1
- package/dist/ts2famix-cli-wrapper.js +1 -1
- package/dist/ts2famix-cli.js +1 -1
- package/doc-uml/famix-typescript-model.puml +619 -607
- package/doc-uml/famix-typescript-model.svg +1 -1
- package/eslint.config.mjs +28 -28
- package/jest.config.json +1 -1
- package/package.json +70 -70
- package/src/analyze.ts +120 -120
- package/src/analyze_functions/process_functions.ts +1069 -1040
- package/src/famix_functions/EntityDictionary.ts +2061 -2016
- package/src/famix_functions/helpers_creation.ts +143 -135
- package/src/fqn.ts +416 -50
- package/src/generate_uml.sh +20 -20
- package/src/lib/famix/License.md +22 -22
- package/src/lib/famix/famix_JSON_exporter.ts +56 -56
- package/src/lib/famix/famix_base_element.ts +22 -22
- package/src/lib/famix/famix_repository.ts +288 -278
- package/src/lib/famix/index.ts +8 -8
- package/src/lib/famix/model/famix/access.ts +50 -50
- package/src/lib/famix/model/famix/accessor.ts +15 -15
- package/src/lib/famix/model/famix/alias.ts +39 -39
- package/src/lib/famix/model/famix/arrow_function.ts +15 -15
- package/src/lib/famix/model/famix/behavioral_entity.ts +97 -97
- package/src/lib/famix/model/famix/class.ts +85 -85
- package/src/lib/famix/model/famix/comment.ts +47 -47
- package/src/lib/famix/model/famix/concretisation.ts +40 -40
- package/src/lib/famix/model/famix/container_entity.ts +160 -160
- package/src/lib/famix/model/famix/decorator.ts +37 -37
- package/src/lib/famix/model/famix/entity.ts +15 -15
- package/src/lib/famix/model/famix/enum.ts +30 -30
- package/src/lib/famix/model/famix/enum_value.ts +28 -28
- package/src/lib/famix/model/famix/function.ts +15 -15
- package/src/lib/famix/model/famix/import_clause.ts +51 -51
- package/src/lib/famix/model/famix/index.ts +41 -41
- package/src/lib/famix/model/famix/indexed_file_anchor.ts +46 -46
- package/src/lib/famix/model/famix/inheritance.ts +40 -40
- package/src/lib/famix/model/famix/interface.ts +75 -75
- package/src/lib/famix/model/famix/invocation.ts +65 -65
- package/src/lib/famix/model/famix/method.ts +89 -89
- package/src/lib/famix/model/famix/module.ts +71 -71
- package/src/lib/famix/model/famix/named_entity.ts +95 -95
- package/src/lib/famix/model/famix/parameter.ts +28 -28
- package/src/lib/famix/model/famix/parameter_concretisation.ts +51 -51
- package/src/lib/famix/model/famix/parameter_type.ts +58 -58
- package/src/lib/famix/model/famix/parametric_arrow_function.ts +32 -32
- package/src/lib/famix/model/famix/parametric_class.ts +49 -49
- package/src/lib/famix/model/famix/parametric_function.ts +32 -32
- package/src/lib/famix/model/famix/parametric_interface.ts +49 -49
- package/src/lib/famix/model/famix/parametric_method.ts +32 -32
- package/src/lib/famix/model/famix/primitive_type.ts +15 -15
- package/src/lib/famix/model/famix/property.ts +94 -94
- package/src/lib/famix/model/famix/reference.ts +40 -40
- package/src/lib/famix/model/famix/scoping_entity.ts +35 -35
- package/src/lib/famix/model/famix/script_entity.ts +34 -34
- package/src/lib/famix/model/famix/source_anchor.ts +30 -30
- package/src/lib/famix/model/famix/source_language.ts +35 -35
- package/src/lib/famix/model/famix/sourced_entity.ts +70 -70
- package/src/lib/famix/model/famix/structural_entity.ts +43 -43
- package/src/lib/famix/model/famix/type.ts +87 -87
- package/src/lib/famix/model/famix/variable.ts +27 -27
- package/src/lib/famix/package.json +28 -28
- package/src/lib/ts-complex/cyclomatic-service.ts +83 -83
- package/src/refactorer/refactor-getter-setter.ts +140 -140
- package/src/ts2famix-cli-wrapper.ts +21 -21
- package/src/ts2famix-cli.ts +60 -60
- package/tsconfig.check-tests.json +14 -14
- package/tsconfig.json +73 -72
- package/.vscode/settings.json +0 -4
- package/TODO +0 -1
- package/arwea-fix.json +0 -1
- package/bogus.ts +0 -3
- package/class-diagram.puml +0 -792
- package/debug.txt +0 -13332
- package/debuglog.txt +0 -12073
- package/dist/famix2puml.js +0 -126
- package/dist/getClasses-arrow-body.js +0 -43
- 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 -224
- package/dist/lib/famix/src/index.js +0 -31
- 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/arrow_function.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/index.js +0 -86
- package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +0 -38
- 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 -60
- 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_concretisation.js +0 -44
- package/dist/lib/famix/src/model/famix/parameter_type.js +0 -45
- package/dist/lib/famix/src/model/famix/parametricArrowFunction.js +0 -29
- 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 -73
- package/dist/lib/famix/src/model/famix/reference.js +0 -33
- package/dist/lib/famix/src/model/famix/scoping_entity.js +0 -36
- 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/fqn-model.json +0 -1
- package/iterateGenericTypes.ts +0 -69
- package/out/class-diagram/class-diagram.svg +0 -1
- package/sample.json +0 -1
- package/sample.ts +0 -1
- package/stats.txt +0 -3091
- package/tabby-debug-output.txt +0 -19433
- package/ts2famix.log +0 -22656
- package/validate-references.js +0 -103
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { SourcedEntity } from "./sourced_entity";
|
|
3
|
-
|
|
4
|
-
export class Comment extends SourcedEntity {
|
|
5
|
-
|
|
6
|
-
private _isJSDoc!: boolean;
|
|
7
|
-
private _container!: SourcedEntity;
|
|
8
|
-
private _content!: string;
|
|
9
|
-
|
|
10
|
-
public getJSON(): string {
|
|
11
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Comment", this);
|
|
12
|
-
this.addPropertiesToExporter(json);
|
|
13
|
-
return json.getJSON();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
17
|
-
super.addPropertiesToExporter(exporter);
|
|
18
|
-
exporter.addProperty("isJSDoc", this.isJSDoc);
|
|
19
|
-
exporter.addProperty("commentedEntity", this.container);
|
|
20
|
-
exporter.addProperty("content", this.content);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
get isJSDoc(): boolean {
|
|
24
|
-
return this._isJSDoc;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
set isJSDoc(isJSDoc: boolean) {
|
|
28
|
-
this._isJSDoc = isJSDoc;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
get container(): SourcedEntity {
|
|
32
|
-
return this._container;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
set container(container: SourcedEntity) {
|
|
36
|
-
this._container = container;
|
|
37
|
-
container.addComment(this);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
get content(): string {
|
|
41
|
-
return this._content;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
set content(content: string) {
|
|
45
|
-
this._content = content;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { SourcedEntity } from "./sourced_entity";
|
|
3
|
+
|
|
4
|
+
export class Comment extends SourcedEntity {
|
|
5
|
+
|
|
6
|
+
private _isJSDoc!: boolean;
|
|
7
|
+
private _container!: SourcedEntity;
|
|
8
|
+
private _content!: string;
|
|
9
|
+
|
|
10
|
+
public getJSON(): string {
|
|
11
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Comment", this);
|
|
12
|
+
this.addPropertiesToExporter(json);
|
|
13
|
+
return json.getJSON();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
17
|
+
super.addPropertiesToExporter(exporter);
|
|
18
|
+
exporter.addProperty("isJSDoc", this.isJSDoc);
|
|
19
|
+
exporter.addProperty("commentedEntity", this.container);
|
|
20
|
+
exporter.addProperty("content", this.content);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get isJSDoc(): boolean {
|
|
24
|
+
return this._isJSDoc;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
set isJSDoc(isJSDoc: boolean) {
|
|
28
|
+
this._isJSDoc = isJSDoc;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get container(): SourcedEntity {
|
|
32
|
+
return this._container;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
set container(container: SourcedEntity) {
|
|
36
|
+
this._container = container;
|
|
37
|
+
container.addComment(this);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get content(): string {
|
|
41
|
+
return this._content;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
set content(content: string) {
|
|
45
|
+
this._content = content;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { Entity } from "./entity";
|
|
3
|
-
import { ParametricClass } from "./parametric_class";
|
|
4
|
-
import { ParametricFunction } from "./parametric_function";
|
|
5
|
-
import { ParametricInterface } from "./parametric_interface";
|
|
6
|
-
import { ParametricMethod } from "./parametric_method";
|
|
7
|
-
|
|
8
|
-
export class Concretisation extends Entity {
|
|
9
|
-
|
|
10
|
-
private _genericEntity!: ParametricClass | ParametricInterface | ParametricFunction | ParametricMethod;
|
|
11
|
-
private _concreteEntity!: ParametricClass | ParametricInterface | ParametricFunction | ParametricMethod; // is this correct?
|
|
12
|
-
|
|
13
|
-
public getJSON(): string {
|
|
14
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Concretisation", this);
|
|
15
|
-
this.addPropertiesToExporter(json);
|
|
16
|
-
return json.getJSON();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
20
|
-
super.addPropertiesToExporter(exporter);
|
|
21
|
-
exporter.addProperty("genericEntity", this.genericEntity);
|
|
22
|
-
exporter.addProperty("concreteEntity", this.concreteEntity);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
get genericEntity() {
|
|
26
|
-
return this._genericEntity;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
set genericEntity(genericEntity: ParametricClass | ParametricInterface | ParametricFunction | ParametricMethod) {
|
|
30
|
-
this._genericEntity = genericEntity;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
get concreteEntity() {
|
|
34
|
-
return this._concreteEntity;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
set concreteEntity(concreteEntity: ParametricClass | ParametricInterface | ParametricFunction | ParametricMethod) {
|
|
38
|
-
this._concreteEntity = concreteEntity;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { Entity } from "./entity";
|
|
3
|
+
import { ParametricClass } from "./parametric_class";
|
|
4
|
+
import { ParametricFunction } from "./parametric_function";
|
|
5
|
+
import { ParametricInterface } from "./parametric_interface";
|
|
6
|
+
import { ParametricMethod } from "./parametric_method";
|
|
7
|
+
|
|
8
|
+
export class Concretisation extends Entity {
|
|
9
|
+
|
|
10
|
+
private _genericEntity!: ParametricClass | ParametricInterface | ParametricFunction | ParametricMethod;
|
|
11
|
+
private _concreteEntity!: ParametricClass | ParametricInterface | ParametricFunction | ParametricMethod; // is this correct?
|
|
12
|
+
|
|
13
|
+
public getJSON(): string {
|
|
14
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Concretisation", this);
|
|
15
|
+
this.addPropertiesToExporter(json);
|
|
16
|
+
return json.getJSON();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
20
|
+
super.addPropertiesToExporter(exporter);
|
|
21
|
+
exporter.addProperty("genericEntity", this.genericEntity);
|
|
22
|
+
exporter.addProperty("concreteEntity", this.concreteEntity);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
get genericEntity() {
|
|
26
|
+
return this._genericEntity;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
set genericEntity(genericEntity: ParametricClass | ParametricInterface | ParametricFunction | ParametricMethod) {
|
|
30
|
+
this._genericEntity = genericEntity;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get concreteEntity() {
|
|
34
|
+
return this._concreteEntity;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
set concreteEntity(concreteEntity: ParametricClass | ParametricInterface | ParametricFunction | ParametricMethod) {
|
|
38
|
+
this._concreteEntity = concreteEntity;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { Type } from "./type";
|
|
3
|
-
import { Invocation } from "./invocation";
|
|
4
|
-
import { NamedEntity } from "./named_entity";
|
|
5
|
-
import { Reference } from "./reference";
|
|
6
|
-
import { Access } from "./access";
|
|
7
|
-
import { Function as FamixFunctionEntity } from "./function";
|
|
8
|
-
import { Variable } from "./variable";
|
|
9
|
-
|
|
10
|
-
export class ContainerEntity extends NamedEntity {
|
|
11
|
-
|
|
12
|
-
private _parentContainerEntity!: ContainerEntity;
|
|
13
|
-
private _childrenContainerEntities: Set<ContainerEntity> = new Set();
|
|
14
|
-
|
|
15
|
-
public addChildContainerEntity(childContainerEntity: ContainerEntity): void {
|
|
16
|
-
if (!this._childrenContainerEntities.has(childContainerEntity)) {
|
|
17
|
-
this._childrenContainerEntities.add(childContainerEntity);
|
|
18
|
-
childContainerEntity.parentContainerEntity = this;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
private _cyclomaticComplexity!: number;
|
|
23
|
-
private _numberOfStatements!: number;
|
|
24
|
-
private _outgoingReferences: Set<Reference> = new Set();
|
|
25
|
-
|
|
26
|
-
public addOutgoingReference(outgoingReference: Reference): void {
|
|
27
|
-
if (!this._outgoingReferences.has(outgoingReference)) {
|
|
28
|
-
this._outgoingReferences.add(outgoingReference);
|
|
29
|
-
outgoingReference.source = this;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
private _numberOfLinesOfCode!: number;
|
|
34
|
-
private _outgoingInvocations: Set<Invocation> = new Set();
|
|
35
|
-
|
|
36
|
-
public addOutgoingInvocation(outgoingInvocation: Invocation): void {
|
|
37
|
-
if (!this._outgoingInvocations.has(outgoingInvocation)) {
|
|
38
|
-
this._outgoingInvocations.add(outgoingInvocation);
|
|
39
|
-
outgoingInvocation.sender = this;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
private _accesses: Set<Access> = new Set();
|
|
44
|
-
|
|
45
|
-
public addAccess(access: Access): void {
|
|
46
|
-
if (!this._accesses.has(access)) {
|
|
47
|
-
this._accesses.add(access);
|
|
48
|
-
access.accessor = this;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
private childrenTypes: Set<Type> = new Set();
|
|
53
|
-
|
|
54
|
-
public addType(childType: Type): void {
|
|
55
|
-
if (!this.childrenTypes.has(childType)) {
|
|
56
|
-
this.childrenTypes.add(childType);
|
|
57
|
-
childType.parentContainerEntity = this;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
private childrenFunctions: Set<FamixFunctionEntity> = new Set();
|
|
62
|
-
|
|
63
|
-
public addFunction(childFunction: FamixFunctionEntity): void {
|
|
64
|
-
if (!this.childrenFunctions.has(childFunction)) {
|
|
65
|
-
this.childrenFunctions.add(childFunction);
|
|
66
|
-
childFunction.parentContainerEntity = this;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
private _variables: Set<Variable> = new Set();
|
|
71
|
-
|
|
72
|
-
public addVariable(variable: Variable): void {
|
|
73
|
-
if (!this._variables.has(variable)) {
|
|
74
|
-
this._variables.add(variable);
|
|
75
|
-
variable.parentContainerEntity = this;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public getJSON(): string {
|
|
80
|
-
const json: FamixJSONExporter = new FamixJSONExporter("ContainerEntity", this);
|
|
81
|
-
this.addPropertiesToExporter(json);
|
|
82
|
-
return json.getJSON();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
86
|
-
super.addPropertiesToExporter(exporter);
|
|
87
|
-
// exporter.addProperty("parentBehaviouralEntity", this.getParentContainerEntity());
|
|
88
|
-
// exporter.addProperty("childrenContainerEntities", this.getChildrenContainerEntities());
|
|
89
|
-
exporter.addProperty("cyclomaticComplexity", this.cyclomaticComplexity);
|
|
90
|
-
exporter.addProperty("numberOfStatements", this.numberOfStatements);
|
|
91
|
-
// exporter.addProperty("outgoingReferences", this.getOutgoingReferences()); /* derived ?*/
|
|
92
|
-
exporter.addProperty("numberOfLinesOfCode", this.numberOfLinesOfCode);
|
|
93
|
-
// exporter.addProperty("outgoingInvocations", this.getOutgoingInvocations()); /* derived ?*/
|
|
94
|
-
// exporter.addProperty("accesses", this.getAccesses()); /* derived ?*/
|
|
95
|
-
exporter.addProperty("types", this.types);
|
|
96
|
-
exporter.addProperty("functions", this.functions);
|
|
97
|
-
exporter.addProperty("localVariables", this.variables);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
get parentContainerEntity() {
|
|
101
|
-
return this._parentContainerEntity;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
set parentContainerEntity(parentContainerEntity: ContainerEntity) {
|
|
105
|
-
this._parentContainerEntity = parentContainerEntity;
|
|
106
|
-
parentContainerEntity.addChildContainerEntity(this);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
get childrenContainerEntities(): Set<ContainerEntity> {
|
|
110
|
-
return this._childrenContainerEntities;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
get cyclomaticComplexity(): number {
|
|
114
|
-
return this._cyclomaticComplexity;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
set cyclomaticComplexity(cyclomaticComplexity: number) {
|
|
118
|
-
this._cyclomaticComplexity = cyclomaticComplexity;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
get numberOfStatements(): number {
|
|
122
|
-
return this._numberOfStatements;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
set numberOfStatements(numberOfStatements: number) {
|
|
126
|
-
this._numberOfStatements = numberOfStatements;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
get outgoingReferences() {
|
|
130
|
-
return this._outgoingReferences;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
get numberOfLinesOfCode(): number {
|
|
134
|
-
return this._numberOfLinesOfCode;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
set numberOfLinesOfCode(numberOfLinesOfCode: number) {
|
|
138
|
-
this._numberOfLinesOfCode = numberOfLinesOfCode;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
get outgoingInvocations() {
|
|
142
|
-
return this._outgoingInvocations;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
get accesses() {
|
|
146
|
-
return this._accesses;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
get types() {
|
|
150
|
-
return this.childrenTypes;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
get functions() {
|
|
154
|
-
return this.childrenFunctions;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
get variables() {
|
|
158
|
-
return this._variables;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { Type } from "./type";
|
|
3
|
+
import { Invocation } from "./invocation";
|
|
4
|
+
import { NamedEntity } from "./named_entity";
|
|
5
|
+
import { Reference } from "./reference";
|
|
6
|
+
import { Access } from "./access";
|
|
7
|
+
import { Function as FamixFunctionEntity } from "./function";
|
|
8
|
+
import { Variable } from "./variable";
|
|
9
|
+
|
|
10
|
+
export class ContainerEntity extends NamedEntity {
|
|
11
|
+
|
|
12
|
+
private _parentContainerEntity!: ContainerEntity;
|
|
13
|
+
private _childrenContainerEntities: Set<ContainerEntity> = new Set();
|
|
14
|
+
|
|
15
|
+
public addChildContainerEntity(childContainerEntity: ContainerEntity): void {
|
|
16
|
+
if (!this._childrenContainerEntities.has(childContainerEntity)) {
|
|
17
|
+
this._childrenContainerEntities.add(childContainerEntity);
|
|
18
|
+
childContainerEntity.parentContainerEntity = this;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private _cyclomaticComplexity!: number;
|
|
23
|
+
private _numberOfStatements!: number;
|
|
24
|
+
private _outgoingReferences: Set<Reference> = new Set();
|
|
25
|
+
|
|
26
|
+
public addOutgoingReference(outgoingReference: Reference): void {
|
|
27
|
+
if (!this._outgoingReferences.has(outgoingReference)) {
|
|
28
|
+
this._outgoingReferences.add(outgoingReference);
|
|
29
|
+
outgoingReference.source = this;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
private _numberOfLinesOfCode!: number;
|
|
34
|
+
private _outgoingInvocations: Set<Invocation> = new Set();
|
|
35
|
+
|
|
36
|
+
public addOutgoingInvocation(outgoingInvocation: Invocation): void {
|
|
37
|
+
if (!this._outgoingInvocations.has(outgoingInvocation)) {
|
|
38
|
+
this._outgoingInvocations.add(outgoingInvocation);
|
|
39
|
+
outgoingInvocation.sender = this;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private _accesses: Set<Access> = new Set();
|
|
44
|
+
|
|
45
|
+
public addAccess(access: Access): void {
|
|
46
|
+
if (!this._accesses.has(access)) {
|
|
47
|
+
this._accesses.add(access);
|
|
48
|
+
access.accessor = this;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private childrenTypes: Set<Type> = new Set();
|
|
53
|
+
|
|
54
|
+
public addType(childType: Type): void {
|
|
55
|
+
if (!this.childrenTypes.has(childType)) {
|
|
56
|
+
this.childrenTypes.add(childType);
|
|
57
|
+
childType.parentContainerEntity = this;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private childrenFunctions: Set<FamixFunctionEntity> = new Set();
|
|
62
|
+
|
|
63
|
+
public addFunction(childFunction: FamixFunctionEntity): void {
|
|
64
|
+
if (!this.childrenFunctions.has(childFunction)) {
|
|
65
|
+
this.childrenFunctions.add(childFunction);
|
|
66
|
+
childFunction.parentContainerEntity = this;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private _variables: Set<Variable> = new Set();
|
|
71
|
+
|
|
72
|
+
public addVariable(variable: Variable): void {
|
|
73
|
+
if (!this._variables.has(variable)) {
|
|
74
|
+
this._variables.add(variable);
|
|
75
|
+
variable.parentContainerEntity = this;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public getJSON(): string {
|
|
80
|
+
const json: FamixJSONExporter = new FamixJSONExporter("ContainerEntity", this);
|
|
81
|
+
this.addPropertiesToExporter(json);
|
|
82
|
+
return json.getJSON();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
86
|
+
super.addPropertiesToExporter(exporter);
|
|
87
|
+
// exporter.addProperty("parentBehaviouralEntity", this.getParentContainerEntity());
|
|
88
|
+
// exporter.addProperty("childrenContainerEntities", this.getChildrenContainerEntities());
|
|
89
|
+
exporter.addProperty("cyclomaticComplexity", this.cyclomaticComplexity);
|
|
90
|
+
exporter.addProperty("numberOfStatements", this.numberOfStatements);
|
|
91
|
+
// exporter.addProperty("outgoingReferences", this.getOutgoingReferences()); /* derived ?*/
|
|
92
|
+
exporter.addProperty("numberOfLinesOfCode", this.numberOfLinesOfCode);
|
|
93
|
+
// exporter.addProperty("outgoingInvocations", this.getOutgoingInvocations()); /* derived ?*/
|
|
94
|
+
// exporter.addProperty("accesses", this.getAccesses()); /* derived ?*/
|
|
95
|
+
exporter.addProperty("types", this.types);
|
|
96
|
+
exporter.addProperty("functions", this.functions);
|
|
97
|
+
exporter.addProperty("localVariables", this.variables);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
get parentContainerEntity() {
|
|
101
|
+
return this._parentContainerEntity;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
set parentContainerEntity(parentContainerEntity: ContainerEntity) {
|
|
105
|
+
this._parentContainerEntity = parentContainerEntity;
|
|
106
|
+
parentContainerEntity.addChildContainerEntity(this);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
get childrenContainerEntities(): Set<ContainerEntity> {
|
|
110
|
+
return this._childrenContainerEntities;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
get cyclomaticComplexity(): number {
|
|
114
|
+
return this._cyclomaticComplexity;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
set cyclomaticComplexity(cyclomaticComplexity: number) {
|
|
118
|
+
this._cyclomaticComplexity = cyclomaticComplexity;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
get numberOfStatements(): number {
|
|
122
|
+
return this._numberOfStatements;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
set numberOfStatements(numberOfStatements: number) {
|
|
126
|
+
this._numberOfStatements = numberOfStatements;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
get outgoingReferences() {
|
|
130
|
+
return this._outgoingReferences;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
get numberOfLinesOfCode(): number {
|
|
134
|
+
return this._numberOfLinesOfCode;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
set numberOfLinesOfCode(numberOfLinesOfCode: number) {
|
|
138
|
+
this._numberOfLinesOfCode = numberOfLinesOfCode;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
get outgoingInvocations() {
|
|
142
|
+
return this._outgoingInvocations;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
get accesses() {
|
|
146
|
+
return this._accesses;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
get types() {
|
|
150
|
+
return this.childrenTypes;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
get functions() {
|
|
154
|
+
return this.childrenFunctions;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
get variables() {
|
|
158
|
+
return this._variables;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { NamedEntity } from "./named_entity";
|
|
3
|
-
|
|
4
|
-
export class Decorator extends NamedEntity {
|
|
5
|
-
|
|
6
|
-
private _decoratorExpression!: string;
|
|
7
|
-
private _decoratedEntity!: NamedEntity;
|
|
8
|
-
|
|
9
|
-
public getJSON(): string {
|
|
10
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Decorator", this);
|
|
11
|
-
this.addPropertiesToExporter(json);
|
|
12
|
-
return json.getJSON();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
16
|
-
super.addPropertiesToExporter(exporter);
|
|
17
|
-
exporter.addProperty("expression", this.decoratorExpression);
|
|
18
|
-
exporter.addProperty("decoratedEntity", this.decoratedEntity);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
get decoratorExpression(): string {
|
|
22
|
-
return this._decoratorExpression;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
set decoratorExpression(decoratorExpression: string) {
|
|
26
|
-
this._decoratorExpression = decoratorExpression;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
get decoratedEntity(): NamedEntity {
|
|
30
|
-
return this._decoratedEntity;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
set decoratedEntity(decoratedEntity: NamedEntity) {
|
|
34
|
-
this._decoratedEntity = decoratedEntity;
|
|
35
|
-
decoratedEntity.addDecorator(this);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { NamedEntity } from "./named_entity";
|
|
3
|
+
|
|
4
|
+
export class Decorator extends NamedEntity {
|
|
5
|
+
|
|
6
|
+
private _decoratorExpression!: string;
|
|
7
|
+
private _decoratedEntity!: NamedEntity;
|
|
8
|
+
|
|
9
|
+
public getJSON(): string {
|
|
10
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Decorator", this);
|
|
11
|
+
this.addPropertiesToExporter(json);
|
|
12
|
+
return json.getJSON();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
16
|
+
super.addPropertiesToExporter(exporter);
|
|
17
|
+
exporter.addProperty("expression", this.decoratorExpression);
|
|
18
|
+
exporter.addProperty("decoratedEntity", this.decoratedEntity);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get decoratorExpression(): string {
|
|
22
|
+
return this._decoratorExpression;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set decoratorExpression(decoratorExpression: string) {
|
|
26
|
+
this._decoratorExpression = decoratorExpression;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get decoratedEntity(): NamedEntity {
|
|
30
|
+
return this._decoratedEntity;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
set decoratedEntity(decoratedEntity: NamedEntity) {
|
|
34
|
+
this._decoratedEntity = decoratedEntity;
|
|
35
|
+
decoratedEntity.addDecorator(this);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { FamixBaseElement } from "../../famix_base_element";
|
|
3
|
-
|
|
4
|
-
export class Entity extends FamixBaseElement {
|
|
5
|
-
|
|
6
|
-
public getJSON(): string {
|
|
7
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Entity", this);
|
|
8
|
-
this.addPropertiesToExporter(json);
|
|
9
|
-
return json.getJSON();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
13
|
-
super.addPropertiesToExporter(exporter);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { FamixBaseElement } from "../../famix_base_element";
|
|
3
|
+
|
|
4
|
+
export class Entity extends FamixBaseElement {
|
|
5
|
+
|
|
6
|
+
public getJSON(): string {
|
|
7
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Entity", this);
|
|
8
|
+
this.addPropertiesToExporter(json);
|
|
9
|
+
return json.getJSON();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
13
|
+
super.addPropertiesToExporter(exporter);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { Type } from "./type";
|
|
3
|
-
import { EnumValue } from "./enum_value";
|
|
4
|
-
|
|
5
|
-
export class Enum extends Type {
|
|
6
|
-
|
|
7
|
-
private _values: Set<EnumValue> = new Set();
|
|
8
|
-
|
|
9
|
-
public addValue(value: EnumValue): void {
|
|
10
|
-
if (!this._values.has(value)) {
|
|
11
|
-
this._values.add(value);
|
|
12
|
-
value.parentEntity = this;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public getJSON(): string {
|
|
17
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Enum", this);
|
|
18
|
-
this.addPropertiesToExporter(json);
|
|
19
|
-
return json.getJSON();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
23
|
-
super.addPropertiesToExporter(exporter);
|
|
24
|
-
exporter.addProperty("enumValues", this.values);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
get values() {
|
|
28
|
-
return this._values;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { Type } from "./type";
|
|
3
|
+
import { EnumValue } from "./enum_value";
|
|
4
|
+
|
|
5
|
+
export class Enum extends Type {
|
|
6
|
+
|
|
7
|
+
private _values: Set<EnumValue> = new Set();
|
|
8
|
+
|
|
9
|
+
public addValue(value: EnumValue): void {
|
|
10
|
+
if (!this._values.has(value)) {
|
|
11
|
+
this._values.add(value);
|
|
12
|
+
value.parentEntity = this;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public getJSON(): string {
|
|
17
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Enum", this);
|
|
18
|
+
this.addPropertiesToExporter(json);
|
|
19
|
+
return json.getJSON();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
23
|
+
super.addPropertiesToExporter(exporter);
|
|
24
|
+
exporter.addProperty("enumValues", this.values);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get values() {
|
|
28
|
+
return this._values;
|
|
29
|
+
}
|
|
30
|
+
}
|