ts2famix 1.4.1 → 2.0.1
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 +30 -61
- package/dist/analyze.js +4 -2
- package/dist/analyze_functions/process_functions.js +285 -131
- package/dist/famix_functions/EntityDictionary.js +864 -231
- package/dist/famix_functions/helpers_creation.js +61 -10
- package/dist/fqn.js +160 -111
- 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 -0
- 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/model/famix/index.js +86 -0
- 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 +3 -3
- package/dist/refactorer/refactor-getter-setter.js +142 -0
- package/dist/ts2famix-cli-wrapper.js +42 -0
- package/dist/ts2famix-cli.js +8 -1
- package/dist/ts2famix-tsconfig.js +1 -0
- package/doc-uml/famix-typescript-model.puml +608 -0
- package/doc-uml/famix-typescript-model.svg +1 -0
- package/jest.config.json +2 -1
- package/package.json +13 -12
- package/src/analyze.ts +24 -23
- package/src/analyze_functions/process_functions.ts +310 -129
- package/src/famix_functions/EntityDictionary.ts +949 -271
- package/src/famix_functions/helpers_creation.ts +64 -6
- package/src/fqn.ts +169 -96
- package/{dist/lib/famix/src/famix_JSON_exporter.js → src/lib/famix/famix_JSON_exporter.ts} +16 -14
- package/src/lib/famix/famix_base_element.ts +22 -0
- package/{dist/lib/famix/src/famix_repository.js → src/lib/famix/famix_repository.ts} +96 -75
- package/src/lib/famix/model/famix/access.ts +50 -0
- package/src/lib/famix/model/famix/alias.ts +39 -0
- package/src/lib/famix/{src/model/famix/implicit_variable.ts → model/famix/arrow_function.ts} +3 -3
- 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 +8 -7
- 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 +21 -0
- package/src/ts2famix-cli.ts +8 -2
- package/tsconfig.check-tests.json +14 -0
- package/tsconfig.json +71 -69
- package/dist/famix2puml.js +0 -125
- package/dist/lib/famix/src/famix_base_element.js +0 -17
- package/dist/lib/famix/src/model/famix/access.js +0 -39
- package/dist/lib/famix/src/model/famix/accessor.js +0 -16
- package/dist/lib/famix/src/model/famix/alias.js +0 -32
- package/dist/lib/famix/src/model/famix/association.js +0 -36
- package/dist/lib/famix/src/model/famix/behavioral_entity.js +0 -81
- package/dist/lib/famix/src/model/famix/class.js +0 -70
- package/dist/lib/famix/src/model/famix/comment.js +0 -38
- package/dist/lib/famix/src/model/famix/container_entity.js +0 -125
- package/dist/lib/famix/src/model/famix/decorator.js +0 -31
- package/dist/lib/famix/src/model/famix/entity.js +0 -16
- package/dist/lib/famix/src/model/famix/enum.js +0 -30
- package/dist/lib/famix/src/model/famix/enum_value.js +0 -24
- package/dist/lib/famix/src/model/famix/function.js +0 -16
- package/dist/lib/famix/src/model/famix/implicit_variable.js +0 -16
- package/dist/lib/famix/src/model/famix/import_clause.js +0 -39
- package/dist/lib/famix/src/model/famix/index.js +0 -83
- package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +0 -51
- package/dist/lib/famix/src/model/famix/inheritance.js +0 -32
- package/dist/lib/famix/src/model/famix/interface.js +0 -63
- package/dist/lib/famix/src/model/famix/invocation.js +0 -53
- package/dist/lib/famix/src/model/famix/method.js +0 -66
- package/dist/lib/famix/src/model/famix/module.js +0 -31
- package/dist/lib/famix/src/model/famix/named_entity.js +0 -77
- package/dist/lib/famix/src/model/famix/namespace.js +0 -24
- package/dist/lib/famix/src/model/famix/parameter.js +0 -24
- package/dist/lib/famix/src/model/famix/parameter_type.js +0 -24
- package/dist/lib/famix/src/model/famix/parameterizable_class.js +0 -30
- package/dist/lib/famix/src/model/famix/parameterizable_interface.js +0 -30
- package/dist/lib/famix/src/model/famix/parameterized_type.js +0 -36
- package/dist/lib/famix/src/model/famix/primitive_type.js +0 -16
- package/dist/lib/famix/src/model/famix/property.js +0 -44
- package/dist/lib/famix/src/model/famix/reference.js +0 -32
- package/dist/lib/famix/src/model/famix/scoping_entity.js +0 -35
- package/dist/lib/famix/src/model/famix/script_entity.js +0 -30
- package/dist/lib/famix/src/model/famix/source_anchor.js +0 -26
- package/dist/lib/famix/src/model/famix/source_language.js +0 -35
- package/dist/lib/famix/src/model/famix/sourced_entity.js +0 -59
- package/dist/lib/famix/src/model/famix/structural_entity.js +0 -38
- package/dist/lib/famix/src/model/famix/text_anchor.js +0 -37
- package/dist/lib/famix/src/model/famix/type.js +0 -71
- package/dist/lib/famix/src/model/famix/variable.js +0 -23
- package/doc-uml/metamodel-full.svg +0 -1
- package/doc-uml/metamodel.svg +0 -1
- package/jest.config-old.ts +0 -199
- package/plantuml.jar +0 -0
- 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/association.ts +0 -44
- package/src/lib/famix/src/model/famix/behavioral_entity.ts +0 -107
- 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/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/import_clause.ts +0 -53
- package/src/lib/famix/src/model/famix/indexed_file_anchor.ts +0 -71
- package/src/lib/famix/src/model/famix/inheritance.ts +0 -42
- 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 -31
- package/src/lib/famix/src/model/famix/named_entity.ts +0 -98
- package/src/lib/famix/src/model/famix/namespace.ts +0 -28
- package/src/lib/famix/src/model/famix/parameter_type.ts +0 -33
- package/src/lib/famix/src/model/famix/parameterizable_class.ts +0 -31
- package/src/lib/famix/src/model/famix/parameterizable_interface.ts +0 -31
- package/src/lib/famix/src/model/famix/parameterized_type.ts +0 -40
- package/src/lib/famix/src/model/famix/primitive_type.ts +0 -15
- package/src/lib/famix/src/model/famix/property.ts +0 -54
- package/src/lib/famix/src/model/famix/reference.ts +0 -42
- package/src/lib/famix/src/model/famix/scoping_entity.ts +0 -35
- package/src/lib/famix/src/model/famix/script_entity.ts +0 -38
- package/src/lib/famix/src/model/famix/source_anchor.ts +0 -31
- package/src/lib/famix/src/model/famix/source_language.ts +0 -37
- 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 -88
- 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 → model}/famix/entity.ts +0 -0
- /package/src/lib/famix/{src/model → model}/famix/function.ts +0 -0
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { NamedEntity } from "./named_entity";
|
|
3
|
-
import { Type } from "./type";
|
|
4
|
-
|
|
5
|
-
export class Alias extends NamedEntity {
|
|
6
|
-
|
|
7
|
-
private parentEntity: NamedEntity;
|
|
8
|
-
|
|
9
|
-
public getParentEntity(): NamedEntity {
|
|
10
|
-
return this.parentEntity;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public setParentEntity(parentEntity: NamedEntity): void {
|
|
14
|
-
this.parentEntity = parentEntity;
|
|
15
|
-
parentEntity.addAlias(this);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
private aliasedEntity: Type;
|
|
19
|
-
|
|
20
|
-
public getAliasedEntity(): Type {
|
|
21
|
-
return this.aliasedEntity;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
public setAliasedEntity(aliasedEntity: Type): void {
|
|
25
|
-
this.aliasedEntity = aliasedEntity;
|
|
26
|
-
aliasedEntity.addTypeAlias(this);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
public getJSON(): string {
|
|
31
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Alias", this);
|
|
32
|
-
this.addPropertiesToExporter(json);
|
|
33
|
-
return json.getJSON();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
37
|
-
super.addPropertiesToExporter(exporter);
|
|
38
|
-
exporter.addProperty("parentEntity", this.getParentEntity());
|
|
39
|
-
exporter.addProperty("aliasedEntity", this.getAliasedEntity());
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { SourcedEntity } from "./sourced_entity";
|
|
3
|
-
|
|
4
|
-
export class Association extends SourcedEntity {
|
|
5
|
-
|
|
6
|
-
private next: Association;
|
|
7
|
-
|
|
8
|
-
public getNext(): Association {
|
|
9
|
-
return this.next;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
public setNext(next: Association): void {
|
|
13
|
-
if (this.next === undefined) {
|
|
14
|
-
this.next = next;
|
|
15
|
-
next.setPrevious(this);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
private previous: Association;
|
|
20
|
-
|
|
21
|
-
public getPrevious(): Association {
|
|
22
|
-
return this.previous;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public setPrevious(previous: Association): void {
|
|
26
|
-
if (this.previous === undefined) {
|
|
27
|
-
this.previous = previous;
|
|
28
|
-
previous.setNext(this);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
public getJSON(): string {
|
|
34
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Association", this);
|
|
35
|
-
this.addPropertiesToExporter(json);
|
|
36
|
-
return json.getJSON();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
40
|
-
super.addPropertiesToExporter(exporter);
|
|
41
|
-
exporter.addProperty("next", this.getNext());
|
|
42
|
-
exporter.addProperty("previous", this.getPrevious());
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { Type } from "./type";
|
|
3
|
-
import { ContainerEntity } from "./container_entity";
|
|
4
|
-
import { Parameter } from "./parameter";
|
|
5
|
-
import { Invocation } from "./invocation";
|
|
6
|
-
import { ParameterType } from "./parameter_type";
|
|
7
|
-
|
|
8
|
-
export class BehavioralEntity extends ContainerEntity {
|
|
9
|
-
|
|
10
|
-
private isGeneric: boolean;
|
|
11
|
-
|
|
12
|
-
public getIsGeneric(): boolean {
|
|
13
|
-
return this.isGeneric;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public setIsGeneric(isGeneric: boolean): void {
|
|
17
|
-
this.isGeneric = isGeneric;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
private signature: string;
|
|
21
|
-
|
|
22
|
-
public getSignature(): string {
|
|
23
|
-
return this.signature;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public setSignature(signature: string): void {
|
|
27
|
-
this.signature = signature;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
private parameters: Set<Parameter> = new Set();
|
|
31
|
-
|
|
32
|
-
public getParameters(): Set<Parameter> {
|
|
33
|
-
return this.parameters;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public addParameter(parameter: Parameter): void {
|
|
37
|
-
if (!this.parameters.has(parameter)) {
|
|
38
|
-
this.parameters.add(parameter);
|
|
39
|
-
parameter.setParentEntity(this);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
private numberOfParameters: number;
|
|
44
|
-
|
|
45
|
-
public getNumberOfParameters(): number {
|
|
46
|
-
return this.numberOfParameters;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public setNumberOfParameters(numberOfParameters: number): void {
|
|
50
|
-
this.numberOfParameters = numberOfParameters;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
private incomingInvocations: Set<Invocation> = new Set();
|
|
54
|
-
|
|
55
|
-
public getIncomingInvocations(): Set<Invocation> {
|
|
56
|
-
return this.incomingInvocations;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public addIncomingInvocation(incomingInvocation: Invocation): void {
|
|
60
|
-
if (!this.incomingInvocations.has(incomingInvocation)) {
|
|
61
|
-
this.incomingInvocations.add(incomingInvocation);
|
|
62
|
-
incomingInvocation.addCandidate(this);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
private declaredType: Type;
|
|
67
|
-
|
|
68
|
-
public getDeclaredType(): Type {
|
|
69
|
-
return this.declaredType;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
public setDeclaredType(declaredType: Type): void {
|
|
73
|
-
this.declaredType = declaredType;
|
|
74
|
-
declaredType.addBehavioralEntityWithDeclaredType(this);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
private typeParameters: Set<ParameterType> = new Set();
|
|
78
|
-
|
|
79
|
-
public getParameterTypes(): Set<ParameterType> {
|
|
80
|
-
return this.typeParameters;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
public addParameterType(typeParameter: ParameterType): void {
|
|
84
|
-
if (!this.typeParameters.has(typeParameter)) {
|
|
85
|
-
this.typeParameters.add(typeParameter);
|
|
86
|
-
typeParameter.setParentGeneric(this);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
public getJSON(): string {
|
|
92
|
-
const json: FamixJSONExporter = new FamixJSONExporter("BehavioralEntity", this);
|
|
93
|
-
this.addPropertiesToExporter(json);
|
|
94
|
-
return json.getJSON();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
98
|
-
super.addPropertiesToExporter(exporter);
|
|
99
|
-
exporter.addProperty("isGeneric", this.getIsGeneric());
|
|
100
|
-
exporter.addProperty("signature", this.getSignature());
|
|
101
|
-
exporter.addProperty("parameters", this.getParameters());
|
|
102
|
-
exporter.addProperty("numberOfParameters", this.getNumberOfParameters());
|
|
103
|
-
exporter.addProperty("incomingInvocations", this.getIncomingInvocations());
|
|
104
|
-
exporter.addProperty("declaredType", this.getDeclaredType());
|
|
105
|
-
exporter.addProperty("typeParameters", this.getParameterTypes());
|
|
106
|
-
}
|
|
107
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
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 Class extends Type {
|
|
8
|
-
|
|
9
|
-
private isAbstract: boolean;
|
|
10
|
-
|
|
11
|
-
public getIsAbstract(): boolean {
|
|
12
|
-
return this.isAbstract;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public setIsAbstract(isAbstract: boolean): void {
|
|
16
|
-
this.isAbstract = isAbstract;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
private properties: Set<Property> = new Set();
|
|
20
|
-
|
|
21
|
-
public getProperties(): Set<Property> {
|
|
22
|
-
return this.properties;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public addProperty(property: Property): void {
|
|
26
|
-
if (!this.properties.has(property)) {
|
|
27
|
-
this.properties.add(property);
|
|
28
|
-
property.setParentEntity(this);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
private methods: Set<Method> = new Set();
|
|
33
|
-
|
|
34
|
-
public getMethods(): Set<Method> {
|
|
35
|
-
return this.methods;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public addMethod(method: Method): void {
|
|
39
|
-
if (!this.methods.has(method)) {
|
|
40
|
-
this.methods.add(method);
|
|
41
|
-
method.setParentEntity(this);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
private superInheritances: Set<Inheritance> = new Set();
|
|
46
|
-
|
|
47
|
-
public getSuperInheritances(): Set<Inheritance> {
|
|
48
|
-
return this.superInheritances;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public addSuperInheritance(superInheritance: Inheritance): void {
|
|
52
|
-
if (!this.superInheritances.has(superInheritance)) {
|
|
53
|
-
this.superInheritances.add(superInheritance);
|
|
54
|
-
superInheritance.setSubclass(this);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
private subInheritances: Set<Inheritance> = new Set();
|
|
59
|
-
|
|
60
|
-
public getSubInheritances(): Set<Inheritance> {
|
|
61
|
-
return this.subInheritances;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public addSubInheritance(subInheritance: Inheritance): void {
|
|
65
|
-
if (!this.subInheritances.has(subInheritance)) {
|
|
66
|
-
this.subInheritances.add(subInheritance);
|
|
67
|
-
subInheritance.setSuperclass(this);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
public getJSON(): string {
|
|
73
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Class", this);
|
|
74
|
-
this.addPropertiesToExporter(json);
|
|
75
|
-
return json.getJSON();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
79
|
-
super.addPropertiesToExporter(exporter);
|
|
80
|
-
exporter.addProperty("isAbstract", this.getIsAbstract());
|
|
81
|
-
exporter.addProperty("attributes", this.getProperties()); // Moose (10) codes them as attributes
|
|
82
|
-
exporter.addProperty("methods", this.getMethods());
|
|
83
|
-
exporter.addProperty("superInheritances", this.getSuperInheritances());
|
|
84
|
-
exporter.addProperty("subInheritances", this.getSubInheritances());
|
|
85
|
-
}
|
|
86
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
public getIsJSDoc(): boolean {
|
|
9
|
-
return this.isJSDoc;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
public setIsJSDoc(isJSDoc: boolean): void {
|
|
13
|
-
this.isJSDoc = isJSDoc;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
private container: SourcedEntity;
|
|
17
|
-
|
|
18
|
-
public getContainer(): SourcedEntity {
|
|
19
|
-
return this.container;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public setContainer(container: SourcedEntity): void {
|
|
23
|
-
this.container = container;
|
|
24
|
-
container.addComment(this);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
private content: string;
|
|
28
|
-
|
|
29
|
-
public getContent(): string {
|
|
30
|
-
return this.content;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public setContent(content: string): void {
|
|
34
|
-
this.content = content;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
public getJSON(): string {
|
|
39
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Comment", this);
|
|
40
|
-
this.addPropertiesToExporter(json);
|
|
41
|
-
return json.getJSON();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
45
|
-
super.addPropertiesToExporter(exporter);
|
|
46
|
-
exporter.addProperty("isJSDoc", this.getIsJSDoc());
|
|
47
|
-
exporter.addProperty("container", this.getContainer());
|
|
48
|
-
exporter.addProperty("content", this.getContent());
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
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
|
-
|
|
14
|
-
public getParentContainerEntity(): ContainerEntity {
|
|
15
|
-
return this.parentContainerEntity;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public setParentContainerEntity(parentContainerEntity: ContainerEntity): void {
|
|
19
|
-
this.parentContainerEntity = parentContainerEntity;
|
|
20
|
-
parentContainerEntity.addChildContainerEntity(this);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
private childrenContainerEntities: Set<ContainerEntity> = new Set();
|
|
24
|
-
|
|
25
|
-
public getChildrenContainerEntities(): Set<ContainerEntity> {
|
|
26
|
-
return this.childrenContainerEntities;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
public addChildContainerEntity(childContainerEntity: ContainerEntity): void {
|
|
30
|
-
if (!this.childrenContainerEntities.has(childContainerEntity)) {
|
|
31
|
-
this.childrenContainerEntities.add(childContainerEntity);
|
|
32
|
-
childContainerEntity.setParentContainerEntity(this);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
private cyclomaticComplexity: number;
|
|
37
|
-
|
|
38
|
-
public getCyclomaticComplexity(): number {
|
|
39
|
-
return this.cyclomaticComplexity;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
public setCyclomaticComplexity(cyclomaticComplexity: number): void {
|
|
43
|
-
this.cyclomaticComplexity = cyclomaticComplexity;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
private numberOfStatements: number;
|
|
47
|
-
|
|
48
|
-
public getNumberOfStatements(): number {
|
|
49
|
-
return this.numberOfStatements;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public setNumberOfStatements(numberOfStatements: number): void {
|
|
53
|
-
this.numberOfStatements = numberOfStatements;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
private outgoingReferences: Set<Reference> = new Set();
|
|
57
|
-
|
|
58
|
-
public getOutgoingReferences(): Set<Reference> {
|
|
59
|
-
return this.outgoingReferences;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public addOutgoingReference(outgoingReference: Reference): void {
|
|
63
|
-
if (!this.outgoingReferences.has(outgoingReference)) {
|
|
64
|
-
this.outgoingReferences.add(outgoingReference);
|
|
65
|
-
outgoingReference.setSource(this);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
private numberOfLinesOfCode: number;
|
|
70
|
-
|
|
71
|
-
public getNumberOfLinesOfCode(): number {
|
|
72
|
-
return this.numberOfLinesOfCode;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public setNumberOfLinesOfCode(numberOfLinesOfCode: number): void {
|
|
76
|
-
this.numberOfLinesOfCode = numberOfLinesOfCode;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
private outgoingInvocations: Set<Invocation> = new Set();
|
|
80
|
-
|
|
81
|
-
public getOutgoingInvocations(): Set<Invocation> {
|
|
82
|
-
return this.outgoingInvocations;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public addOutgoingInvocation(outgoingInvocation: Invocation): void {
|
|
86
|
-
if (!this.outgoingInvocations.has(outgoingInvocation)) {
|
|
87
|
-
this.outgoingInvocations.add(outgoingInvocation);
|
|
88
|
-
outgoingInvocation.setSender(this);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
private accesses: Set<Access> = new Set();
|
|
93
|
-
|
|
94
|
-
public getAccesses(): Set<Access> {
|
|
95
|
-
return this.accesses;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
public addAccess(access: Access): void {
|
|
99
|
-
if (!this.accesses.has(access)) {
|
|
100
|
-
this.accesses.add(access);
|
|
101
|
-
access.setAccessor(this);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
private childrenTypes: Set<Type> = new Set();
|
|
106
|
-
|
|
107
|
-
public getTypes(): Set<Type> {
|
|
108
|
-
return this.childrenTypes;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
public addType(childType: Type): void {
|
|
112
|
-
if (!this.childrenTypes.has(childType)) {
|
|
113
|
-
this.childrenTypes.add(childType);
|
|
114
|
-
childType.setParentContainerEntity(this);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
private childrenFunctions: Set<FamixFunctionEntity> = new Set();
|
|
119
|
-
|
|
120
|
-
public getFunctions(): Set<FamixFunctionEntity> {
|
|
121
|
-
return this.childrenFunctions;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
public addFunction(childFunction: FamixFunctionEntity): void {
|
|
125
|
-
if (!this.childrenFunctions.has(childFunction)) {
|
|
126
|
-
this.childrenFunctions.add(childFunction);
|
|
127
|
-
childFunction.setParentContainerEntity(this);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
private variables: Set<Variable> = new Set();
|
|
132
|
-
|
|
133
|
-
public getVariables(): Set<Variable> {
|
|
134
|
-
return this.variables;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
public addVariable(variable: Variable): void {
|
|
138
|
-
if (!this.variables.has(variable)) {
|
|
139
|
-
this.variables.add(variable);
|
|
140
|
-
variable.setParentContainerEntity(this);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
public getJSON(): string {
|
|
146
|
-
const json: FamixJSONExporter = new FamixJSONExporter("ContainerEntity", this);
|
|
147
|
-
this.addPropertiesToExporter(json);
|
|
148
|
-
return json.getJSON();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
152
|
-
super.addPropertiesToExporter(exporter);
|
|
153
|
-
exporter.addProperty("parentBehaviouralEntity", this.getParentContainerEntity());
|
|
154
|
-
exporter.addProperty("childrenContainerEntities", this.getChildrenContainerEntities());
|
|
155
|
-
exporter.addProperty("cyclomaticComplexity", this.getCyclomaticComplexity());
|
|
156
|
-
exporter.addProperty("numberOfStatements", this.getNumberOfStatements());
|
|
157
|
-
exporter.addProperty("outgoingReferences", this.getOutgoingReferences());
|
|
158
|
-
exporter.addProperty("numberOfLinesOfCode", this.getNumberOfLinesOfCode());
|
|
159
|
-
exporter.addProperty("outgoingInvocations", this.getOutgoingInvocations());
|
|
160
|
-
exporter.addProperty("accesses", this.getAccesses());
|
|
161
|
-
exporter.addProperty("types", this.getTypes());
|
|
162
|
-
exporter.addProperty("functions", this.getFunctions());
|
|
163
|
-
exporter.addProperty("variables", this.getVariables());
|
|
164
|
-
}
|
|
165
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
public getDecoratorExpression(): string {
|
|
9
|
-
return this.decoratorExpression;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
public setDecoratorExpression(decoratorExpression: string) {
|
|
13
|
-
this.decoratorExpression = decoratorExpression;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
private decoratedEntity: NamedEntity;
|
|
17
|
-
|
|
18
|
-
public getDecoratedEntity(): NamedEntity {
|
|
19
|
-
return this.decoratedEntity;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public setDecoratedEntity(decoratedEntity: NamedEntity): void {
|
|
23
|
-
this.decoratedEntity = decoratedEntity;
|
|
24
|
-
decoratedEntity.addDecorator(this);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
public getJSON(): string {
|
|
29
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Decorator", this);
|
|
30
|
-
this.addPropertiesToExporter(json);
|
|
31
|
-
return json.getJSON();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
35
|
-
super.addPropertiesToExporter(exporter);
|
|
36
|
-
exporter.addProperty("decoratorExpression", this.getDecoratorExpression());
|
|
37
|
-
exporter.addProperty("decoratedEntity", this.getDecoratedEntity());
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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 getValues(): Set<EnumValue> {
|
|
10
|
-
return this.values;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public addValue(value: EnumValue): void {
|
|
14
|
-
if (!this.values.has(value)) {
|
|
15
|
-
this.values.add(value);
|
|
16
|
-
value.setParentEntity(this);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
public getJSON(): string {
|
|
22
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Enum", this);
|
|
23
|
-
this.addPropertiesToExporter(json);
|
|
24
|
-
return json.getJSON();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
28
|
-
super.addPropertiesToExporter(exporter);
|
|
29
|
-
exporter.addProperty("values", this.getValues());
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { StructuralEntity } from "./structural_entity";
|
|
3
|
-
import { Enum } from "./enum";
|
|
4
|
-
|
|
5
|
-
export class EnumValue extends StructuralEntity {
|
|
6
|
-
|
|
7
|
-
private parentEntity: Enum;
|
|
8
|
-
|
|
9
|
-
public getParentEntity(): Enum {
|
|
10
|
-
return this.parentEntity;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public setParentEntity(parentEntity: Enum): void {
|
|
14
|
-
this.parentEntity = parentEntity;
|
|
15
|
-
parentEntity.addValue(this);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
public getJSON(): string {
|
|
20
|
-
const json: FamixJSONExporter = new FamixJSONExporter("EnumValue", this);
|
|
21
|
-
this.addPropertiesToExporter(json);
|
|
22
|
-
return json.getJSON();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
26
|
-
super.addPropertiesToExporter(exporter);
|
|
27
|
-
exporter.addProperty("parentEntity", this.getParentEntity());
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { Association } from "./association";
|
|
3
|
-
import { Module } from "./module";
|
|
4
|
-
import { NamedEntity } from "./named_entity";
|
|
5
|
-
|
|
6
|
-
export class ImportClause extends Association {
|
|
7
|
-
|
|
8
|
-
private importingEntity: Module;
|
|
9
|
-
|
|
10
|
-
public getImportingEntity(): Module {
|
|
11
|
-
return this.importingEntity;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public setImportingEntity(importer: Module): void {
|
|
15
|
-
this.importingEntity = importer;
|
|
16
|
-
importer.addOutgoingImport(this); // opposite
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
private importedEntity: NamedEntity;
|
|
20
|
-
|
|
21
|
-
public getImportedEntity(): NamedEntity {
|
|
22
|
-
return this.importedEntity;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public setImportedEntity(importedEntity: NamedEntity): void {
|
|
26
|
-
this.importedEntity = importedEntity;
|
|
27
|
-
importedEntity.addIncomingImport(this); // incomingImports in Famix TImportable/TImport
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
private moduleSpecifier: string;
|
|
31
|
-
|
|
32
|
-
public getModuleSpecifier(): string {
|
|
33
|
-
return this.moduleSpecifier;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public setModuleSpecifier(moduleSpecifier: string): void {
|
|
37
|
-
this.moduleSpecifier = moduleSpecifier;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
public getJSON(): string {
|
|
42
|
-
const json: FamixJSONExporter = new FamixJSONExporter("ImportClause", this);
|
|
43
|
-
this.addPropertiesToExporter(json);
|
|
44
|
-
return json.getJSON();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
48
|
-
super.addPropertiesToExporter(exporter);
|
|
49
|
-
exporter.addProperty("importingEntity", this.getImportingEntity());
|
|
50
|
-
exporter.addProperty("importedEntity", this.getImportedEntity());
|
|
51
|
-
exporter.addProperty("moduleSpecifier", this.getModuleSpecifier());
|
|
52
|
-
}
|
|
53
|
-
}
|