ts2famix 1.0.1 → 1.0.4
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/dist/analyze.js +102 -0
- package/dist/analyze_functions/processAccesses.js +47 -0
- package/dist/analyze_functions/processFiles.js +540 -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 +513 -0
- package/dist/famix_functions/famix_functions_associations.js +205 -0
- package/dist/famix_functions/famix_functions_index.js +62 -0
- package/dist/famix_functions/famix_functions_types.js +110 -0
- package/dist/fqn.js +126 -0
- package/dist/fqp_implementation.js +73 -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 +51 -0
- package/dist/ts2famix-tsconfig.js +53 -0
- package/doc-uml/.gitkeep +0 -0
- package/docs/.gitkeep +0 -0
- package/jest.config.json +10 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
- package/.github/workflows/node.js.yml +0 -60
- package/doc-metamodel/skins.include.puml +0 -2
- package/test/abstractClassWithComments.test.ts +0 -58
- package/test/abstracts.test.ts +0 -53
- package/test/access.test.ts +0 -62
- package/test/accesses.test.ts +0 -42
- package/test/accessorsWithDecorators.test.ts +0 -98
- package/test/alias.test.ts +0 -39
- package/test/classExtendsUndefinedClass.test.ts +0 -41
- package/test/classImplementsUndefinedInterface.test.ts +0 -45
- package/test/classWithDecorators.test.ts +0 -65
- package/test/entities.test.ts +0 -232
- package/test/entities_json.test.ts +0 -48
- package/test/enum.test.ts +0 -55
- package/test/functionReturnsFunction.test.ts +0 -53
- package/test/functionWithParameters.test.ts +0 -38
- package/test/functionWithVariables.test.ts +0 -64
- package/test/functions.test.ts +0 -23
- package/test/functionsInFunction.test.ts +0 -40
- package/test/functionsInMethod.test.ts +0 -42
- package/test/genericClass.test.ts +0 -42
- package/test/genericClassInheritsInterface.test.ts +0 -47
- package/test/genericInterface.test.ts +0 -38
- package/test/genericMethod.test.ts +0 -65
- package/test/genericWithInvocation.test.ts +0 -71
- package/test/generics.test.ts +0 -68
- package/test/inheritance.test.ts +0 -50
- package/test/interfaceInheritsInterface.test.ts +0 -40
- package/test/interfaceInheritsUndefinedInterface.test.ts +0 -41
- package/test/invocation.test.ts +0 -94
- package/test/invocationWithFunction.test.ts +0 -42
- package/test/invocationWithVariable.test.ts +0 -46
- package/test/invocation_json.test.ts +0 -63
- package/test/invocations.test.ts +0 -131
- package/test/jsDoc.test.ts +0 -31
- package/test/methodWithDecorator.test.ts +0 -44
- package/test/methods.test.ts +0 -42
- package/test/metrics.test.ts +0 -51
- package/test/module.test.ts +0 -71
- package/test/namespaces.test.ts +0 -54
- package/test/namespacesAndClasses.test.ts +0 -66
- package/test/parameterWithDecorators.test.ts +0 -54
- package/test/propertyWithDecorators.test.ts +0 -80
- package/test/sample.test.ts +0 -13
- package/test/simpleFunction.test.ts +0 -32
- package/test/simpleTest.test.ts +0 -18
- package/test/simpleTest2.test.ts +0 -36
- package/test/types.test.ts +0 -58
- package/test_src/sample.ts +0 -103
- package/test_src/sampleForModule.ts +0 -10
- package/test_src/sampleForModule2.ts +0 -7
- package/test_src/sampleForModule3.ts +0 -2
- /package/{jest.config.ts → jest.config-old.ts} +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
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;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 };
|
|
@@ -0,0 +1,39 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|
|
@@ -0,0 +1,32 @@
|
|
|
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;
|
|
@@ -0,0 +1,36 @@
|
|
|
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;
|
|
@@ -0,0 +1,81 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|
|
@@ -0,0 +1,70 @@
|
|
|
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;
|
|
@@ -0,0 +1,38 @@
|
|
|
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;
|
|
@@ -0,0 +1,125 @@
|
|
|
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;
|