ts2famix 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.eslintrc.json +24 -24
  2. package/LICENSE +23 -23
  3. package/README.md +109 -109
  4. package/jest.config-old.ts +199 -199
  5. package/package.json +47 -47
  6. package/src/analyze.ts +94 -94
  7. package/src/analyze_functions/processAccesses.ts +57 -57
  8. package/src/analyze_functions/processFiles.ts +669 -661
  9. package/src/analyze_functions/processImportClauses.ts +77 -77
  10. package/src/analyze_functions/processInheritances.ts +84 -84
  11. package/src/analyze_functions/processInvocations.ts +51 -51
  12. package/src/famix2puml.ts +119 -119
  13. package/src/famix_functions/famix_functions.ts +559 -555
  14. package/src/famix_functions/famix_functions_associations.ts +215 -215
  15. package/src/famix_functions/famix_functions_index.ts +44 -44
  16. package/src/famix_functions/famix_functions_types.ts +105 -100
  17. package/src/generate_uml.sh +16 -16
  18. package/src/lib/famix/License.md +22 -22
  19. package/src/lib/famix/package-lock.json +301 -301
  20. package/src/lib/famix/package.json +27 -27
  21. package/src/lib/famix/readme.md +4 -4
  22. package/src/lib/famix/src/famix_JSON_exporter.ts +56 -56
  23. package/src/lib/famix/src/famix_base_element.ts +18 -18
  24. package/src/lib/famix/src/famix_repository.ts +199 -199
  25. package/src/lib/famix/src/index.ts +8 -8
  26. package/src/lib/famix/src/model/famix/access.ts +53 -53
  27. package/src/lib/famix/src/model/famix/accessor.ts +15 -15
  28. package/src/lib/famix/src/model/famix/alias.ts +41 -41
  29. package/src/lib/famix/src/model/famix/association.ts +44 -44
  30. package/src/lib/famix/src/model/famix/behavioral_entity.ts +107 -107
  31. package/src/lib/famix/src/model/famix/c_source_language.ts +15 -15
  32. package/src/lib/famix/src/model/famix/class.ts +86 -86
  33. package/src/lib/famix/src/model/famix/comment.ts +50 -50
  34. package/src/lib/famix/src/model/famix/container_entity.ts +165 -165
  35. package/src/lib/famix/src/model/famix/custom_source_language.ts +27 -27
  36. package/src/lib/famix/src/model/famix/decorator.ts +39 -39
  37. package/src/lib/famix/src/model/famix/entity.ts +15 -15
  38. package/src/lib/famix/src/model/famix/enum.ts +31 -31
  39. package/src/lib/famix/src/model/famix/enum_value.ts +29 -29
  40. package/src/lib/famix/src/model/famix/function.ts +15 -15
  41. package/src/lib/famix/src/model/famix/implicit_variable.ts +15 -15
  42. package/src/lib/famix/src/model/famix/import_clause.ts +53 -53
  43. package/src/lib/famix/src/model/famix/index.ts +42 -42
  44. package/src/lib/famix/src/model/famix/indexed_file_anchor.ts +49 -49
  45. package/src/lib/famix/src/model/famix/inheritance.ts +42 -42
  46. package/src/lib/famix/src/model/famix/interface.ts +75 -75
  47. package/src/lib/famix/src/model/famix/invocation.ts +68 -68
  48. package/src/lib/famix/src/model/famix/method.ts +96 -96
  49. package/src/lib/famix/src/model/famix/module.ts +31 -31
  50. package/src/lib/famix/src/model/famix/named_entity.ts +98 -98
  51. package/src/lib/famix/src/model/famix/namespace.ts +28 -28
  52. package/src/lib/famix/src/model/famix/parameter.ts +29 -29
  53. package/src/lib/famix/src/model/famix/parameterizable_class.ts +31 -31
  54. package/src/lib/famix/src/model/famix/parameterizable_interface.ts +31 -31
  55. package/src/lib/famix/src/model/famix/parameterized_type.ts +40 -40
  56. package/src/lib/famix/src/model/famix/primitive_type.ts +15 -15
  57. package/src/lib/famix/src/model/famix/property.ts +54 -54
  58. package/src/lib/famix/src/model/famix/reference.ts +42 -42
  59. package/src/lib/famix/src/model/famix/scoping_entity.ts +31 -31
  60. package/src/lib/famix/src/model/famix/script_entity.ts +38 -38
  61. package/src/lib/famix/src/model/famix/source_anchor.ts +31 -31
  62. package/src/lib/famix/src/model/famix/source_language.ts +31 -31
  63. package/src/lib/famix/src/model/famix/sourced_entity.ts +70 -70
  64. package/src/lib/famix/src/model/famix/structural_entity.ts +44 -44
  65. package/src/lib/famix/src/model/famix/text_anchor.ts +49 -49
  66. package/src/lib/famix/src/model/famix/type.ts +88 -88
  67. package/src/lib/famix/src/model/famix/type_parameter.ts +33 -33
  68. package/src/lib/famix/src/model/famix/variable.ts +28 -28
  69. package/src/lib/famix/tsconfig.json +26 -26
  70. package/src/lib/famix/tslint.json +14 -14
  71. package/src/lib/ts-complex/cyclomatic-service.ts +85 -85
  72. package/src/ts2famix-cli.ts +39 -39
  73. package/tsconfig.json +69 -69
  74. package/dist/analyze.js +0 -102
  75. package/dist/analyze_functions/processAccesses.js +0 -47
  76. package/dist/analyze_functions/processFiles.js +0 -540
  77. package/dist/analyze_functions/processImportClauses.js +0 -70
  78. package/dist/analyze_functions/processInheritances.js +0 -73
  79. package/dist/analyze_functions/processInvocations.js +0 -49
  80. package/dist/famix2puml.js +0 -125
  81. package/dist/famix_functions/famix_functions.js +0 -513
  82. package/dist/famix_functions/famix_functions_associations.js +0 -205
  83. package/dist/famix_functions/famix_functions_index.js +0 -62
  84. package/dist/famix_functions/famix_functions_types.js +0 -110
  85. package/dist/fqn.js +0 -126
  86. package/dist/fqp_implementation.js +0 -73
  87. package/dist/lib/famix/src/famix_JSON_exporter.js +0 -54
  88. package/dist/lib/famix/src/famix_base_element.js +0 -13
  89. package/dist/lib/famix/src/famix_repository.js +0 -187
  90. package/dist/lib/famix/src/index.js +0 -30
  91. package/dist/lib/famix/src/model/famix/access.js +0 -39
  92. package/dist/lib/famix/src/model/famix/accessor.js +0 -16
  93. package/dist/lib/famix/src/model/famix/alias.js +0 -32
  94. package/dist/lib/famix/src/model/famix/association.js +0 -36
  95. package/dist/lib/famix/src/model/famix/behavioral_entity.js +0 -81
  96. package/dist/lib/famix/src/model/famix/c_source_language.js +0 -16
  97. package/dist/lib/famix/src/model/famix/class.js +0 -70
  98. package/dist/lib/famix/src/model/famix/comment.js +0 -38
  99. package/dist/lib/famix/src/model/famix/container_entity.js +0 -125
  100. package/dist/lib/famix/src/model/famix/custom_source_language.js +0 -23
  101. package/dist/lib/famix/src/model/famix/decorator.js +0 -31
  102. package/dist/lib/famix/src/model/famix/entity.js +0 -16
  103. package/dist/lib/famix/src/model/famix/enum.js +0 -30
  104. package/dist/lib/famix/src/model/famix/enum_value.js +0 -24
  105. package/dist/lib/famix/src/model/famix/function.js +0 -16
  106. package/dist/lib/famix/src/model/famix/implicit_variable.js +0 -16
  107. package/dist/lib/famix/src/model/famix/import_clause.js +0 -39
  108. package/dist/lib/famix/src/model/famix/index.js +0 -87
  109. package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +0 -37
  110. package/dist/lib/famix/src/model/famix/inheritance.js +0 -32
  111. package/dist/lib/famix/src/model/famix/interface.js +0 -63
  112. package/dist/lib/famix/src/model/famix/invocation.js +0 -53
  113. package/dist/lib/famix/src/model/famix/method.js +0 -66
  114. package/dist/lib/famix/src/model/famix/module.js +0 -30
  115. package/dist/lib/famix/src/model/famix/named_entity.js +0 -77
  116. package/dist/lib/famix/src/model/famix/namespace.js +0 -24
  117. package/dist/lib/famix/src/model/famix/parameter.js +0 -24
  118. package/dist/lib/famix/src/model/famix/parameterizable_class.js +0 -30
  119. package/dist/lib/famix/src/model/famix/parameterizable_interface.js +0 -30
  120. package/dist/lib/famix/src/model/famix/parameterized_type.js +0 -36
  121. package/dist/lib/famix/src/model/famix/primitive_type.js +0 -16
  122. package/dist/lib/famix/src/model/famix/property.js +0 -44
  123. package/dist/lib/famix/src/model/famix/reference.js +0 -32
  124. package/dist/lib/famix/src/model/famix/scoping_entity.js +0 -30
  125. package/dist/lib/famix/src/model/famix/script_entity.js +0 -30
  126. package/dist/lib/famix/src/model/famix/source_anchor.js +0 -26
  127. package/dist/lib/famix/src/model/famix/source_language.js +0 -30
  128. package/dist/lib/famix/src/model/famix/sourced_entity.js +0 -55
  129. package/dist/lib/famix/src/model/famix/structural_entity.js +0 -38
  130. package/dist/lib/famix/src/model/famix/text_anchor.js +0 -37
  131. package/dist/lib/famix/src/model/famix/type.js +0 -71
  132. package/dist/lib/famix/src/model/famix/type_parameter.js +0 -24
  133. package/dist/lib/famix/src/model/famix/variable.js +0 -23
  134. package/dist/lib/ts-complex/cyclomatic-service.js +0 -83
  135. package/dist/ts2famix-cli.js +0 -63
  136. package/dist/ts2famix-tsconfig.js +0 -53
  137. package/metrics.ts +0 -23
  138. package/output.debug.txt +0 -1351
  139. package/src/fqp_implementation.ts +0 -66
@@ -1,187 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FamixRepository = void 0;
4
- const famix_1 = require("./model/famix");
5
- /**
6
- * This class is used to store all Famix elements
7
- */
8
- class FamixRepository {
9
- constructor() {
10
- this.elements = new Set(); // All Famix elements
11
- this.famixClasses = new Set(); // All Famix classes
12
- this.famixInterfaces = new Set(); // All Famix interfaces
13
- this.famixNamespaces = new Set(); // All Famix namespaces
14
- this.famixMethods = new Set(); // All Famix methods
15
- this.famixFunctions = new Set(); // All Famix functions
16
- this.famixFiles = new Set(); // All Famix files
17
- this.idCounter = 1; // Id counter
18
- }
19
- /**
20
- * Gets a Famix entity by id
21
- * @param id An id of a Famix entity
22
- * @returns The Famix entity corresponding to the id or undefined if it doesn't exist
23
- */
24
- getFamixEntityById(id) {
25
- const entity = Array.from(this.elements.values()).find(e => e.id === id);
26
- return entity;
27
- }
28
- /**
29
- * Gets a Famix entity by fully qualified name
30
- * @param fullyQualifiedName A fully qualified name
31
- * @returns The Famix entity corresponding to the fully qualified name or undefined if it doesn't exist
32
- */
33
- getFamixEntityByFullyQualifiedName(fullyQualifiedName) {
34
- const allEntities = Array.from(this.elements.values()).filter(e => e instanceof famix_1.NamedEntity);
35
- const entity = allEntities.find(e => e.getFullyQualifiedName() === fullyQualifiedName);
36
- return entity;
37
- }
38
- // Only for tests
39
- /**
40
- * Gets all Famix entities
41
- * @returns All Famix entities
42
- */
43
- _getAllEntities() {
44
- return new Set(Array.from(this.elements.values()));
45
- }
46
- /**
47
- * Gets all Famix entities of a given type
48
- * @param theType A type of Famix entity
49
- * @returns All Famix entities of the given type
50
- */
51
- _getAllEntitiesWithType(theType) {
52
- return new Set(Array.from(this.elements.values()).filter(e => e.constructor.name === theType));
53
- }
54
- /**
55
- * Gets a Famix class by name
56
- * @param name A class name
57
- * @returns The Famix class corresponding to the name or undefined if it doesn't exist
58
- */
59
- _getFamixClass(name) {
60
- return Array.from(this.famixClasses.values()).find(ns => ns.getName() === name);
61
- }
62
- /**
63
- * Gets a Famix interface by name
64
- * @param name An interface name
65
- * @returns The Famix interface corresponding to the name or undefined if it doesn't exist
66
- */
67
- _getFamixInterface(name) {
68
- return Array.from(this.famixInterfaces.values()).find(ns => ns.getName() === name);
69
- }
70
- /**
71
- * Gets a Famix method by name
72
- * @param name A method name
73
- * @returns The Famix method corresponding to the name or undefined if it doesn't exist
74
- */
75
- _getFamixMethod(name) {
76
- return Array.from(this.famixMethods.values()).find(ns => ns.getName() === name);
77
- }
78
- /**
79
- * Gets a Famix function by name
80
- * @param name A function name
81
- * @returns The Famix function corresponding to the name or undefined if it doesn't exist
82
- */
83
- _getFamixFunction(name) {
84
- return Array.from(this.famixFunctions.values()).find(ns => ns.getName() === name);
85
- }
86
- /**
87
- * Gets a Famix namespace by name
88
- * @param name A namespace name
89
- * @returns The Famix namespace corresponding to the name or undefined if it doesn't exist
90
- */
91
- _getFamixNamespace(name) {
92
- return Array.from(this.famixNamespaces.values()).find(ns => ns.getName() === name);
93
- }
94
- /**
95
- * Gets all Famix namespaces
96
- * @returns All Famix namespaces
97
- */
98
- _getFamixNamespaces() {
99
- return new Set(Array.from(this.famixNamespaces.values()));
100
- }
101
- /**
102
- * Gets a Famix file by name
103
- * @param name A file name
104
- * @returns The Famix file corresponding to the name or undefined if it doesn't exist
105
- */
106
- _getFamixFile(name) {
107
- return Array.from(this.famixFiles.values()).find(ns => ns.getName() === name);
108
- }
109
- /**
110
- * Gets all Famix files
111
- * @returns All Famix files
112
- */
113
- _getFamixFiles() {
114
- return new Set(Array.from(this.famixFiles.values()));
115
- }
116
- /**
117
- * Gets all method names as a set from a class
118
- * @param className A class name
119
- * @returns The set of class "className" method names
120
- */
121
- _methodNamesAsSetFromClass(className) {
122
- const theClass = this._getFamixClass(className);
123
- return new Set(Array.from(theClass.getMethods()).map(m => m.getName()));
124
- }
125
- /**
126
- * Gets all method parents as a set from a class
127
- * @param className A class name
128
- * @returns The set of class "className" method parents
129
- */
130
- _methodParentsAsSetFromClass(className) {
131
- const theClass = this._getFamixClass(className);
132
- return new Set(Array.from(theClass.getMethods()).map(m => m.getParentEntity()));
133
- }
134
- /**
135
- * Gets the map of Famix element ids and their Famix element from a JSON model
136
- * @param model A JSON model
137
- * @returns The map of Famix element ids and their Famix element from the JSON model
138
- */
139
- _initMapFromModel(model) {
140
- const parsedModel = JSON.parse(model);
141
- const idToElementMap = new Map();
142
- parsedModel.forEach(element => {
143
- idToElementMap.set(element.id, element);
144
- });
145
- return idToElementMap;
146
- }
147
- /**
148
- * Adds a Famix element to the repository
149
- * @param element A Famix element
150
- */
151
- addElement(element) {
152
- if (element instanceof famix_1.Class) {
153
- this.famixClasses.add(element);
154
- }
155
- else if (element instanceof famix_1.Interface) {
156
- this.famixInterfaces.add(element);
157
- }
158
- else if (element instanceof famix_1.Namespace) {
159
- this.famixNamespaces.add(element);
160
- }
161
- else if (element instanceof famix_1.Method) {
162
- this.famixMethods.add(element);
163
- }
164
- else if (element instanceof famix_1.Function) {
165
- this.famixFunctions.add(element);
166
- }
167
- else if (element instanceof famix_1.ScriptEntity || element instanceof famix_1.Module) {
168
- this.famixFiles.add(element);
169
- }
170
- this.elements.add(element);
171
- element.id = this.idCounter;
172
- this.idCounter++;
173
- }
174
- /**
175
- * Gets a JSON representation of the repository
176
- * @returns A JSON representation of the repository
177
- */
178
- getJSON() {
179
- let ret = "[";
180
- for (const element of Array.from(this.elements.values())) {
181
- ret = ret + element.getJSON() + ",";
182
- }
183
- ret = ret.substring(0, ret.length - 1);
184
- return ret + "]";
185
- }
186
- }
187
- exports.FamixRepository = FamixRepository;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- const Famix = __importStar(require("./model/famix"));
26
- const famix_base_element_1 = require("./famix_base_element");
27
- const famix_JSON_exporter_1 = require("./famix_JSON_exporter");
28
- const famix_repository_1 = require("./famix_repository");
29
- const model = { Famix };
30
- module.exports = { FamixBaseElement: famix_base_element_1.FamixBaseElement, FamixJSONExporter: famix_JSON_exporter_1.FamixJSONExporter, FamixRepository: famix_repository_1.FamixRepository, model };
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Access = void 0;
4
- const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
5
- const association_1 = require("./association");
6
- class Access extends association_1.Association {
7
- getAccessor() {
8
- return this.accessor;
9
- }
10
- setAccessor(accessor) {
11
- this.accessor = accessor;
12
- accessor.addAccess(this);
13
- }
14
- getVariable() {
15
- return this.variable;
16
- }
17
- setVariable(variable) {
18
- this.variable = variable;
19
- variable.addIncomingAccess(this);
20
- }
21
- getIsWrite() {
22
- return this.isWrite;
23
- }
24
- setIsWrite(isWrite) {
25
- this.isWrite = isWrite;
26
- }
27
- getJSON() {
28
- const mse = new famix_JSON_exporter_1.FamixJSONExporter("Access", this);
29
- this.addPropertiesToExporter(mse);
30
- return mse.getJSON();
31
- }
32
- addPropertiesToExporter(exporter) {
33
- super.addPropertiesToExporter(exporter);
34
- exporter.addProperty("accessor", this.getAccessor());
35
- exporter.addProperty("variable", this.getVariable());
36
- exporter.addProperty("isWrite", this.getIsWrite());
37
- }
38
- }
39
- exports.Access = Access;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Accessor = void 0;
4
- const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
5
- const method_1 = require("./method");
6
- class Accessor extends method_1.Method {
7
- getJSON() {
8
- const mse = new famix_JSON_exporter_1.FamixJSONExporter("Accessor", this);
9
- this.addPropertiesToExporter(mse);
10
- return mse.getJSON();
11
- }
12
- addPropertiesToExporter(exporter) {
13
- super.addPropertiesToExporter(exporter);
14
- }
15
- }
16
- exports.Accessor = Accessor;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Alias = void 0;
4
- const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
5
- const named_entity_1 = require("./named_entity");
6
- class Alias extends named_entity_1.NamedEntity {
7
- getParentEntity() {
8
- return this.parentEntity;
9
- }
10
- setParentEntity(parentEntity) {
11
- this.parentEntity = parentEntity;
12
- parentEntity.addAlias(this);
13
- }
14
- getAliasedEntity() {
15
- return this.aliasedEntity;
16
- }
17
- setAliasedEntity(aliasedEntity) {
18
- this.aliasedEntity = aliasedEntity;
19
- aliasedEntity.addTypeAlias(this);
20
- }
21
- getJSON() {
22
- const mse = new famix_JSON_exporter_1.FamixJSONExporter("Alias", this);
23
- this.addPropertiesToExporter(mse);
24
- return mse.getJSON();
25
- }
26
- addPropertiesToExporter(exporter) {
27
- super.addPropertiesToExporter(exporter);
28
- exporter.addProperty("parentEntity", this.getParentEntity());
29
- exporter.addProperty("aliasedEntity", this.getAliasedEntity());
30
- }
31
- }
32
- exports.Alias = Alias;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Association = void 0;
4
- const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
5
- const sourced_entity_1 = require("./sourced_entity");
6
- class Association extends sourced_entity_1.SourcedEntity {
7
- getNext() {
8
- return this.next;
9
- }
10
- setNext(next) {
11
- if (this.next === undefined) {
12
- this.next = next;
13
- next.setPrevious(this);
14
- }
15
- }
16
- getPrevious() {
17
- return this.previous;
18
- }
19
- setPrevious(previous) {
20
- if (this.previous === undefined) {
21
- this.previous = previous;
22
- previous.setNext(this);
23
- }
24
- }
25
- getJSON() {
26
- const mse = new famix_JSON_exporter_1.FamixJSONExporter("Association", this);
27
- this.addPropertiesToExporter(mse);
28
- return mse.getJSON();
29
- }
30
- addPropertiesToExporter(exporter) {
31
- super.addPropertiesToExporter(exporter);
32
- exporter.addProperty("next", this.getNext());
33
- exporter.addProperty("previous", this.getPrevious());
34
- }
35
- }
36
- exports.Association = Association;
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BehavioralEntity = void 0;
4
- const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
5
- const container_entity_1 = require("./container_entity");
6
- class BehavioralEntity extends container_entity_1.ContainerEntity {
7
- constructor() {
8
- super(...arguments);
9
- this.parameters = new Set();
10
- this.incomingInvocations = new Set();
11
- this.typeParameters = new Set();
12
- }
13
- getIsGeneric() {
14
- return this.isGeneric;
15
- }
16
- setIsGeneric(isGeneric) {
17
- this.isGeneric = isGeneric;
18
- }
19
- getSignature() {
20
- return this.signature;
21
- }
22
- setSignature(signature) {
23
- this.signature = signature;
24
- }
25
- getParameters() {
26
- return this.parameters;
27
- }
28
- addParameter(parameter) {
29
- if (!this.parameters.has(parameter)) {
30
- this.parameters.add(parameter);
31
- parameter.setParentEntity(this);
32
- }
33
- }
34
- getNumberOfParameters() {
35
- return this.numberOfParameters;
36
- }
37
- setNumberOfParameters(numberOfParameters) {
38
- this.numberOfParameters = numberOfParameters;
39
- }
40
- getIncomingInvocations() {
41
- return this.incomingInvocations;
42
- }
43
- addIncomingInvocation(incomingInvocation) {
44
- if (!this.incomingInvocations.has(incomingInvocation)) {
45
- this.incomingInvocations.add(incomingInvocation);
46
- incomingInvocation.addCandidate(this);
47
- }
48
- }
49
- getDeclaredType() {
50
- return this.declaredType;
51
- }
52
- setDeclaredType(declaredType) {
53
- this.declaredType = declaredType;
54
- declaredType.addBehavioralEntityWithDeclaredType(this);
55
- }
56
- getTypeParameters() {
57
- return this.typeParameters;
58
- }
59
- addTypeParameter(typeParameter) {
60
- if (!this.typeParameters.has(typeParameter)) {
61
- this.typeParameters.add(typeParameter);
62
- typeParameter.setParentGeneric(this);
63
- }
64
- }
65
- getJSON() {
66
- const mse = new famix_JSON_exporter_1.FamixJSONExporter("BehavioralEntity", this);
67
- this.addPropertiesToExporter(mse);
68
- return mse.getJSON();
69
- }
70
- addPropertiesToExporter(exporter) {
71
- super.addPropertiesToExporter(exporter);
72
- exporter.addProperty("isGeneric", this.getIsGeneric());
73
- exporter.addProperty("signature", this.getSignature());
74
- exporter.addProperty("parameters", this.getParameters());
75
- exporter.addProperty("numberOfParameters", this.getNumberOfParameters());
76
- exporter.addProperty("incomingInvocations", this.getIncomingInvocations());
77
- exporter.addProperty("declaredType", this.getDeclaredType());
78
- exporter.addProperty("typeParameters", this.getTypeParameters());
79
- }
80
- }
81
- exports.BehavioralEntity = BehavioralEntity;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CSourceLanguage = void 0;
4
- const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
5
- const source_language_1 = require("./source_language");
6
- class CSourceLanguage extends source_language_1.SourceLanguage {
7
- getJSON() {
8
- const mse = new famix_JSON_exporter_1.FamixJSONExporter("CSourceLanguage", this);
9
- this.addPropertiesToExporter(mse);
10
- return mse.getJSON();
11
- }
12
- addPropertiesToExporter(exporter) {
13
- super.addPropertiesToExporter(exporter);
14
- }
15
- }
16
- exports.CSourceLanguage = CSourceLanguage;
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Class = void 0;
4
- const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
5
- const type_1 = require("./type");
6
- class Class extends type_1.Type {
7
- constructor() {
8
- super(...arguments);
9
- this.properties = new Set();
10
- this.methods = new Set();
11
- this.superInheritances = new Set();
12
- this.subInheritances = new Set();
13
- }
14
- getIsAbstract() {
15
- return this.isAbstract;
16
- }
17
- setIsAbstract(isAbstract) {
18
- this.isAbstract = isAbstract;
19
- }
20
- getProperties() {
21
- return this.properties;
22
- }
23
- addProperty(property) {
24
- if (!this.properties.has(property)) {
25
- this.properties.add(property);
26
- property.setParentEntity(this);
27
- }
28
- }
29
- getMethods() {
30
- return this.methods;
31
- }
32
- addMethod(method) {
33
- if (!this.methods.has(method)) {
34
- this.methods.add(method);
35
- method.setParentEntity(this);
36
- }
37
- }
38
- getSuperInheritances() {
39
- return this.superInheritances;
40
- }
41
- addSuperInheritance(superInheritance) {
42
- if (!this.superInheritances.has(superInheritance)) {
43
- this.superInheritances.add(superInheritance);
44
- superInheritance.setSubclass(this);
45
- }
46
- }
47
- getSubInheritances() {
48
- return this.subInheritances;
49
- }
50
- addSubInheritance(subInheritance) {
51
- if (!this.subInheritances.has(subInheritance)) {
52
- this.subInheritances.add(subInheritance);
53
- subInheritance.setSuperclass(this);
54
- }
55
- }
56
- getJSON() {
57
- const mse = new famix_JSON_exporter_1.FamixJSONExporter("Class", this);
58
- this.addPropertiesToExporter(mse);
59
- return mse.getJSON();
60
- }
61
- addPropertiesToExporter(exporter) {
62
- super.addPropertiesToExporter(exporter);
63
- exporter.addProperty("isAbstract", this.getIsAbstract());
64
- exporter.addProperty("properties", this.getProperties());
65
- exporter.addProperty("methods", this.getMethods());
66
- exporter.addProperty("superInheritances", this.getSuperInheritances());
67
- exporter.addProperty("subInheritances", this.getSubInheritances());
68
- }
69
- }
70
- exports.Class = Class;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Comment = void 0;
4
- const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
5
- const sourced_entity_1 = require("./sourced_entity");
6
- class Comment extends sourced_entity_1.SourcedEntity {
7
- getIsJSDoc() {
8
- return this.isJSDoc;
9
- }
10
- setIsJSDoc(isJSDoc) {
11
- this.isJSDoc = isJSDoc;
12
- }
13
- getContainer() {
14
- return this.container;
15
- }
16
- setContainer(container) {
17
- this.container = container;
18
- container.addComment(this);
19
- }
20
- getContent() {
21
- return this.content;
22
- }
23
- setContent(content) {
24
- this.content = content;
25
- }
26
- getJSON() {
27
- const mse = new famix_JSON_exporter_1.FamixJSONExporter("Comment", this);
28
- this.addPropertiesToExporter(mse);
29
- return mse.getJSON();
30
- }
31
- addPropertiesToExporter(exporter) {
32
- super.addPropertiesToExporter(exporter);
33
- exporter.addProperty("isJSDoc", this.getIsJSDoc());
34
- exporter.addProperty("container", this.getContainer());
35
- exporter.addProperty("content", this.getContent());
36
- }
37
- }
38
- exports.Comment = Comment;
@@ -1,125 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContainerEntity = void 0;
4
- const famix_JSON_exporter_1 = require("../../famix_JSON_exporter");
5
- const named_entity_1 = require("./named_entity");
6
- class ContainerEntity extends named_entity_1.NamedEntity {
7
- constructor() {
8
- super(...arguments);
9
- this.childrenContainerEntities = new Set();
10
- this.outgoingReferences = new Set();
11
- this.outgoingInvocations = new Set();
12
- this.accesses = new Set();
13
- this.childrenTypes = new Set();
14
- this.childrenFunctions = new Set();
15
- this.variables = new Set();
16
- }
17
- getParentContainerEntity() {
18
- return this.parentContainerEntity;
19
- }
20
- setParentContainerEntity(parentContainerEntity) {
21
- this.parentContainerEntity = parentContainerEntity;
22
- parentContainerEntity.addChildContainerEntity(this);
23
- }
24
- getChildrenContainerEntities() {
25
- return this.childrenContainerEntities;
26
- }
27
- addChildContainerEntity(childContainerEntity) {
28
- if (!this.childrenContainerEntities.has(childContainerEntity)) {
29
- this.childrenContainerEntities.add(childContainerEntity);
30
- childContainerEntity.setParentContainerEntity(this);
31
- }
32
- }
33
- getCyclomaticComplexity() {
34
- return this.cyclomaticComplexity;
35
- }
36
- setCyclomaticComplexity(cyclomaticComplexity) {
37
- this.cyclomaticComplexity = cyclomaticComplexity;
38
- }
39
- getNumberOfStatements() {
40
- return this.numberOfStatements;
41
- }
42
- setNumberOfStatements(numberOfStatements) {
43
- this.numberOfStatements = numberOfStatements;
44
- }
45
- getOutgoingReferences() {
46
- return this.outgoingReferences;
47
- }
48
- addOutgoingReference(outgoingReference) {
49
- if (!this.outgoingReferences.has(outgoingReference)) {
50
- this.outgoingReferences.add(outgoingReference);
51
- outgoingReference.setSource(this);
52
- }
53
- }
54
- getNumberOfLinesOfCode() {
55
- return this.numberOfLinesOfCode;
56
- }
57
- setNumberOfLinesOfCode(numberOfLinesOfCode) {
58
- this.numberOfLinesOfCode = numberOfLinesOfCode;
59
- }
60
- getOutgoingInvocations() {
61
- return this.outgoingInvocations;
62
- }
63
- addOutgoingInvocation(outgoingInvocation) {
64
- if (!this.outgoingInvocations.has(outgoingInvocation)) {
65
- this.outgoingInvocations.add(outgoingInvocation);
66
- outgoingInvocation.setSender(this);
67
- }
68
- }
69
- getAccesses() {
70
- return this.accesses;
71
- }
72
- addAccess(access) {
73
- if (!this.accesses.has(access)) {
74
- this.accesses.add(access);
75
- access.setAccessor(this);
76
- }
77
- }
78
- getTypes() {
79
- return this.childrenTypes;
80
- }
81
- addType(childType) {
82
- if (!this.childrenTypes.has(childType)) {
83
- this.childrenTypes.add(childType);
84
- childType.setParentContainerEntity(this);
85
- }
86
- }
87
- getFunctions() {
88
- return this.childrenFunctions;
89
- }
90
- addFunction(childFunction) {
91
- if (!this.childrenFunctions.has(childFunction)) {
92
- this.childrenFunctions.add(childFunction);
93
- childFunction.setParentContainerEntity(this);
94
- }
95
- }
96
- getVariables() {
97
- return this.variables;
98
- }
99
- addVariable(variable) {
100
- if (!this.variables.has(variable)) {
101
- this.variables.add(variable);
102
- variable.setParentContainerEntity(this);
103
- }
104
- }
105
- getJSON() {
106
- const mse = new famix_JSON_exporter_1.FamixJSONExporter("ContainerEntity", this);
107
- this.addPropertiesToExporter(mse);
108
- return mse.getJSON();
109
- }
110
- addPropertiesToExporter(exporter) {
111
- super.addPropertiesToExporter(exporter);
112
- exporter.addProperty("parentContainerEntity", this.getParentContainerEntity());
113
- exporter.addProperty("childrenContainerEntities", this.getChildrenContainerEntities());
114
- exporter.addProperty("cyclomaticComplexity", this.getCyclomaticComplexity());
115
- exporter.addProperty("numberOfStatements", this.getNumberOfStatements());
116
- exporter.addProperty("outgoingReferences", this.getOutgoingReferences());
117
- exporter.addProperty("numberOfLinesOfCode", this.getNumberOfLinesOfCode());
118
- exporter.addProperty("outgoingInvocations", this.getOutgoingInvocations());
119
- exporter.addProperty("accesses", this.getAccesses());
120
- exporter.addProperty("types", this.getTypes());
121
- exporter.addProperty("functions", this.getFunctions());
122
- exporter.addProperty("variables", this.getVariables());
123
- }
124
- }
125
- exports.ContainerEntity = ContainerEntity;