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.
Files changed (210) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +30 -61
  3. package/dist/analyze.js +4 -2
  4. package/dist/analyze_functions/process_functions.js +285 -131
  5. package/dist/famix_functions/EntityDictionary.js +864 -231
  6. package/dist/famix_functions/helpers_creation.js +61 -10
  7. package/dist/fqn.js +160 -111
  8. package/dist/lib/famix/famix_JSON_exporter.js +55 -0
  9. package/dist/lib/famix/famix_base_element.js +18 -0
  10. package/dist/lib/famix/famix_repository.js +224 -0
  11. package/dist/lib/famix/{src/index.js → index.js} +1 -0
  12. package/dist/lib/famix/model/famix/access.js +40 -0
  13. package/dist/lib/famix/model/famix/accessor.js +17 -0
  14. package/dist/lib/famix/model/famix/alias.js +33 -0
  15. package/dist/lib/famix/model/famix/arrow_function.js +17 -0
  16. package/dist/lib/famix/model/famix/behavioral_entity.js +79 -0
  17. package/dist/lib/famix/model/famix/class.js +71 -0
  18. package/dist/lib/famix/model/famix/comment.js +39 -0
  19. package/dist/lib/famix/model/famix/concretisation.js +31 -0
  20. package/dist/lib/famix/model/famix/container_entity.js +126 -0
  21. package/dist/lib/famix/model/famix/decorator.js +32 -0
  22. package/dist/lib/famix/model/famix/entity.js +17 -0
  23. package/dist/lib/famix/model/famix/enum.js +31 -0
  24. package/dist/lib/famix/model/famix/enum_value.js +25 -0
  25. package/dist/lib/famix/model/famix/function.js +17 -0
  26. package/dist/lib/famix/model/famix/import_clause.js +41 -0
  27. package/dist/lib/famix/model/famix/index.js +86 -0
  28. package/dist/lib/famix/model/famix/indexed_file_anchor.js +38 -0
  29. package/dist/lib/famix/model/famix/inheritance.js +33 -0
  30. package/dist/lib/famix/model/famix/interface.js +64 -0
  31. package/dist/lib/famix/model/famix/invocation.js +54 -0
  32. package/dist/lib/famix/model/famix/method.js +67 -0
  33. package/dist/lib/famix/model/famix/module.js +60 -0
  34. package/dist/lib/famix/model/famix/named_entity.js +78 -0
  35. package/dist/lib/famix/model/famix/parameter.js +25 -0
  36. package/dist/lib/famix/model/famix/parameter_concretisation.js +44 -0
  37. package/dist/lib/famix/model/famix/parameter_type.js +45 -0
  38. package/dist/lib/famix/model/famix/parametric_arrow_function.js +31 -0
  39. package/dist/lib/famix/model/famix/parametric_class.js +44 -0
  40. package/dist/lib/famix/model/famix/parametric_function.js +31 -0
  41. package/dist/lib/famix/model/famix/parametric_interface.js +44 -0
  42. package/dist/lib/famix/model/famix/parametric_method.js +31 -0
  43. package/dist/lib/famix/model/famix/primitive_type.js +17 -0
  44. package/dist/lib/famix/model/famix/property.js +73 -0
  45. package/dist/lib/famix/model/famix/reference.js +33 -0
  46. package/dist/lib/famix/model/famix/scoping_entity.js +36 -0
  47. package/dist/lib/famix/model/famix/script_entity.js +29 -0
  48. package/dist/lib/famix/model/famix/source_anchor.js +27 -0
  49. package/dist/lib/famix/model/famix/source_language.js +35 -0
  50. package/dist/lib/famix/model/famix/sourced_entity.js +60 -0
  51. package/dist/lib/famix/model/famix/structural_entity.js +39 -0
  52. package/dist/lib/famix/model/famix/type.js +73 -0
  53. package/dist/lib/famix/model/famix/variable.js +24 -0
  54. package/dist/lib/ts-complex/cyclomatic-service.js +3 -3
  55. package/dist/refactorer/refactor-getter-setter.js +142 -0
  56. package/dist/ts2famix-cli-wrapper.js +42 -0
  57. package/dist/ts2famix-cli.js +8 -1
  58. package/dist/ts2famix-tsconfig.js +1 -0
  59. package/doc-uml/famix-typescript-model.puml +608 -0
  60. package/doc-uml/famix-typescript-model.svg +1 -0
  61. package/jest.config.json +2 -1
  62. package/package.json +13 -12
  63. package/src/analyze.ts +24 -23
  64. package/src/analyze_functions/process_functions.ts +310 -129
  65. package/src/famix_functions/EntityDictionary.ts +949 -271
  66. package/src/famix_functions/helpers_creation.ts +64 -6
  67. package/src/fqn.ts +169 -96
  68. package/{dist/lib/famix/src/famix_JSON_exporter.js → src/lib/famix/famix_JSON_exporter.ts} +16 -14
  69. package/src/lib/famix/famix_base_element.ts +22 -0
  70. package/{dist/lib/famix/src/famix_repository.js → src/lib/famix/famix_repository.ts} +96 -75
  71. package/src/lib/famix/model/famix/access.ts +50 -0
  72. package/src/lib/famix/model/famix/alias.ts +39 -0
  73. package/src/lib/famix/{src/model/famix/implicit_variable.ts → model/famix/arrow_function.ts} +3 -3
  74. package/src/lib/famix/model/famix/behavioral_entity.ts +97 -0
  75. package/src/lib/famix/model/famix/class.ts +85 -0
  76. package/src/lib/famix/model/famix/comment.ts +47 -0
  77. package/src/lib/famix/model/famix/concretisation.ts +40 -0
  78. package/src/lib/famix/model/famix/container_entity.ts +160 -0
  79. package/src/lib/famix/model/famix/decorator.ts +37 -0
  80. package/src/lib/famix/model/famix/enum.ts +30 -0
  81. package/src/lib/famix/model/famix/enum_value.ts +28 -0
  82. package/src/lib/famix/model/famix/import_clause.ts +51 -0
  83. package/src/lib/famix/{src/model → model}/famix/index.ts +8 -7
  84. package/src/lib/famix/model/famix/indexed_file_anchor.ts +46 -0
  85. package/src/lib/famix/model/famix/inheritance.ts +40 -0
  86. package/src/lib/famix/model/famix/interface.ts +75 -0
  87. package/src/lib/famix/model/famix/invocation.ts +65 -0
  88. package/src/lib/famix/model/famix/method.ts +89 -0
  89. package/src/lib/famix/model/famix/module.ts +71 -0
  90. package/src/lib/famix/model/famix/named_entity.ts +95 -0
  91. package/src/lib/famix/{src/model → model}/famix/parameter.ts +11 -12
  92. package/src/lib/famix/model/famix/parameter_concretisation.ts +51 -0
  93. package/src/lib/famix/model/famix/parameter_type.ts +58 -0
  94. package/src/lib/famix/model/famix/parametric_arrow_function.ts +32 -0
  95. package/src/lib/famix/model/famix/parametric_class.ts +49 -0
  96. package/src/lib/famix/model/famix/parametric_function.ts +32 -0
  97. package/src/lib/famix/model/famix/parametric_interface.ts +49 -0
  98. package/src/lib/famix/model/famix/parametric_method.ts +32 -0
  99. package/src/lib/famix/model/famix/primitive_type.ts +15 -0
  100. package/src/lib/famix/model/famix/property.ts +94 -0
  101. package/src/lib/famix/model/famix/reference.ts +40 -0
  102. package/src/lib/famix/model/famix/scoping_entity.ts +35 -0
  103. package/src/lib/famix/model/famix/script_entity.ts +34 -0
  104. package/src/lib/famix/model/famix/source_anchor.ts +30 -0
  105. package/src/lib/famix/model/famix/source_language.ts +35 -0
  106. package/src/lib/famix/model/famix/sourced_entity.ts +70 -0
  107. package/src/lib/famix/model/famix/structural_entity.ts +43 -0
  108. package/src/lib/famix/model/famix/type.ts +87 -0
  109. package/src/lib/famix/model/famix/variable.ts +27 -0
  110. package/src/lib/famix/package.json +1 -1
  111. package/src/lib/ts-complex/cyclomatic-service.ts +10 -10
  112. package/src/refactorer/refactor-getter-setter.ts +140 -0
  113. package/src/ts2famix-cli-wrapper.ts +21 -0
  114. package/src/ts2famix-cli.ts +8 -2
  115. package/tsconfig.check-tests.json +14 -0
  116. package/tsconfig.json +71 -69
  117. package/dist/famix2puml.js +0 -125
  118. package/dist/lib/famix/src/famix_base_element.js +0 -17
  119. package/dist/lib/famix/src/model/famix/access.js +0 -39
  120. package/dist/lib/famix/src/model/famix/accessor.js +0 -16
  121. package/dist/lib/famix/src/model/famix/alias.js +0 -32
  122. package/dist/lib/famix/src/model/famix/association.js +0 -36
  123. package/dist/lib/famix/src/model/famix/behavioral_entity.js +0 -81
  124. package/dist/lib/famix/src/model/famix/class.js +0 -70
  125. package/dist/lib/famix/src/model/famix/comment.js +0 -38
  126. package/dist/lib/famix/src/model/famix/container_entity.js +0 -125
  127. package/dist/lib/famix/src/model/famix/decorator.js +0 -31
  128. package/dist/lib/famix/src/model/famix/entity.js +0 -16
  129. package/dist/lib/famix/src/model/famix/enum.js +0 -30
  130. package/dist/lib/famix/src/model/famix/enum_value.js +0 -24
  131. package/dist/lib/famix/src/model/famix/function.js +0 -16
  132. package/dist/lib/famix/src/model/famix/implicit_variable.js +0 -16
  133. package/dist/lib/famix/src/model/famix/import_clause.js +0 -39
  134. package/dist/lib/famix/src/model/famix/index.js +0 -83
  135. package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +0 -51
  136. package/dist/lib/famix/src/model/famix/inheritance.js +0 -32
  137. package/dist/lib/famix/src/model/famix/interface.js +0 -63
  138. package/dist/lib/famix/src/model/famix/invocation.js +0 -53
  139. package/dist/lib/famix/src/model/famix/method.js +0 -66
  140. package/dist/lib/famix/src/model/famix/module.js +0 -31
  141. package/dist/lib/famix/src/model/famix/named_entity.js +0 -77
  142. package/dist/lib/famix/src/model/famix/namespace.js +0 -24
  143. package/dist/lib/famix/src/model/famix/parameter.js +0 -24
  144. package/dist/lib/famix/src/model/famix/parameter_type.js +0 -24
  145. package/dist/lib/famix/src/model/famix/parameterizable_class.js +0 -30
  146. package/dist/lib/famix/src/model/famix/parameterizable_interface.js +0 -30
  147. package/dist/lib/famix/src/model/famix/parameterized_type.js +0 -36
  148. package/dist/lib/famix/src/model/famix/primitive_type.js +0 -16
  149. package/dist/lib/famix/src/model/famix/property.js +0 -44
  150. package/dist/lib/famix/src/model/famix/reference.js +0 -32
  151. package/dist/lib/famix/src/model/famix/scoping_entity.js +0 -35
  152. package/dist/lib/famix/src/model/famix/script_entity.js +0 -30
  153. package/dist/lib/famix/src/model/famix/source_anchor.js +0 -26
  154. package/dist/lib/famix/src/model/famix/source_language.js +0 -35
  155. package/dist/lib/famix/src/model/famix/sourced_entity.js +0 -59
  156. package/dist/lib/famix/src/model/famix/structural_entity.js +0 -38
  157. package/dist/lib/famix/src/model/famix/text_anchor.js +0 -37
  158. package/dist/lib/famix/src/model/famix/type.js +0 -71
  159. package/dist/lib/famix/src/model/famix/variable.js +0 -23
  160. package/doc-uml/metamodel-full.svg +0 -1
  161. package/doc-uml/metamodel.svg +0 -1
  162. package/jest.config-old.ts +0 -199
  163. package/plantuml.jar +0 -0
  164. package/src/famix2puml.ts +0 -119
  165. package/src/lib/famix/package-lock.json +0 -301
  166. package/src/lib/famix/readme.md +0 -5
  167. package/src/lib/famix/src/famix_JSON_exporter.ts +0 -56
  168. package/src/lib/famix/src/famix_base_element.ts +0 -22
  169. package/src/lib/famix/src/famix_repository.ts +0 -243
  170. package/src/lib/famix/src/model/famix/access.ts +0 -53
  171. package/src/lib/famix/src/model/famix/alias.ts +0 -41
  172. package/src/lib/famix/src/model/famix/association.ts +0 -44
  173. package/src/lib/famix/src/model/famix/behavioral_entity.ts +0 -107
  174. package/src/lib/famix/src/model/famix/class.ts +0 -86
  175. package/src/lib/famix/src/model/famix/comment.ts +0 -50
  176. package/src/lib/famix/src/model/famix/container_entity.ts +0 -165
  177. package/src/lib/famix/src/model/famix/decorator.ts +0 -39
  178. package/src/lib/famix/src/model/famix/enum.ts +0 -31
  179. package/src/lib/famix/src/model/famix/enum_value.ts +0 -29
  180. package/src/lib/famix/src/model/famix/import_clause.ts +0 -53
  181. package/src/lib/famix/src/model/famix/indexed_file_anchor.ts +0 -71
  182. package/src/lib/famix/src/model/famix/inheritance.ts +0 -42
  183. package/src/lib/famix/src/model/famix/interface.ts +0 -75
  184. package/src/lib/famix/src/model/famix/invocation.ts +0 -68
  185. package/src/lib/famix/src/model/famix/method.ts +0 -96
  186. package/src/lib/famix/src/model/famix/module.ts +0 -31
  187. package/src/lib/famix/src/model/famix/named_entity.ts +0 -98
  188. package/src/lib/famix/src/model/famix/namespace.ts +0 -28
  189. package/src/lib/famix/src/model/famix/parameter_type.ts +0 -33
  190. package/src/lib/famix/src/model/famix/parameterizable_class.ts +0 -31
  191. package/src/lib/famix/src/model/famix/parameterizable_interface.ts +0 -31
  192. package/src/lib/famix/src/model/famix/parameterized_type.ts +0 -40
  193. package/src/lib/famix/src/model/famix/primitive_type.ts +0 -15
  194. package/src/lib/famix/src/model/famix/property.ts +0 -54
  195. package/src/lib/famix/src/model/famix/reference.ts +0 -42
  196. package/src/lib/famix/src/model/famix/scoping_entity.ts +0 -35
  197. package/src/lib/famix/src/model/famix/script_entity.ts +0 -38
  198. package/src/lib/famix/src/model/famix/source_anchor.ts +0 -31
  199. package/src/lib/famix/src/model/famix/source_language.ts +0 -37
  200. package/src/lib/famix/src/model/famix/sourced_entity.ts +0 -73
  201. package/src/lib/famix/src/model/famix/structural_entity.ts +0 -44
  202. package/src/lib/famix/src/model/famix/text_anchor.ts +0 -49
  203. package/src/lib/famix/src/model/famix/type.ts +0 -88
  204. package/src/lib/famix/src/model/famix/variable.ts +0 -28
  205. package/src/lib/famix/tsconfig.json +0 -27
  206. package/src/lib/famix/tslint.json +0 -15
  207. /package/src/lib/famix/{src/index.ts → index.ts} +0 -0
  208. /package/src/lib/famix/{src/model → model}/famix/accessor.ts +0 -0
  209. /package/src/lib/famix/{src/model → model}/famix/entity.ts +0 -0
  210. /package/src/lib/famix/{src/model → model}/famix/function.ts +0 -0
@@ -1,54 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Class } from "./class";
3
- import { Interface } from "./interface";
4
- import { StructuralEntity } from "./structural_entity";
5
-
6
- export class Property extends StructuralEntity {
7
-
8
- private isClassSide: boolean;
9
-
10
- public getIsClassSide(): boolean {
11
- return this.isClassSide;
12
- }
13
-
14
- public setIsClassSide(isClassSide: boolean): void {
15
- this.isClassSide = isClassSide;
16
- }
17
-
18
- private parentEntity: Class | Interface;
19
-
20
- public getParentEntity(): Class | Interface {
21
- return this.parentEntity;
22
- }
23
-
24
- public setParentEntity(parentEntity: Class | Interface): void {
25
- this.parentEntity = parentEntity;
26
- parentEntity.addProperty(this);
27
- }
28
-
29
- private modifiers: Set<string> = new Set();
30
-
31
- public getModifiers(): Set<string> {
32
- return this.modifiers;
33
- }
34
-
35
- public addModifier(modifier: string): void {
36
- if (!this.modifiers.has(modifier)) {
37
- this.modifiers.add(modifier);
38
- }
39
- }
40
-
41
-
42
- public getJSON(): string {
43
- const json: FamixJSONExporter = new FamixJSONExporter("Property", this);
44
- this.addPropertiesToExporter(json);
45
- return json.getJSON();
46
- }
47
-
48
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
49
- super.addPropertiesToExporter(exporter);
50
- exporter.addProperty("isClassSide", this.getIsClassSide());
51
- exporter.addProperty("parentEntity", this.getParentEntity());
52
- exporter.addProperty("modifiers", this.getModifiers());
53
- }
54
- }
@@ -1,42 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Type } from "./type";
3
- import { Association } from "./association";
4
- import { ContainerEntity } from "./container_entity";
5
-
6
- export class Reference extends Association {
7
-
8
- private source: ContainerEntity;
9
-
10
- public getSource(): ContainerEntity {
11
- return this.source;
12
- }
13
-
14
- public setSource(source: ContainerEntity): void {
15
- this.source = source;
16
- source.addOutgoingReference(this);
17
- }
18
-
19
- private target: Type;
20
-
21
- public getTarget(): Type {
22
- return this.target;
23
- }
24
-
25
- public setTarget(target: Type): void {
26
- this.target = target;
27
- target.addIncomingReference(this);
28
- }
29
-
30
-
31
- public getJSON(): string {
32
- const json: FamixJSONExporter = new FamixJSONExporter("Reference", this);
33
- this.addPropertiesToExporter(json);
34
- return json.getJSON();
35
- }
36
-
37
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
38
- super.addPropertiesToExporter(exporter);
39
- exporter.addProperty("source", this.getSource());
40
- exporter.addProperty("target", this.getTarget());
41
- }
42
- }
@@ -1,35 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { ContainerEntity } from "./container_entity";
3
- import { Namespace } from "./namespace";
4
- import { logger } from "../../../../../analyze";
5
-
6
- export class ScopingEntity extends ContainerEntity {
7
-
8
- private childrenNamespaces: Set<Namespace> = new Set();
9
-
10
- public getNamespaces(): Set<Namespace> {
11
- return this.childrenNamespaces;
12
- }
13
-
14
- public addNamespace(childNamespace: Namespace): void {
15
- if (!this.childrenNamespaces.has(childNamespace)) {
16
- logger.debug("Adding namespace " + childNamespace.getName() + " to " + this.getName());
17
- this.childrenNamespaces.add(childNamespace);
18
- childNamespace.setParentScope(this);
19
- } else {
20
- logger.debug("Namespace " + childNamespace.getName() + " already added to " + this.getName());
21
- }
22
- }
23
-
24
-
25
- public getJSON(): string {
26
- const json: FamixJSONExporter = new FamixJSONExporter("ScopingEntity", this);
27
- this.addPropertiesToExporter(json);
28
- return json.getJSON();
29
- }
30
-
31
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
32
- super.addPropertiesToExporter(exporter);
33
- exporter.addProperty("namespaces", this.getNamespaces());
34
- }
35
- }
@@ -1,38 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { ScopingEntity } from "./scoping_entity";
3
-
4
- export class ScriptEntity extends ScopingEntity {
5
-
6
- private numberOfLinesOfText: number;
7
-
8
- public getNumberOfLinesOfText(): number {
9
- return this.numberOfLinesOfText;
10
- }
11
-
12
- public setNumberOfLinesOfText(numberOfLinesOfText: number): void {
13
- this.numberOfLinesOfText = numberOfLinesOfText;
14
- }
15
-
16
- private numberOfCharacters: number;
17
-
18
- public getNumberOfCharacters(): number {
19
- return this.numberOfCharacters;
20
- }
21
-
22
- public setNumberOfCharacters(numberOfCharacters: number): void {
23
- this.numberOfCharacters = numberOfCharacters;
24
- }
25
-
26
-
27
- public getJSON(): string {
28
- const json: FamixJSONExporter = new FamixJSONExporter("ScriptEntity", this);
29
- this.addPropertiesToExporter(json);
30
- return json.getJSON();
31
- }
32
-
33
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
34
- super.addPropertiesToExporter(exporter);
35
- exporter.addProperty("numberOfLinesOfText", this.getNumberOfLinesOfText());
36
- exporter.addProperty("numberOfCharacters", this.getNumberOfCharacters());
37
- }
38
- }
@@ -1,31 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Entity } from "./entity";
3
- import { SourcedEntity } from "./sourced_entity";
4
-
5
- export class SourceAnchor extends Entity {
6
-
7
- private element: SourcedEntity;
8
-
9
- public getElement(): SourcedEntity {
10
- return this.element;
11
- }
12
-
13
- public setElement(element: SourcedEntity): void {
14
- if (this.element === undefined) {
15
- this.element = element;
16
- element.setSourceAnchor(this);
17
- }
18
- }
19
-
20
-
21
- public getJSON(): string {
22
- const json: FamixJSONExporter = new FamixJSONExporter("SourceAnchor", this);
23
- this.addPropertiesToExporter(json);
24
- return json.getJSON();
25
- }
26
-
27
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
28
- super.addPropertiesToExporter(exporter);
29
- exporter.addProperty("element", this.getElement());
30
- }
31
- }
@@ -1,37 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Entity } from "./entity";
3
- import { SourcedEntity } from "./sourced_entity";
4
-
5
- export class SourceLanguage extends Entity {
6
-
7
- private sourcedEntities: Set<SourcedEntity> = new Set();
8
-
9
- // name of the source language
10
- get name(): string {
11
- return "TypeScript";
12
- }
13
-
14
- public getSourcedEntities(): Set<SourcedEntity> {
15
- return this.sourcedEntities;
16
- }
17
-
18
- public addSourcedEntity(sourcedEntity: SourcedEntity): void {
19
- if (!this.sourcedEntities.has(sourcedEntity)) {
20
- this.sourcedEntities.add(sourcedEntity);
21
- sourcedEntity.setDeclaredSourceLanguage(this);
22
- }
23
- }
24
-
25
-
26
- public getJSON(): string {
27
- const json: FamixJSONExporter = new FamixJSONExporter("SourceLanguage", this);
28
- this.addPropertiesToExporter(json);
29
- return json.getJSON();
30
- }
31
-
32
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
33
- super.addPropertiesToExporter(exporter);
34
- exporter.addProperty("name", this.name);
35
- exporter.addProperty("sourcedEntities", this.getSourcedEntities());
36
- }
37
- }
@@ -1,73 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { SourceLanguage } from "./source_language";
3
- import { Entity } from "./entity";
4
- import { Comment } from "./comment";
5
- import { SourceAnchor } from "./source_anchor";
6
- import { logger } from "../../../../../analyze";
7
-
8
- export class SourcedEntity extends Entity {
9
-
10
- private isStub: boolean;
11
-
12
- public getIsStub(): boolean {
13
- return this.isStub;
14
- }
15
-
16
- public setIsStub(isStub: boolean): void {
17
- this.isStub = isStub;
18
- }
19
-
20
- private sourceAnchor: SourceAnchor;
21
-
22
- public getSourceAnchor(): SourceAnchor {
23
- return this.sourceAnchor;
24
- }
25
-
26
- public setSourceAnchor(sourceAnchor: SourceAnchor): void {
27
- if (this.sourceAnchor === undefined) {
28
- this.sourceAnchor = sourceAnchor;
29
- sourceAnchor.setElement(this);
30
- }
31
- }
32
-
33
- private comments: Set<Comment> = new Set();
34
-
35
- public getComments(): Set<Comment> {
36
- return this.comments;
37
- }
38
-
39
- public addComment(comment: Comment): void {
40
- if (!this.comments.has(comment)) {
41
- this.comments.add(comment);
42
- comment.setContainer(this);
43
- } else {
44
- logger.warn("WARNING: adding comment that is already in comments: " + comment.getJSON() + " to " + this.getJSON());
45
- }
46
- }
47
-
48
- private declaredSourceLanguage: SourceLanguage;
49
-
50
- public getDeclaredSourceLanguage(): SourceLanguage {
51
- return this.declaredSourceLanguage;
52
- }
53
-
54
- public setDeclaredSourceLanguage(declaredSourceLanguage: SourceLanguage): void {
55
- this.declaredSourceLanguage = declaredSourceLanguage;
56
- declaredSourceLanguage.addSourcedEntity(this);
57
- }
58
-
59
-
60
- public getJSON(): string {
61
- const json: FamixJSONExporter = new FamixJSONExporter("SourcedEntity", this);
62
- this.addPropertiesToExporter(json);
63
- return json.getJSON();
64
- }
65
-
66
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
67
- super.addPropertiesToExporter(exporter);
68
- exporter.addProperty("isStub", this.getIsStub());
69
- exporter.addProperty("sourceAnchor", this.getSourceAnchor());
70
- exporter.addProperty("comments", this.getComments());
71
- exporter.addProperty("declaredSourceLanguage", this.getDeclaredSourceLanguage());
72
- }
73
- }
@@ -1,44 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Type } from "./type";
3
- import { Access } from "./access";
4
- import { NamedEntity } from "./named_entity";
5
-
6
- export class StructuralEntity extends NamedEntity {
7
-
8
- private incomingAccesses: Set<Access> = new Set();
9
-
10
- public getIncomingAccesses(): Set<Access> {
11
- return this.incomingAccesses;
12
- }
13
-
14
- public addIncomingAccess(incomingAccess: Access): void {
15
- if (!this.incomingAccesses.has(incomingAccess)) {
16
- this.incomingAccesses.add(incomingAccess);
17
- incomingAccess.setVariable(this);
18
- }
19
- }
20
-
21
- private declaredType: Type;
22
-
23
- public getDeclaredType(): Type {
24
- return this.declaredType;
25
- }
26
-
27
- public setDeclaredType(declaredType: Type): void {
28
- this.declaredType = declaredType;
29
- declaredType.addStructureWithDeclaredType(this);
30
- }
31
-
32
-
33
- public getJSON(): string {
34
- const json: FamixJSONExporter = new FamixJSONExporter("StructuralEntity", this);
35
- this.addPropertiesToExporter(json);
36
- return json.getJSON();
37
- }
38
-
39
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
40
- super.addPropertiesToExporter(exporter);
41
- exporter.addProperty("incomingAccesses", this.getIncomingAccesses());
42
- exporter.addProperty("declaredType", this.getDeclaredType());
43
- }
44
- }
@@ -1,49 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { SourceAnchor } from "./source_anchor";
3
-
4
- export class TextAnchor extends SourceAnchor {
5
-
6
- private startPos: number;
7
-
8
- public getStartPos(): number {
9
- return this.startPos;
10
- }
11
-
12
- public setStartPos(startPos: number): void {
13
- this.startPos = startPos;
14
- }
15
-
16
- private endPos: number;
17
-
18
- public getEndPos(): number {
19
- return this.endPos;
20
- }
21
-
22
- public setEndPos(endPos: number): void {
23
- this.endPos = endPos;
24
- }
25
-
26
- private fileName: string;
27
-
28
- public getFileName(): string {
29
- return this.fileName;
30
- }
31
-
32
- public setFileName(fileName: string): void {
33
- this.fileName = fileName;
34
- }
35
-
36
-
37
- public getJSON(): string {
38
- const json: FamixJSONExporter = new FamixJSONExporter("TextAnchor", this);
39
- this.addPropertiesToExporter(json);
40
- return json.getJSON();
41
- }
42
-
43
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
44
- super.addPropertiesToExporter(exporter);
45
- exporter.addProperty("startPos", this.getStartPos());
46
- exporter.addProperty("endPos", this.getEndPos());
47
- exporter.addProperty("fileName", this.getFileName());
48
- }
49
- }
@@ -1,88 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { StructuralEntity } from "./structural_entity";
3
- import { ContainerEntity } from "./container_entity";
4
- import { Reference } from "./reference";
5
- import { BehavioralEntity } from "./behavioral_entity";
6
- import { Alias } from "./alias";
7
-
8
- export class Type extends ContainerEntity {
9
-
10
- private container: ContainerEntity;
11
-
12
- public getContainer(): ContainerEntity {
13
- return this.container;
14
- }
15
-
16
- public setContainer(container: ContainerEntity): void {
17
- this.container = container;
18
- container.addType(this);
19
- }
20
-
21
- private typeAliases: Set<Alias> = new Set();
22
-
23
- public getTypeAliases(): Set<Alias> {
24
- return this.typeAliases;
25
- }
26
-
27
- public addTypeAlias(typeAlias: Alias): void {
28
- if (!this.typeAliases.has(typeAlias)) {
29
- this.typeAliases.add(typeAlias);
30
- typeAlias.setAliasedEntity(this);
31
- }
32
- }
33
-
34
- private structuresWithDeclaredType: Set<StructuralEntity> = new Set();
35
-
36
- public getStructuresWithDeclaredType(): Set<StructuralEntity> {
37
- return this.structuresWithDeclaredType;
38
- }
39
-
40
- public addStructureWithDeclaredType(structureWithDeclaredType: StructuralEntity): void {
41
- if (!this.structuresWithDeclaredType.has(structureWithDeclaredType)) {
42
- this.structuresWithDeclaredType.add(structureWithDeclaredType);
43
- structureWithDeclaredType.setDeclaredType(this);
44
- }
45
- }
46
-
47
- private behavioralEntitiesWithDeclaredType: Set<BehavioralEntity> = new Set();
48
-
49
- public getBehavioralEntitiesWithDeclaredType(): Set<BehavioralEntity> {
50
- return this.behavioralEntitiesWithDeclaredType;
51
- }
52
-
53
- public addBehavioralEntityWithDeclaredType(behavioralEntityWithDeclaredType: BehavioralEntity): void {
54
- if (!this.behavioralEntitiesWithDeclaredType.has(behavioralEntityWithDeclaredType)) {
55
- this.behavioralEntitiesWithDeclaredType.add(behavioralEntityWithDeclaredType);
56
- behavioralEntityWithDeclaredType.setDeclaredType(this);
57
- }
58
- }
59
-
60
- private incomingReferences: Set<Reference> = new Set();
61
-
62
- public getIncomingReferences(): Set<Reference> {
63
- return this.incomingReferences;
64
- }
65
-
66
- public addIncomingReference(incomingReference: Reference): void {
67
- if (!this.incomingReferences.has(incomingReference)) {
68
- this.incomingReferences.add(incomingReference);
69
- incomingReference.setTarget(this);
70
- }
71
- }
72
-
73
-
74
- public getJSON(): string {
75
- const json: FamixJSONExporter = new FamixJSONExporter("Type", this);
76
- this.addPropertiesToExporter(json);
77
- return json.getJSON();
78
- }
79
-
80
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
81
- super.addPropertiesToExporter(exporter);
82
- exporter.addProperty("container", this.getContainer());
83
- exporter.addProperty("typeAliases", this.getTypeAliases());
84
- exporter.addProperty("structuresWithDeclaredType", this.getStructuresWithDeclaredType());
85
- exporter.addProperty("behavioralEntitiesWithDeclaredType", this.getBehavioralEntitiesWithDeclaredType());
86
- exporter.addProperty("incomingReferences", this.getIncomingReferences());
87
- }
88
- }
@@ -1,28 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { ContainerEntity } from "./container_entity";
3
- import { StructuralEntity } from "./structural_entity";
4
-
5
- export class Variable extends StructuralEntity {
6
-
7
- private parentContainerEntity: ContainerEntity;
8
-
9
- public getParentContainerEntity(): ContainerEntity {
10
- return this.parentContainerEntity;
11
- }
12
-
13
- public setParentContainerEntity(parentContainerEntity: ContainerEntity): void {
14
- this.parentContainerEntity = parentContainerEntity;
15
- }
16
-
17
-
18
- public getJSON(): string {
19
- const json: FamixJSONExporter = new FamixJSONExporter("Variable", this);
20
- this.addPropertiesToExporter(json);
21
- return json.getJSON();
22
- }
23
-
24
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
25
- super.addPropertiesToExporter(exporter);
26
- exporter.addProperty("parentBehaviouralEntity", this.getParentContainerEntity());
27
- }
28
- }
@@ -1,27 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "outDir": "dist",
5
- "incremental": true,
6
- "pretty": true,
7
- "noFallthroughCasesInSwitch": true,
8
- "noImplicitReturns": true,
9
- "noUnusedParameters": true,
10
- "noUnusedLocals": true,
11
- "noImplicitAny": true,
12
- "declaration": true,
13
- "strictNullChecks": true,
14
- "strictFunctionTypes": true,
15
- "alwaysStrict": true,
16
- "target": "es2017",
17
- "sourceMap": true,
18
- "lib": ["es6"]
19
- },
20
- "filesGlob": [
21
- "./**/*.ts"
22
- ],
23
- "exclude": [
24
- "node_modules",
25
- "dist"
26
- ]
27
- }
@@ -1,15 +0,0 @@
1
- {
2
- "defaultSeverity": "error",
3
- "extends": [
4
- "tslint:recommended"
5
- ],
6
- "jsRules": {},
7
- "rules": {
8
- "member-ordering": false,
9
- "no-consecutive-blank-lines": false,
10
- "ordered-imports": false,
11
- "ban-types": false,
12
- "max-line-length": false
13
- },
14
- "rulesDirectory": []
15
- }
File without changes