ts2famix 1.0.12 → 1.0.14
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 +23 -23
- package/README.md +109 -109
- package/dist/analyze.js +107 -0
- package/dist/analyze_functions/processAccesses.js +55 -0
- package/dist/analyze_functions/processFiles.js +554 -0
- package/dist/analyze_functions/processImportClauses.js +70 -0
- package/dist/analyze_functions/processInheritances.js +73 -0
- package/dist/analyze_functions/processInvocations.js +49 -0
- package/dist/famix2puml.js +125 -0
- package/dist/famix_functions/famix_functions.js +520 -0
- package/dist/famix_functions/famix_functions_associations.js +213 -0
- package/dist/famix_functions/famix_functions_index.js +62 -0
- package/dist/famix_functions/famix_functions_types.js +114 -0
- package/dist/fqn.js +126 -0
- package/dist/lib/famix/src/famix_JSON_exporter.js +54 -0
- package/dist/lib/famix/src/famix_base_element.js +13 -0
- package/dist/lib/famix/src/famix_repository.js +187 -0
- package/dist/lib/famix/src/index.js +30 -0
- package/dist/lib/famix/src/model/famix/access.js +39 -0
- package/dist/lib/famix/src/model/famix/accessor.js +16 -0
- package/dist/lib/famix/src/model/famix/alias.js +32 -0
- package/dist/lib/famix/src/model/famix/association.js +36 -0
- package/dist/lib/famix/src/model/famix/behavioral_entity.js +81 -0
- package/dist/lib/famix/src/model/famix/c_source_language.js +16 -0
- package/dist/lib/famix/src/model/famix/class.js +70 -0
- package/dist/lib/famix/src/model/famix/comment.js +38 -0
- package/dist/lib/famix/src/model/famix/container_entity.js +125 -0
- package/dist/lib/famix/src/model/famix/custom_source_language.js +23 -0
- package/dist/lib/famix/src/model/famix/decorator.js +31 -0
- package/dist/lib/famix/src/model/famix/entity.js +16 -0
- package/dist/lib/famix/src/model/famix/enum.js +30 -0
- package/dist/lib/famix/src/model/famix/enum_value.js +24 -0
- package/dist/lib/famix/src/model/famix/function.js +16 -0
- package/dist/lib/famix/src/model/famix/implicit_variable.js +16 -0
- package/dist/lib/famix/src/model/famix/import_clause.js +39 -0
- package/dist/lib/famix/src/model/famix/index.js +87 -0
- package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +37 -0
- package/dist/lib/famix/src/model/famix/inheritance.js +32 -0
- package/dist/lib/famix/src/model/famix/interface.js +63 -0
- package/dist/lib/famix/src/model/famix/invocation.js +53 -0
- package/dist/lib/famix/src/model/famix/method.js +66 -0
- package/dist/lib/famix/src/model/famix/module.js +30 -0
- package/dist/lib/famix/src/model/famix/named_entity.js +77 -0
- package/dist/lib/famix/src/model/famix/namespace.js +24 -0
- package/dist/lib/famix/src/model/famix/parameter.js +24 -0
- package/dist/lib/famix/src/model/famix/parameterizable_class.js +30 -0
- package/dist/lib/famix/src/model/famix/parameterizable_interface.js +30 -0
- package/dist/lib/famix/src/model/famix/parameterized_type.js +36 -0
- package/dist/lib/famix/src/model/famix/primitive_type.js +16 -0
- package/dist/lib/famix/src/model/famix/property.js +44 -0
- package/dist/lib/famix/src/model/famix/reference.js +32 -0
- package/dist/lib/famix/src/model/famix/scoping_entity.js +30 -0
- package/dist/lib/famix/src/model/famix/script_entity.js +30 -0
- package/dist/lib/famix/src/model/famix/source_anchor.js +26 -0
- package/dist/lib/famix/src/model/famix/source_language.js +30 -0
- package/dist/lib/famix/src/model/famix/sourced_entity.js +55 -0
- package/dist/lib/famix/src/model/famix/structural_entity.js +38 -0
- package/dist/lib/famix/src/model/famix/text_anchor.js +37 -0
- package/dist/lib/famix/src/model/famix/type.js +71 -0
- package/dist/lib/famix/src/model/famix/type_parameter.js +24 -0
- package/dist/lib/famix/src/model/famix/variable.js +23 -0
- package/dist/lib/ts-complex/cyclomatic-service.js +83 -0
- package/dist/ts2famix-cli.js +63 -0
- package/dist/ts2famix-tsconfig.js +53 -0
- package/jest.config-old.ts +199 -199
- package/package.json +47 -47
- package/src/analyze.ts +94 -94
- package/src/analyze_functions/processAccesses.ts +57 -57
- package/src/analyze_functions/processFiles.ts +669 -669
- package/src/analyze_functions/processImportClauses.ts +77 -77
- package/src/analyze_functions/processInheritances.ts +84 -84
- package/src/analyze_functions/processInvocations.ts +51 -51
- package/src/famix2puml.ts +119 -119
- package/src/famix_functions/famix_functions.ts +559 -559
- package/src/famix_functions/famix_functions_associations.ts +215 -215
- package/src/famix_functions/famix_functions_index.ts +44 -44
- package/src/famix_functions/famix_functions_types.ts +105 -105
- package/src/generate_uml.sh +16 -16
- package/src/lib/famix/License.md +22 -22
- package/src/lib/famix/package-lock.json +301 -301
- package/src/lib/famix/package.json +27 -27
- package/src/lib/famix/readme.md +4 -4
- package/src/lib/famix/src/famix_JSON_exporter.ts +56 -56
- package/src/lib/famix/src/famix_base_element.ts +18 -18
- package/src/lib/famix/src/famix_repository.ts +199 -199
- package/src/lib/famix/src/index.ts +8 -8
- package/src/lib/famix/src/model/famix/access.ts +53 -53
- package/src/lib/famix/src/model/famix/accessor.ts +15 -15
- package/src/lib/famix/src/model/famix/alias.ts +41 -41
- package/src/lib/famix/src/model/famix/association.ts +44 -44
- package/src/lib/famix/src/model/famix/behavioral_entity.ts +107 -107
- package/src/lib/famix/src/model/famix/c_source_language.ts +15 -15
- package/src/lib/famix/src/model/famix/class.ts +86 -86
- package/src/lib/famix/src/model/famix/comment.ts +50 -50
- package/src/lib/famix/src/model/famix/container_entity.ts +165 -165
- package/src/lib/famix/src/model/famix/custom_source_language.ts +27 -27
- package/src/lib/famix/src/model/famix/decorator.ts +39 -39
- package/src/lib/famix/src/model/famix/entity.ts +15 -15
- package/src/lib/famix/src/model/famix/enum.ts +31 -31
- package/src/lib/famix/src/model/famix/enum_value.ts +29 -29
- package/src/lib/famix/src/model/famix/function.ts +15 -15
- package/src/lib/famix/src/model/famix/implicit_variable.ts +15 -15
- package/src/lib/famix/src/model/famix/import_clause.ts +53 -53
- package/src/lib/famix/src/model/famix/index.ts +42 -42
- package/src/lib/famix/src/model/famix/indexed_file_anchor.ts +49 -49
- package/src/lib/famix/src/model/famix/inheritance.ts +42 -42
- package/src/lib/famix/src/model/famix/interface.ts +75 -75
- package/src/lib/famix/src/model/famix/invocation.ts +68 -68
- package/src/lib/famix/src/model/famix/method.ts +96 -96
- package/src/lib/famix/src/model/famix/module.ts +31 -31
- package/src/lib/famix/src/model/famix/named_entity.ts +98 -98
- package/src/lib/famix/src/model/famix/namespace.ts +28 -28
- package/src/lib/famix/src/model/famix/parameter.ts +29 -29
- package/src/lib/famix/src/model/famix/parameterizable_class.ts +31 -31
- package/src/lib/famix/src/model/famix/parameterizable_interface.ts +31 -31
- package/src/lib/famix/src/model/famix/parameterized_type.ts +40 -40
- package/src/lib/famix/src/model/famix/primitive_type.ts +15 -15
- package/src/lib/famix/src/model/famix/property.ts +54 -54
- package/src/lib/famix/src/model/famix/reference.ts +42 -42
- package/src/lib/famix/src/model/famix/scoping_entity.ts +31 -31
- package/src/lib/famix/src/model/famix/script_entity.ts +38 -38
- package/src/lib/famix/src/model/famix/source_anchor.ts +31 -31
- package/src/lib/famix/src/model/famix/source_language.ts +31 -31
- package/src/lib/famix/src/model/famix/sourced_entity.ts +70 -70
- package/src/lib/famix/src/model/famix/structural_entity.ts +44 -44
- package/src/lib/famix/src/model/famix/text_anchor.ts +49 -49
- package/src/lib/famix/src/model/famix/type.ts +88 -88
- package/src/lib/famix/src/model/famix/type_parameter.ts +33 -33
- package/src/lib/famix/src/model/famix/variable.ts +28 -28
- package/src/lib/famix/tsconfig.json +26 -26
- package/src/lib/famix/tslint.json +14 -14
- package/src/lib/ts-complex/cyclomatic-service.ts +85 -85
- package/src/ts2famix-cli.ts +39 -39
- package/tsconfig.json +69 -69
|
@@ -1,86 +1,86 @@
|
|
|
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 mse: FamixJSONExporter = new FamixJSONExporter("Class", this);
|
|
74
|
-
this.addPropertiesToExporter(mse);
|
|
75
|
-
return mse.getJSON();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
79
|
-
super.addPropertiesToExporter(exporter);
|
|
80
|
-
exporter.addProperty("isAbstract", this.getIsAbstract());
|
|
81
|
-
exporter.addProperty("properties", this.getProperties());
|
|
82
|
-
exporter.addProperty("methods", this.getMethods());
|
|
83
|
-
exporter.addProperty("superInheritances", this.getSuperInheritances());
|
|
84
|
-
exporter.addProperty("subInheritances", this.getSubInheritances());
|
|
85
|
-
}
|
|
86
|
-
}
|
|
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 mse: FamixJSONExporter = new FamixJSONExporter("Class", this);
|
|
74
|
+
this.addPropertiesToExporter(mse);
|
|
75
|
+
return mse.getJSON();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
79
|
+
super.addPropertiesToExporter(exporter);
|
|
80
|
+
exporter.addProperty("isAbstract", this.getIsAbstract());
|
|
81
|
+
exporter.addProperty("properties", this.getProperties());
|
|
82
|
+
exporter.addProperty("methods", this.getMethods());
|
|
83
|
+
exporter.addProperty("superInheritances", this.getSuperInheritances());
|
|
84
|
+
exporter.addProperty("subInheritances", this.getSubInheritances());
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
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 mse: FamixJSONExporter = new FamixJSONExporter("Comment", this);
|
|
40
|
-
this.addPropertiesToExporter(mse);
|
|
41
|
-
return mse.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
|
+
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 mse: FamixJSONExporter = new FamixJSONExporter("Comment", this);
|
|
40
|
+
this.addPropertiesToExporter(mse);
|
|
41
|
+
return mse.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 +1,165 @@
|
|
|
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 mse: FamixJSONExporter = new FamixJSONExporter("ContainerEntity", this);
|
|
147
|
-
this.addPropertiesToExporter(mse);
|
|
148
|
-
return mse.getJSON();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
152
|
-
super.addPropertiesToExporter(exporter);
|
|
153
|
-
exporter.addProperty("parentContainerEntity", 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
|
+
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 mse: FamixJSONExporter = new FamixJSONExporter("ContainerEntity", this);
|
|
147
|
+
this.addPropertiesToExporter(mse);
|
|
148
|
+
return mse.getJSON();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
152
|
+
super.addPropertiesToExporter(exporter);
|
|
153
|
+
exporter.addProperty("parentContainerEntity", 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,27 +1,27 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { SourceLanguage } from "./source_language";
|
|
3
|
-
|
|
4
|
-
export class CustomSourceLanguage extends SourceLanguage {
|
|
5
|
-
|
|
6
|
-
private languageName: string;
|
|
7
|
-
|
|
8
|
-
public getLanguageName(): string {
|
|
9
|
-
return this.languageName;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
public setLanguageName(languageName: string): void {
|
|
13
|
-
this.languageName = languageName;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
public getJSON(): string {
|
|
18
|
-
const mse: FamixJSONExporter = new FamixJSONExporter("CustomSourceLanguage", this);
|
|
19
|
-
this.addPropertiesToExporter(mse);
|
|
20
|
-
return mse.getJSON();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
24
|
-
super.addPropertiesToExporter(exporter);
|
|
25
|
-
exporter.addProperty("languageName", this.getLanguageName());
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { SourceLanguage } from "./source_language";
|
|
3
|
+
|
|
4
|
+
export class CustomSourceLanguage extends SourceLanguage {
|
|
5
|
+
|
|
6
|
+
private languageName: string;
|
|
7
|
+
|
|
8
|
+
public getLanguageName(): string {
|
|
9
|
+
return this.languageName;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public setLanguageName(languageName: string): void {
|
|
13
|
+
this.languageName = languageName;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
public getJSON(): string {
|
|
18
|
+
const mse: FamixJSONExporter = new FamixJSONExporter("CustomSourceLanguage", this);
|
|
19
|
+
this.addPropertiesToExporter(mse);
|
|
20
|
+
return mse.getJSON();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
24
|
+
super.addPropertiesToExporter(exporter);
|
|
25
|
+
exporter.addProperty("languageName", this.getLanguageName());
|
|
26
|
+
}
|
|
27
|
+
}
|