diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptAccess.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptAccess.class.st index 0bf8d94..7a991eb 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptAccess.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptAccess.class.st @@ -10,7 +10,7 @@ ### Association target | Relation | Origin | Opposite | Type | Comment | |---| -| `variable` | `FamixTAccess` | `incomingAccesses` | `FamixTAccessible` | Variable accessed. to-side of the association| +| `candidates` | `FamixTAccess` | `incomingAccesses` | `FamixTAccessible` | Variables that cas be the accessed variable. to-side of the association. Most of the time it will be only one variable, but some languages might have candidates such as Python.| ### Other | Relation | Origin | Opposite | Type | Comment | @@ -42,7 +42,6 @@ Class { FamixTypeScriptAccess class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptAccessor.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptAccessor.class.st index 01606d1..4e7540d 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptAccessor.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptAccessor.class.st @@ -15,7 +15,6 @@ Class { FamixTypeScriptAccessor class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptAlias.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptAlias.class.st index d8df67b..89ed86b 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptAlias.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptAlias.class.st @@ -24,7 +24,6 @@ Class { FamixTypeScriptAlias class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptArrowFunction.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptArrowFunction.class.st index 08bb822..e566f23 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptArrowFunction.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptArrowFunction.class.st @@ -22,6 +22,7 @@ I represent a TypeScript arrow function. | `accesses` | `FamixTWithAccesses` | `accessor` | `FamixTAccess` | Accesses to variables made by this behaviour.| | `outgoingInvocations` | `FamixTWithInvocations` | `sender` | `FamixTInvocation` | Outgoing invocations sent by this behaviour.| | `outgoingReferences` | `FamixTWithReferences` | `referencer` | `FamixTReference` | References from this entity to other entities.| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | @@ -32,7 +33,6 @@ I represent a TypeScript arrow function. ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -41,6 +41,7 @@ I represent a TypeScript arrow function. | Name | Type | Default value | Comment | |---| +| `cyclomaticComplexity` | `Number` | 0 | Cyclomatic Complexity Property for Functions.| | `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| | `name` | `String` | nil | Basic name of the entity, not full reference.| | `signature` | `String` | nil | Signature of the message being sent| @@ -49,8 +50,8 @@ I represent a TypeScript arrow function. Class { #name : 'FamixTypeScriptArrowFunction', #superclass : 'FamixTypeScriptBehaviouralEntity', - #traits : 'FamixTDefinedInModule + FamixTFunction + FamixTImportable + FamixTInvocable', - #classTraits : 'FamixTDefinedInModule classTrait + FamixTFunction classTrait + FamixTImportable classTrait + FamixTInvocable classTrait', + #traits : 'FamixTDefinedInModule + FamixTFunction + FamixTImportable + FamixTInvocable + FamixTypeScriptTFunctionMetrics', + #classTraits : 'FamixTDefinedInModule classTrait + FamixTFunction classTrait + FamixTImportable classTrait + FamixTInvocable classTrait + FamixTypeScriptTFunctionMetrics classTrait', #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', #tag : 'Entities' @@ -60,7 +61,6 @@ Class { FamixTypeScriptArrowFunction class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptBehaviouralEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptBehaviouralEntity.class.st index 9bb2681..2dbdc56 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptBehaviouralEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptBehaviouralEntity.class.st @@ -15,7 +15,6 @@ Class { FamixTypeScriptBehaviouralEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptClass.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptClass.class.st index 3c9474b..4d7c5ce 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptClass.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptClass.class.st @@ -29,6 +29,7 @@ I represent a TypeScript class. |---| | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| | `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `incomingTypings` | `FamixTType` | `declaredType` | `FamixTEntityTyping` | Relations to the entities that have this as type.| | `subInheritances` | `FamixTWithInheritances` | `superclass` | `FamixTInheritance` | Subinheritance relationships, i.e. known subclasses of this type.| ### Other @@ -36,7 +37,6 @@ I represent a TypeScript class. |---| | `receivingInvocations` | `FamixTInvocationsReceiver` | `receiver` | `FamixTInvocation` | List of invocations performed on this entity (considered as the receiver)| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| ## Properties @@ -63,9 +63,8 @@ Class { FamixTypeScriptClass class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptComment.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptComment.class.st index ee0c4f7..ff7532c 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptComment.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptComment.class.st @@ -38,9 +38,8 @@ Class { FamixTypeScriptComment class >> annotation [ - + - ^ self ] { #category : 'accessing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptConcretization.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptConcretization.class.st index 46190cd..c380a20 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptConcretization.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptConcretization.class.st @@ -35,20 +35,20 @@ ### Association source | Relation | Origin | Opposite | Type | Comment | |---| -| `genericEntity` | `FamixTConcretization` | `concretizations` | `FamixTParametricEntity` | Generic entity linked to in this relationship. from-side of the association| +| `typeArgument` | `FamixTConcretization` | `outgoingConcretizations` | `FamixTTypeArgument` | The type argument that concretizes the type parameter| ### Association target | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteEntity` | `FamixTConcretization` | `genericization` | `FamixTParametricEntity` | Concrete entity linked to in this relationship. to-side of the association| +| `typeParameter` | `FamixTConcretization` | `concretizations` | `FamixTTypeParameter` | Type parameter linked to in this relationship.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| | `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| -| `parameterConcretizations` | `FamixTConcretization` | `concretizations` | `FamixTParameterConcretization` | | | `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| +| `triggeringAssociation` | `FamixTConcretization` | `concretizations` | `FamixTParametricAssociation` | The association that triggers this concretization.| @@ -67,7 +67,6 @@ Class { FamixTypeScriptConcretization class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptContainerEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptContainerEntity.class.st index 3cc8174..6098e65 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptContainerEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptContainerEntity.class.st @@ -26,7 +26,6 @@ Class { FamixTypeScriptContainerEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st index 8bd73a4..d3611b4 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptDecorator.class.st @@ -29,8 +29,8 @@ Class { #traits : 'FamixTImportable', #classTraits : 'FamixTImportable classTrait', #instVars : [ - '#expression => FMProperty', - '#decoratedEntity => FMOne type: #FamixTypeScriptNamedEntity opposite: #decorators' + '#decoratedEntity => FMOne type: #FamixTypeScriptNamedEntity opposite: #decorators', + '#expression => FMProperty' ], #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', @@ -41,9 +41,8 @@ Class { FamixTypeScriptDecorator class >> annotation [ - + - ^ self ] { #category : 'accessing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st index 323c43a..7b84119 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptEntity.class.st @@ -10,10 +10,9 @@ Class { FamixTypeScriptEntity class >> annotation [ - + - ^ self ] { #category : 'testing' } @@ -30,6 +29,20 @@ FamixTypeScriptEntity class >> metamodel [ ^ FamixTypeScriptModel metamodel ] +{ #category : 'testing' } +FamixTypeScriptEntity >> canBeStub [ + + + ^ false +] + +{ #category : 'testing' } +FamixTypeScriptEntity >> hasImmediateSource [ + + + ^ false +] + { #category : 'testing' } FamixTypeScriptEntity >> isAccess [ diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptEnum.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptEnum.class.st index 6e66ae7..e58657e 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptEnum.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptEnum.class.st @@ -19,12 +19,12 @@ I represent a Typescript enumerated type |---| | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| | `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `incomingTypings` | `FamixTType` | `declaredType` | `FamixTEntityTyping` | Relations to the entities that have this as type.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| ## Properties @@ -50,7 +50,6 @@ Class { FamixTypeScriptEnum class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptEnumValue.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptEnumValue.class.st index 3cd6c11..204af12 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptEnumValue.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptEnumValue.class.st @@ -9,15 +9,19 @@ I represent One value (constant) in a Typescript enumerated type |---| | `parentEnum` | `FamixTEnumValue` | `enumValues` | `FamixTWithEnumValues` | The Enum declaring this value. It offers the implementation of belongsTo| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -44,7 +48,6 @@ Class { FamixTypeScriptEnumValue class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptFile.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptFile.class.st index 9a8355e..e0daf3d 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptFile.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptFile.class.st @@ -35,7 +35,6 @@ Class { FamixTypeScriptFile class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptFolder.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptFolder.class.st index 8972f56..02e4186 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptFolder.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptFolder.class.st @@ -35,7 +35,6 @@ Class { FamixTypeScriptFolder class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptFunction.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptFunction.class.st index a0927c2..27d2a00 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptFunction.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptFunction.class.st @@ -22,6 +22,7 @@ I represent a TypeScript function. | `accesses` | `FamixTWithAccesses` | `accessor` | `FamixTAccess` | Accesses to variables made by this behaviour.| | `outgoingInvocations` | `FamixTWithInvocations` | `sender` | `FamixTInvocation` | Outgoing invocations sent by this behaviour.| | `outgoingReferences` | `FamixTWithReferences` | `referencer` | `FamixTReference` | References from this entity to other entities.| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | @@ -32,7 +33,6 @@ I represent a TypeScript function. ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -41,6 +41,7 @@ I represent a TypeScript function. | Name | Type | Default value | Comment | |---| +| `cyclomaticComplexity` | `Number` | 0 | Cyclomatic Complexity Property for Functions.| | `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| | `name` | `String` | nil | Basic name of the entity, not full reference.| | `signature` | `String` | nil | Signature of the message being sent| @@ -49,8 +50,8 @@ I represent a TypeScript function. Class { #name : 'FamixTypeScriptFunction', #superclass : 'FamixTypeScriptBehaviouralEntity', - #traits : 'FamixTDefinedInModule + FamixTFunction + FamixTImportable + FamixTInvocable', - #classTraits : 'FamixTDefinedInModule classTrait + FamixTFunction classTrait + FamixTImportable classTrait + FamixTInvocable classTrait', + #traits : 'FamixTDefinedInModule + FamixTFunction + FamixTImportable + FamixTInvocable + FamixTypeScriptTFunctionMetrics', + #classTraits : 'FamixTDefinedInModule classTrait + FamixTFunction classTrait + FamixTImportable classTrait + FamixTInvocable classTrait + FamixTypeScriptTFunctionMetrics classTrait', #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', #tag : 'Entities' @@ -60,7 +61,6 @@ Class { FamixTypeScriptFunction class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptImplementation.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptImplementation.class.st index 8929e41..023ca6a 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptImplementation.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptImplementation.class.st @@ -38,7 +38,6 @@ Class { FamixTypeScriptImplementation class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptImportClause.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptImportClause.class.st index 9b58c92..6e0c9c2 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptImportClause.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptImportClause.class.st @@ -36,7 +36,6 @@ Class { FamixTypeScriptImportClause class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st index 51bbe8c..7defb4b 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptImportingContext.class.st @@ -1,6 +1,8 @@ " This class is used to choose the entities to be imported when loading a model from file. It is used by `MiImportingContextPresenter` in a `MiImportModelFromFileDialog` to import a FamixTypeScriptModel. + + " Class { #name : 'FamixTypeScriptImportingContext', @@ -199,13 +201,6 @@ FamixTypeScriptImportingContext >> importParameter [ ^ self importConcreteEntity: (self class fm3ClassNamed: #Parameter) ] -{ #category : 'importing' } -FamixTypeScriptImportingContext >> importParameterConcretization [ - - - ^ self importAssociation: (self class fm3ClassNamed: #ParameterConcretization) -] - { #category : 'importing' } FamixTypeScriptImportingContext >> importParameterType [ @@ -507,13 +502,6 @@ FamixTypeScriptImportingContext >> shouldImportParameter [ ^ self shouldImport: #Parameter ] -{ #category : 'testing' } -FamixTypeScriptImportingContext >> shouldImportParameterConcretization [ - - - ^ self shouldImport: #ParameterConcretization -] - { #category : 'testing' } FamixTypeScriptImportingContext >> shouldImportParameterType [ diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptIndexedFileAnchor.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptIndexedFileAnchor.class.st index 5bab1ae..eb2ec98 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptIndexedFileAnchor.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptIndexedFileAnchor.class.st @@ -25,7 +25,6 @@ Class { FamixTypeScriptIndexedFileAnchor class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptInheritance.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptInheritance.class.st index adcf8e1..a1e5b19 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptInheritance.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptInheritance.class.st @@ -36,7 +36,6 @@ Class { FamixTypeScriptInheritance class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptInterface.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptInterface.class.st index 4350cb1..bdd8836 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptInterface.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptInterface.class.st @@ -43,9 +43,8 @@ Class { FamixTypeScriptInterface class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptInvocation.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptInvocation.class.st index 692edd8..ae01d64 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptInvocation.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptInvocation.class.st @@ -43,7 +43,6 @@ Class { FamixTypeScriptInvocation class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptJSDoc.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptJSDoc.class.st index 2df817f..7851e19 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptJSDoc.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptJSDoc.class.st @@ -15,7 +15,6 @@ Class { FamixTypeScriptJSDoc class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptMethod.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptMethod.class.st index 4aefb0f..0d89f51 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptMethod.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptMethod.class.st @@ -22,6 +22,7 @@ I represent a TypeScript method. | `accesses` | `FamixTWithAccesses` | `accessor` | `FamixTAccess` | Accesses to variables made by this behaviour.| | `outgoingInvocations` | `FamixTWithInvocations` | `sender` | `FamixTInvocation` | Outgoing invocations sent by this behaviour.| | `outgoingReferences` | `FamixTWithReferences` | `referencer` | `FamixTReference` | References from this entity to other entities.| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | @@ -32,7 +33,6 @@ I represent a TypeScript method. ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -44,7 +44,7 @@ I represent a TypeScript method. | `isAbstract` | `Boolean` | false | Entity can be declared abstract| | `isClassSide` | `Boolean` | false | Entity can be declared class side i.e. static| | `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| -| `kind` | `String` | nil | Tag indicating a setter, getter, constant, constructor method| +| `kind` | `String` | nil | Tag indicating a setter, getter, constant method| | `name` | `String` | nil | Basic name of the entity, not full reference.| | `signature` | `String` | nil | Signature of the message being sent| | `visibility` | `String` | nil | Visibility of the entity| @@ -64,7 +64,6 @@ Class { FamixTypeScriptMethod class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptModel.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptModel.class.st index 2f5a19b..9574ee4 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptModel.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptModel.class.st @@ -16,8 +16,9 @@ FamixTypeScriptModel class >> allSubmetamodelsPackagesNames [ { #category : 'meta' } FamixTypeScriptModel class >> annotation [ - - + + + ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st index 256bbdf..604c8c2 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptModule.class.st @@ -18,6 +18,14 @@ | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `isAmbient` | `Boolean` | false | | +| `isModule` | `Boolean` | false | | +| `isNamespace` | `Boolean` | false | | " Class { @@ -25,6 +33,11 @@ Class { #superclass : 'FamixTypeScriptScriptEntity', #traits : 'FamixTImportable + FamixTWithImports + FamixTWithLocalVariables', #classTraits : 'FamixTImportable classTrait + FamixTWithImports classTrait + FamixTWithLocalVariables classTrait', + #instVars : [ + '#isAmbient => FMProperty defaultValue: false', + '#isModule => FMProperty defaultValue: false', + '#isNamespace => FMProperty defaultValue: false' + ], #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', #tag : 'Entities' @@ -34,7 +47,6 @@ Class { FamixTypeScriptModule class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptNamedEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptNamedEntity.class.st index a69e644..186f064 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptNamedEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptNamedEntity.class.st @@ -39,10 +39,9 @@ Class { FamixTypeScriptNamedEntity class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptNamespace.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptNamespace.class.st index f098b10..38ead35 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptNamespace.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptNamespace.class.st @@ -41,7 +41,6 @@ Class { FamixTypeScriptNamespace class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParameter.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParameter.class.st index cd23d6b..5cde535 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParameter.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParameter.class.st @@ -7,15 +7,19 @@ |---| | `parentBehaviouralEntity` | `FamixTParameter` | `parameters` | `FamixTWithParameters` | Behavioural entity containing this parameter. belongsTo implementation| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -42,7 +46,6 @@ Class { FamixTypeScriptParameter class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParameterConcretization.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParameterConcretization.class.st deleted file mode 100644 index 3245f90..0000000 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParameterConcretization.class.st +++ /dev/null @@ -1,73 +0,0 @@ -" -## Relations -====================== - -### Association source -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericParameter` | `FamixTParameterConcretization` | `concretizations` | `FamixTGenericParameterType` | Generic parameter linked to in this relationship. from-side of the association| - -### Association target -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concreteParameter` | `FamixTParameterConcretization` | `generics` | `FamixTConcreteParameterType` | Concrete parameter linked to in this relationship. to-side of the association| - -### Other -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParameterConcretization` | `parameterConcretizations` | `FamixTConcretization` | | -| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| -| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| -| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| - - -## Relations -====================== - -### Association source -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericParameter` | `FamixTParameterConcretization` | `concretizations` | `FamixTGenericParameterType` | Generic parameter linked to in this relationship. from-side of the association| - -### Association target -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concreteParameter` | `FamixTParameterConcretization` | `generics` | `FamixTConcreteParameterType` | Concrete parameter linked to in this relationship. to-side of the association| - -### Other -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParameterConcretization` | `parameterConcretizations` | `FamixTConcretization` | | -| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| -| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| -| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| - - - -" -Class { - #name : 'FamixTypeScriptParameterConcretization', - #superclass : 'FamixTypeScriptEntity', - #traits : 'FamixTParameterConcretization', - #classTraits : 'FamixTParameterConcretization classTrait', - #category : 'Famix-TypeScript-Entities-Entities', - #package : 'Famix-TypeScript-Entities', - #tag : 'Entities' -} - -{ #category : 'meta' } -FamixTypeScriptParameterConcretization class >> annotation [ - - - - - ^ self -] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParameterType.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParameterType.class.st index 9c55a92..7496db6 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParameterType.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParameterType.class.st @@ -2,46 +2,31 @@ ## Relations ====================== -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `typeContainer` | `FamixTType` | `types` | `FamixTWithTypes` | Container entity to which this type belongs. Container is a namespace, not a package (Smalltalk).| - ### Outgoing dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `concretizations` | `FamixTGenericParameterType` | `genericParameter` | `FamixTParameterConcretization` | Concretization relationships, i.e. known concretizations of this type.| +| `outgoingConcretizations` | `FamixTTypeArgument` | `typeArgument` | `FamixTConcretization` | Concretizations where this type is the type argument.| | `superInheritances` | `FamixTWithInheritances` | `subclass` | `FamixTInheritance` | Superinheritance relationships, i.e. known superclasses of this type.| ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `concretizations` | `FamixTTypeParameter` | `typeParameter` | `FamixTConcretization` | Known concretizations of this type parameter.| | `subInheritances` | `FamixTWithInheritances` | `superclass` | `FamixTInheritance` | Subinheritance relationships, i.e. known subclasses of this type.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| -| `genericEntities` | `FamixTGenericParameterType` | `genericParameters` | `FamixTParametricEntity` | The generic entities that use me.| -| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| +| `genericEntity` | `FamixTTypeParameter` | `typeParameters` | `FamixTParametricEntity` | Generic entity that declares this type parameter.| -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| -| `name` | `String` | nil | Basic name of the entity, not full reference.| " Class { #name : 'FamixTypeScriptParameterType', #superclass : 'FamixTypeScriptType', - #traits : 'FamixTGenericParameterType + FamixTTypedEntity + FamixTWithInheritances', - #classTraits : 'FamixTGenericParameterType classTrait + FamixTTypedEntity classTrait + FamixTWithInheritances classTrait', + #traits : 'FamixTTypeArgument + FamixTTypeParameter + FamixTWithInheritances', + #classTraits : 'FamixTTypeArgument classTrait + FamixTTypeParameter classTrait + FamixTWithInheritances classTrait', #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', #tag : 'Entities' @@ -51,7 +36,6 @@ Class { FamixTypeScriptParameterType class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricArrowFunction.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricArrowFunction.class.st index 01b6e21..fcdca15 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricArrowFunction.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricArrowFunction.class.st @@ -4,21 +4,10 @@ I represent a TypeScript parametric arrow function. ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -37,7 +26,6 @@ Class { FamixTypeScriptParametricArrowFunction class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricClass.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricClass.class.st index 363f3a4..44c2def 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricClass.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricClass.class.st @@ -2,21 +2,10 @@ ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -35,7 +24,6 @@ Class { FamixTypeScriptParametricClass class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricFunction.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricFunction.class.st index 8ec1469..a2bb960 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricFunction.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricFunction.class.st @@ -4,21 +4,10 @@ I represent a TypeScript parametric function. ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -37,7 +26,6 @@ Class { FamixTypeScriptParametricFunction class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricInterface.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricInterface.class.st index 6b543f7..4b14053 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricInterface.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricInterface.class.st @@ -2,21 +2,10 @@ ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -35,7 +24,6 @@ Class { FamixTypeScriptParametricInterface class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricMethod.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricMethod.class.st index 46c50d7..020cda7 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptParametricMethod.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptParametricMethod.class.st @@ -4,21 +4,10 @@ I represent a TypeScript parametric Method. ## Relations ====================== -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `concretizations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretization` | Concretization relationships, i.e. the associations of known concrete entities of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -|---| -| `genericization` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretization` | Generic entity relationship, i.e. the association to the generic entity of this type.| - ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | List of concrete parameters.| -| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | List of generic parameters.| +| `typeParameters` | `FamixTParametricEntity` | `genericEntity` | `FamixTTypeParameter` | The type parameters of this parametric entity. They can any type with the exception of primitive types| @@ -37,7 +26,6 @@ Class { FamixTypeScriptParametricMethod class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptPrimitiveType.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptPrimitiveType.class.st index f7b69f5..331910a 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptPrimitiveType.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptPrimitiveType.class.st @@ -13,12 +13,12 @@ I represent a TypeScript primitive type (string, number, boolean). | Relation | Origin | Opposite | Type | Comment | |---| | `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `incomingTypings` | `FamixTType` | `declaredType` | `FamixTEntityTyping` | Relations to the entities that have this as type.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| ## Properties @@ -44,9 +44,8 @@ Class { FamixTypeScriptPrimitiveType class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptProperty.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptProperty.class.st index fe64a36..2d6b2c7 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptProperty.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptProperty.class.st @@ -9,15 +9,19 @@ I represent a TypeScript class property. |---| | `parentType` | `FamixTAttribute` | `attributes` | `FamixTWithAttributes` | Type declaring the attribute. belongsTo implementation| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -42,10 +46,10 @@ Class { #traits : 'FamixTAttribute + FamixTCanBeClassSide + FamixTHasVisibility', #classTraits : 'FamixTAttribute classTrait + FamixTCanBeClassSide classTrait + FamixTHasVisibility classTrait', #instVars : [ - '#readOnly => FMProperty defaultValue: false', '#isDefinitelyAssigned => FMProperty defaultValue: false', + '#isJavaScriptPrivate => FMProperty defaultValue: false', '#isOptional => FMProperty defaultValue: false', - '#isJavaScriptPrivate => FMProperty defaultValue: false' + '#readOnly => FMProperty defaultValue: false' ], #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', @@ -56,9 +60,8 @@ Class { FamixTypeScriptProperty class >> annotation [ - + - ^ self ] { #category : 'accessing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptReference.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptReference.class.st index 4ceafed..f6b8fb9 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptReference.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptReference.class.st @@ -10,7 +10,6 @@ Class { FamixTypeScriptReference class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptScopingEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptScopingEntity.class.st index 6462315..e1bf439 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptScopingEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptScopingEntity.class.st @@ -25,7 +25,6 @@ Class { FamixTypeScriptScopingEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptScriptEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptScriptEntity.class.st index 4ed3ce5..fe4247a 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptScriptEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptScriptEntity.class.st @@ -37,7 +37,6 @@ Class { FamixTypeScriptScriptEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceAnchor.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceAnchor.class.st index 899a255..f6f5ee2 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceAnchor.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceAnchor.class.st @@ -24,10 +24,9 @@ Class { FamixTypeScriptSourceAnchor class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceLanguage.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceLanguage.class.st index d832811..39f1fdf 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceLanguage.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceLanguage.class.st @@ -24,7 +24,6 @@ Class { FamixTypeScriptSourceLanguage class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceTextAnchor.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceTextAnchor.class.st index 66a9ea4..dd88529 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptSourceTextAnchor.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptSourceTextAnchor.class.st @@ -30,7 +30,6 @@ Class { FamixTypeScriptSourceTextAnchor class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptSourcedEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptSourcedEntity.class.st index dff0ff2..ad172dd 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptSourcedEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptSourcedEntity.class.st @@ -29,10 +29,9 @@ Class { FamixTypeScriptSourcedEntity class >> annotation [ - + - ^ self ] { #category : 'testing' } diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptStructuralEntity.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptStructuralEntity.class.st index f99c432..b6c5615 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptStructuralEntity.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptStructuralEntity.class.st @@ -2,15 +2,19 @@ ## Relations ====================== +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -37,7 +41,6 @@ Class { FamixTypeScriptStructuralEntity class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptTClassMetrics.trait.st b/src/Famix-TypeScript-Entities/FamixTypeScriptTClassMetrics.trait.st index c90691e..6020d13 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptTClassMetrics.trait.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptTClassMetrics.trait.st @@ -9,7 +9,6 @@ Trait { FamixTypeScriptTClassMetrics classSide >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st b/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st index 1bee109..7fd64d3 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptTEntityCreator.trait.st @@ -15,9 +15,8 @@ Trait { FamixTypeScriptTEntityCreator classSide >> annotation [ - + - ^ self ] { #category : 'entity creation' } @@ -34,6 +33,13 @@ FamixTypeScriptTEntityCreator >> newAccessor [ ^ self add: FamixTypeScriptAccessor new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newAccessorNamed: aName [ + + + ^ self add: (FamixTypeScriptAccessor named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newAlias [ @@ -41,6 +47,13 @@ FamixTypeScriptTEntityCreator >> newAlias [ ^ self add: FamixTypeScriptAlias new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newAliasNamed: aName [ + + + ^ self add: (FamixTypeScriptAlias named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newArrowFunction [ @@ -62,6 +75,13 @@ FamixTypeScriptTEntityCreator >> newBehaviouralEntity [ ^ self add: FamixTypeScriptBehaviouralEntity new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newBehaviouralEntityNamed: aName [ + + + ^ self add: (FamixTypeScriptBehaviouralEntity named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newClass [ @@ -97,6 +117,13 @@ FamixTypeScriptTEntityCreator >> newContainerEntity [ ^ self add: FamixTypeScriptContainerEntity new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newContainerEntityNamed: aName [ + + + ^ self add: (FamixTypeScriptContainerEntity named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newDecorator [ @@ -104,6 +131,13 @@ FamixTypeScriptTEntityCreator >> newDecorator [ ^ self add: FamixTypeScriptDecorator new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newDecoratorNamed: aName [ + + + ^ self add: (FamixTypeScriptDecorator named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newEnum [ @@ -209,6 +243,13 @@ FamixTypeScriptTEntityCreator >> newInterface [ ^ self add: FamixTypeScriptInterface new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newInterfaceNamed: aName [ + + + ^ self add: (FamixTypeScriptInterface named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newInvocation [ @@ -244,6 +285,13 @@ FamixTypeScriptTEntityCreator >> newModule [ ^ self add: FamixTypeScriptModule new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newModuleNamed: aName [ + + + ^ self add: (FamixTypeScriptModule named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newNamespace [ @@ -265,13 +313,6 @@ FamixTypeScriptTEntityCreator >> newParameter [ ^ self add: FamixTypeScriptParameter new ] -{ #category : 'entity creation' } -FamixTypeScriptTEntityCreator >> newParameterConcretization [ - - - ^ self add: FamixTypeScriptParameterConcretization new -] - { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParameterNamed: aName [ @@ -300,6 +341,13 @@ FamixTypeScriptTEntityCreator >> newParametricArrowFunction [ ^ self add: FamixTypeScriptParametricArrowFunction new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricArrowFunctionNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricArrowFunction named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParametricClass [ @@ -307,6 +355,13 @@ FamixTypeScriptTEntityCreator >> newParametricClass [ ^ self add: FamixTypeScriptParametricClass new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricClassNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricClass named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParametricFunction [ @@ -314,6 +369,13 @@ FamixTypeScriptTEntityCreator >> newParametricFunction [ ^ self add: FamixTypeScriptParametricFunction new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricFunctionNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricFunction named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParametricInterface [ @@ -321,6 +383,13 @@ FamixTypeScriptTEntityCreator >> newParametricInterface [ ^ self add: FamixTypeScriptParametricInterface new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricInterfaceNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricInterface named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newParametricMethod [ @@ -328,6 +397,13 @@ FamixTypeScriptTEntityCreator >> newParametricMethod [ ^ self add: FamixTypeScriptParametricMethod new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newParametricMethodNamed: aName [ + + + ^ self add: (FamixTypeScriptParametricMethod named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newPrimitiveType [ @@ -370,6 +446,13 @@ FamixTypeScriptTEntityCreator >> newScopingEntity [ ^ self add: FamixTypeScriptScopingEntity new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newScopingEntityNamed: aName [ + + + ^ self add: (FamixTypeScriptScopingEntity named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newScriptEntity [ @@ -377,6 +460,13 @@ FamixTypeScriptTEntityCreator >> newScriptEntity [ ^ self add: FamixTypeScriptScriptEntity new ] +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newScriptEntityNamed: aName [ + + + ^ self add: (FamixTypeScriptScriptEntity named: aName) +] + { #category : 'entity creation' } FamixTypeScriptTEntityCreator >> newSourceLanguage [ @@ -439,3 +529,10 @@ FamixTypeScriptTEntityCreator >> newimplicitVariable [ ^ self add: FamixTypeScriptimplicitVariable new ] + +{ #category : 'entity creation' } +FamixTypeScriptTEntityCreator >> newimplicitVariableNamed: aName [ + + + ^ self add: (FamixTypeScriptimplicitVariable named: aName) +] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptTFunctionMetrics.trait.st b/src/Famix-TypeScript-Entities/FamixTypeScriptTFunctionMetrics.trait.st new file mode 100644 index 0000000..e5b7c5f --- /dev/null +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptTFunctionMetrics.trait.st @@ -0,0 +1,41 @@ +" +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `cyclomaticComplexity` | `Number` | 0 | Cyclomatic Complexity Property for Functions.| + +" +Trait { + #name : 'FamixTypeScriptTFunctionMetrics', + #instVars : [ + '#cyclomaticComplexity => FMProperty defaultValue: 0' + ], + #category : 'Famix-TypeScript-Entities-Traits', + #package : 'Famix-TypeScript-Entities', + #tag : 'Traits' +} + +{ #category : 'meta' } +FamixTypeScriptTFunctionMetrics classSide >> annotation [ + + + + +] + +{ #category : 'accessing' } +FamixTypeScriptTFunctionMetrics >> cyclomaticComplexity [ + + + + + ^ cyclomaticComplexity ifNil: [ cyclomaticComplexity := 0 ] +] + +{ #category : 'accessing' } +FamixTypeScriptTFunctionMetrics >> cyclomaticComplexity: anObject [ + + cyclomaticComplexity := anObject +] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptTWithInterfaces.trait.st b/src/Famix-TypeScript-Entities/FamixTypeScriptTWithInterfaces.trait.st index 6b6d8ae..e18aff4 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptTWithInterfaces.trait.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptTWithInterfaces.trait.st @@ -25,7 +25,6 @@ Trait { FamixTypeScriptTWithInterfaces classSide >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptType.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptType.class.st index 9c5ab37..330afc7 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptType.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptType.class.st @@ -14,19 +14,22 @@ I represent a TypeScript type. |---| | `methods` | `FamixTWithMethods` | `parentType` | `FamixTMethod` | Methods declared by this type.| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `outgoingConcretizations` | `FamixTTypeArgument` | `typeArgument` | `FamixTConcretization` | Concretizations where this type is the type argument.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `generics` | `FamixTConcreteParameterType` | `concreteParameter` | `FamixTParameterConcretization` | Generic relationships, i.e. known genericParameter of this type.| | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| | `incomingReferences` | `FamixTReferenceable` | `referredEntity` | `FamixTReference` | References to this entity by other entities.| +| `incomingTypings` | `FamixTType` | `declaredType` | `FamixTEntityTyping` | Relations to the entities that have this as type.| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `concreteEntities` | `FamixTConcreteParameterType` | `concreteParameters` | `FamixTParametricEntity` | The concrete entities that use me.| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| ## Properties @@ -41,8 +44,8 @@ I represent a TypeScript type. Class { #name : 'FamixTypeScriptType', #superclass : 'FamixTypeScriptContainerEntity', - #traits : 'FamixTConcreteParameterType + FamixTImportable + FamixTType + FamixTWithMethods', - #classTraits : 'FamixTConcreteParameterType classTrait + FamixTImportable classTrait + FamixTType classTrait + FamixTWithMethods classTrait', + #traits : 'FamixTImportable + FamixTType + FamixTTypeArgument + FamixTWithMethods', + #classTraits : 'FamixTImportable classTrait + FamixTType classTrait + FamixTTypeArgument classTrait + FamixTWithMethods classTrait', #category : 'Famix-TypeScript-Entities-Entities', #package : 'Famix-TypeScript-Entities', #tag : 'Entities' @@ -52,7 +55,6 @@ Class { FamixTypeScriptType class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptVariable.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptVariable.class.st index 710176f..0cba8b7 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptVariable.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptVariable.class.st @@ -9,16 +9,20 @@ I represent a TypeScript variable. |---| | `parentBehaviouralEntity` | `FamixTLocalVariable` | `localVariables` | `FamixTWithLocalVariables` | Behavioural entity declaring this local variable. belongsTo implementation| +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typing` | `FamixTTypedEntity` | `typedEntity` | `FamixTEntityTyping` | Association linking this entity to its declared type.| + ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | |---| -| `incomingAccesses` | `FamixTAccessible` | `variable` | `FamixTAccess` | All Famix accesses pointing to this structural entity| +| `incomingAccesses` | `FamixTAccessible` | `candidates` | `FamixTAccess` | All Famix accesses pointing to this structural entity| | `incomingImports` | `FamixTImportable` | `importedEntity` | `FamixTImport` | List of imports of this entity| ### Other | Relation | Origin | Opposite | Type | Comment | |---| -| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| @@ -45,7 +49,6 @@ Class { FamixTypeScriptVariable class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Entities/FamixTypeScriptimplicitVariable.class.st b/src/Famix-TypeScript-Entities/FamixTypeScriptimplicitVariable.class.st index dc05444..d7a9544 100644 --- a/src/Famix-TypeScript-Entities/FamixTypeScriptimplicitVariable.class.st +++ b/src/Famix-TypeScript-Entities/FamixTypeScriptimplicitVariable.class.st @@ -15,7 +15,6 @@ Class { FamixTypeScriptimplicitVariable class >> annotation [ - + - ^ self ] diff --git a/src/Famix-TypeScript-Extensions/FamixTypeScriptMethod.extension.st b/src/Famix-TypeScript-Extensions/FamixTypeScriptMethod.extension.st index f7a2dde..30aab82 100644 --- a/src/Famix-TypeScript-Extensions/FamixTypeScriptMethod.extension.st +++ b/src/Famix-TypeScript-Extensions/FamixTypeScriptMethod.extension.st @@ -9,6 +9,15 @@ FamixTypeScriptMethod >> accessedAttributes [ ^ (self queryOutgoingAccesses opposites withinParentUsing: FamixTClass) asSet select: #isAttribute ] +{ #category : '*Famix-TypeScript-Extensions' } +FamixTypeScriptMethod >> isConstructor [ + + + + + ^ self name = 'constructor' +] + { #category : '*Famix-TypeScript-Extensions' } FamixTypeScriptMethod >> isGetter [ "No parameter AND diff --git a/src/Famix-TypeScript-Extensions/FamixTypeScriptTClassMetrics.extension.st b/src/Famix-TypeScript-Extensions/FamixTypeScriptTClassMetrics.extension.st index 70e81a7..c251643 100644 --- a/src/Famix-TypeScript-Extensions/FamixTypeScriptTClassMetrics.extension.st +++ b/src/Famix-TypeScript-Extensions/FamixTypeScriptTClassMetrics.extension.st @@ -6,15 +6,15 @@ FamixTypeScriptTClassMetrics >> numberOfAccessorMethods [ - ^ self lookUpPropertyNamed: #numberOfAccessorMethods computedAs: [ - | noa | - noa := 0. - self methods do: [ :method | - method isPureAccessor ifNotNil: [ - (method isPureAccessor or: [ - (method propertyNamed: #AccessorMethod) isNotNil ]) ifTrue: [ - noa := noa + 1 ] ] ]. - noa ] + ^ self cacheAt: #numberOfAccessorMethods ifAbsent: [ + | noa | + noa := 0. + self methods do: [ :method | + method isPureAccessor ifNotNil: [ + (method isPureAccessor or: [ + (method propertyNamed: #AccessorMethod) isNotNil ]) + ifTrue: [ noa := noa + 1 ] ] ]. + noa ] ] { #category : '*Famix-TypeScript-Extensions' } @@ -29,14 +29,12 @@ FamixTypeScriptTClassMetrics >> numberOfConstructorMethods [ - ^ self - lookUpPropertyNamed: #numberOfConstructorMethods - computedAs: [ + ^ self cacheAt: #numberOfConstructorMethods ifAbsent: [ | nc | nc := 0. - self methods do: [ :method | - method isConstructor ifNotNil: [ - method isConstructor ifTrue: [ nc := 1 ] ] ]. + self methods do: [ :method | + method isConstructor ifNotNil: [ + method isConstructor ifTrue: [ nc := 1 ] ] ]. nc ] ] @@ -53,8 +51,8 @@ FamixTypeScriptTClassMetrics >> numberOfPrivateMethods [ ^ self - lookUpPropertyNamed: #numberOfPrivateMethods - computedAs: [ + cacheAt: #numberOfPrivateMethods + ifAbsent: [ (self methods select: [ :each | each isPrivate ]) size ] ] @@ -71,9 +69,8 @@ FamixTypeScriptTClassMetrics >> numberOfPublicMethods [ ^ self - lookUpPropertyNamed: #numberOfPublicMethods - computedAs: [ - (self methods select: [ :each | each isPublic ]) size ] + cacheAt: #numberOfPublicMethods + ifAbsent: [ (self methods select: [ :each | each isPublic ]) size ] ] { #category : '*Famix-TypeScript-Extensions' } diff --git a/src/Famix-TypeScript-Generator/FamixTWithSourceLanguages.extension.st b/src/Famix-TypeScript-Generator/FamixTWithSourceLanguages.extension.st index 8a7b66a..130b75b 100644 --- a/src/Famix-TypeScript-Generator/FamixTWithSourceLanguages.extension.st +++ b/src/Famix-TypeScript-Generator/FamixTWithSourceLanguages.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTWithSourceLanguages } +Extension { #name : 'FamixTWithSourceLanguages' } -{ #category : #'*Famix-TypeScript-Generator' } +{ #category : '*Famix-TypeScript-Generator' } FamixTWithSourceLanguages >> formattedSourceText [ ^ self sourceLanguage ifNotNil: [ :language | language format: self sourceText from: self ] diff --git a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st index ed86b8e..669be38 100644 --- a/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st +++ b/src/Famix-TypeScript-Generator/FamixTypeScriptGenerator.class.st @@ -1,6 +1,6 @@ Class { - #name : #FamixTypeScriptGenerator, - #superclass : #FamixBasicInfrastructureGenerator, + #name : 'FamixTypeScriptGenerator', + #superclass : 'FamixBasicInfrastructureGenerator', #instVars : [ 'access', 'class', @@ -44,30 +44,32 @@ Class { 'parametricClass', 'parametricInterface', 'concretization', - 'parameterConcretization' + 'parameterConcretization', + 'tTypeScriptFunctionMetrics' ], - #category : #'Famix-TypeScript-Generator' + #category : 'Famix-TypeScript-Generator', + #package : 'Famix-TypeScript-Generator' } -{ #category : #accessing } +{ #category : 'accessing' } FamixTypeScriptGenerator class >> packageName [ ^ #'Famix-TypeScript-Entities' ] -{ #category : #accessing } +{ #category : 'accessing' } FamixTypeScriptGenerator class >> packageNameForAnnotations [ ^ #'FamixTypeScript' ] -{ #category : #accessing } +{ #category : 'accessing' } FamixTypeScriptGenerator class >> prefix [ ^ #'FamixTypeScript' ] -{ #category : #accessing } +{ #category : 'accessing' } FamixTypeScriptGenerator class >> translationDictionary [ | classNames associations | @@ -79,7 +81,7 @@ FamixTypeScriptGenerator class >> translationDictionary [ ^ Dictionary newFrom: associations. ] -{ #category : #comments } +{ #category : 'comments' } FamixTypeScriptGenerator >> commentForConcretization [ "To verify" ^ '## Relations @@ -113,7 +115,7 @@ FamixTypeScriptGenerator >> commentForConcretization [ ' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } FamixTypeScriptGenerator >> commentForParameterConcretization [ ^ '## Relations ====================== @@ -146,7 +148,7 @@ FamixTypeScriptGenerator >> commentForParameterConcretization [ ' ] -{ #category : #comments } +{ #category : 'comments' } FamixTypeScriptGenerator >> commentForTCanBeInterface [ ^ 'I allow an entity to be an interface abstraction ex: @@ -158,13 +160,13 @@ public interface Flyable { ```' ] -{ #category : #definition } +{ #category : 'definition' } FamixTypeScriptGenerator >> commentForTWithInterfaces [ ^ 'I can contain interfaces (Packages, Methods, Classes...)' ] -{ #category : #definition } +{ #category : 'definition' } FamixTypeScriptGenerator >> defineClasses [ super defineClasses. @@ -206,7 +208,6 @@ FamixTypeScriptGenerator >> defineClasses [ namespace := builder newClassNamed: #Namespace. parameter := builder newClassNamed: #Parameter. parametricClass := builder newClassNamed: #ParametricClass. - parameterConcretization := builder newClassNamed: #ParameterConcretization comment: self commentForParameterConcretization. parametricInterface := builder newClassNamed: #ParametricInterface. parameterType := builder newClassNamed: #ParameterType. primitiveType := builder newClassNamed: #PrimitiveType comment: 'I represent a TypeScript primitive type (string, number, boolean).'. @@ -221,7 +222,7 @@ FamixTypeScriptGenerator >> defineClasses [ "self defineComments." ] -{ #category : #definition } +{ #category : 'definition' } FamixTypeScriptGenerator >> defineHierarchy [ super defineHierarchy. @@ -283,6 +284,7 @@ FamixTypeScriptGenerator >> defineHierarchy [ function --|> #TDefinedInModule. function --|> #TInvocable. function --|> #TImportable. + function --|> #TFunctionMetrics. parametricFunction --|> function. parametricFunction --|> #TParametricEntity. @@ -292,6 +294,7 @@ FamixTypeScriptGenerator >> defineHierarchy [ arrowFunction --|> #TDefinedInModule. arrowFunction --|> #TInvocable. arrowFunction --|> #TImportable. + arrowFunction --|> #TFunctionMetrics. "Dublicate code for adding cyclomatic complexity" parametricArrowFunction --|> arrowFunction. parametricArrowFunction --|> #TParametricEntity. @@ -354,8 +357,8 @@ FamixTypeScriptGenerator >> defineHierarchy [ parameter --|> #TParameter. parameterType --|> type. - parameterType --|> #TGenericParameterType. - parameterType --|> #TTypedEntity. + parameterType --|> #TTypeParameter. + parameterType --|> #TTypeArgument. parametricClass --|> class. "parameterizableClass --|> #TWithParameterizedTypes." @@ -378,14 +381,9 @@ FamixTypeScriptGenerator >> defineHierarchy [ primitiveType --|> #TPrimitiveType. sourcedEntity --|> #TWithComments. - - type --|> #TConcreteParameterType. - type --|> containerEntity. concretization --|> #TConcretization. - parameterConcretization --|> #TParameterConcretization. - property --|> structuralEntity. property --|> #TAttribute. property --|> #TCanBeClassSide. @@ -404,6 +402,7 @@ FamixTypeScriptGenerator >> defineHierarchy [ tWithInterfaces --|> #TWithTypes. type --|> containerEntity. + type --|> #TTypeArgument. type --|> #TType. "type --|> #TParameterizedTypeUser." type --|> #TWithMethods. @@ -416,7 +415,7 @@ FamixTypeScriptGenerator >> defineHierarchy [ parameterType --|> #TWithInheritances. ] -{ #category : #definition } +{ #category : 'definition' } FamixTypeScriptGenerator >> defineProperties [ super defineProperties. @@ -433,7 +432,16 @@ FamixTypeScriptGenerator >> defineProperties [ comment: 'Properties may be postfixed with a private modifier that makes the property private even in JavaScript.'. (comment property: #isJSDoc type: #Boolean defaultValue: false) comment: 'Comments can have the form of JSDoc.'. + + "Trait Properties can be exported into another function" + "Adding the following for cyclomatic complexity property for TFunctionMetrics" + (tTypeScriptFunctionMetrics property: #cyclomaticComplexity type: #Number defaultValue: 0) + comment: 'Cyclomatic Complexity Property for Functions.'. + (module property: #isAmbient type: #Boolean defaultValue: false). + (module property: #isModule type: #Boolean defaultValue: false). + (module property: #isNamespace type: #Boolean defaultValue: false). + "The following are not need because of THasKind (?)" "(method property: #isConstructor type: #Boolean defaultValue: false) @@ -442,15 +450,17 @@ FamixTypeScriptGenerator >> defineProperties [ comment: 'Method is a getter'. (method property: #isSetter type: #Boolean defaultValue: false) comment: 'Method is a setter'" + + ] -{ #category : #definition } +{ #category : 'definition' } FamixTypeScriptGenerator >> defineRelations [ super defineRelations. (decorator property: #decoratedEntity) *- (namedEntity property: #decorators). ] -{ #category : #definition } +{ #category : 'definition' } FamixTypeScriptGenerator >> defineTraits [ super defineTraits. @@ -458,9 +468,10 @@ FamixTypeScriptGenerator >> defineTraits [ tWithInterfaces comment: self commentForTWithInterfaces. tTypeScriptClassMetrics := builder newTraitNamed: #TClassMetrics. + tTypeScriptFunctionMetrics := builder newTraitNamed: #TFunctionMetrics. ] -{ #category : #definition } +{ #category : 'definition' } FamixTypeScriptGenerator >> newBuilder [ ^ super newBuilder diff --git a/src/Famix-TypeScript-Generator/package.st b/src/Famix-TypeScript-Generator/package.st index 41f22d4..44ed289 100644 --- a/src/Famix-TypeScript-Generator/package.st +++ b/src/Famix-TypeScript-Generator/package.st @@ -1 +1 @@ -Package { #name : #'Famix-TypeScript-Generator' } +Package { #name : 'Famix-TypeScript-Generator' } diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st index 644828d..ad75876 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptClassTest.class.st @@ -38,10 +38,9 @@ FamixTypeScriptClassTest >> testNumberOfConstructorMethods [ | m1 c1 model | model := FamixTypeScriptModel new. c1 := FamixTypeScriptClass named: 'Class1' model: model. - m1 := FamixTypeScriptMethod named: 'method1' model: model. + m1 := FamixTypeScriptMethod named: 'constructor' model: model. m1 parentType: c1. - - m1 isConstructor: true. + self assert: c1 numberOfConstructorMethods equals: 1. c1 numberOfConstructorMethods: 100. self assert: c1 numberOfConstructorMethods equals: 100. diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st index b33111b..8eed5f0 100644 --- a/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptMethodTest.class.st @@ -5,7 +5,8 @@ Class { #name : 'FamixTypeScriptMethodTest', #superclass : 'TestCase', #instVars : [ - 'method' + 'method', + 'constructor' ], #category : 'Famix-TypeScript-Tests-Entities', #package : 'Famix-TypeScript-Tests', @@ -15,7 +16,8 @@ Class { { #category : 'running' } FamixTypeScriptMethodTest >> setUp [ super setUp. - method := FamixTypeScriptMethod new + method := FamixTypeScriptMethod new. + constructor := FamixTypeScriptMethod named: 'constructor'. ] { #category : 'test' } @@ -161,9 +163,9 @@ FamixTypeScriptMethodTest >> testIsClassSide [ { #category : 'test' } FamixTypeScriptMethodTest >> testIsConstructor [ + self assert: constructor isConstructor. + self deny: method isConstructor. - method beConstructor. - self assert: method isConstructor ] { #category : 'test' } diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptModuleTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptModuleTest.class.st new file mode 100644 index 0000000..5a7a516 --- /dev/null +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptModuleTest.class.st @@ -0,0 +1,48 @@ +Class { + #name : 'FamixTypeScriptModuleTest', + #superclass : 'TestCase', + #category : 'Famix-TypeScript-Tests', + #package : 'Famix-TypeScript-Tests' +} + +{ #category : 'tests' } +FamixTypeScriptModuleTest >> testIsAmbient [ + | m1 m2 model | + model := FamixTypeScriptModel new. + m1 := FamixTypeScriptModule named: 'module1' model: model. + m2 := FamixTypeScriptModule named: 'module2' model: model. + + m1 isAmbient: true. + self assert: m1 isAmbient equals: true. + + m1 isAmbient: false. + self assert: m1 isAmbient equals: false. +] + +{ #category : 'tests' } +FamixTypeScriptModuleTest >> testIsModule [ + | m1 m2 model | + model := FamixTypeScriptModel new. + m1 := FamixTypeScriptModule named: 'module1' model: model. + m2 := FamixTypeScriptModule named: 'module2' model: model. + + m1 isModule: true. + self assert: m1 isModule equals: true. + + m1 isModule: false. + self assert: m1 isModule equals: false. +] + +{ #category : 'tests' } +FamixTypeScriptModuleTest >> testIsNamespace [ + | m1 m2 model | + model := FamixTypeScriptModel new. + m1 := FamixTypeScriptModule named: 'module1' model: model. + m2 := FamixTypeScriptModule named: 'module2' model: model. + + m1 isNamespace: true. + self assert: m1 isNamespace equals: true. + + m1 isNamespace: false. + self assert: m1 isNamespace equals: false. +] diff --git a/src/Famix-TypeScript-Tests/FamixTypeScriptTFunctionMetricsTest.class.st b/src/Famix-TypeScript-Tests/FamixTypeScriptTFunctionMetricsTest.class.st new file mode 100644 index 0000000..e1f7dc3 --- /dev/null +++ b/src/Famix-TypeScript-Tests/FamixTypeScriptTFunctionMetricsTest.class.st @@ -0,0 +1,23 @@ +Class { + #name : 'FamixTypeScriptTFunctionMetricsTest', + #superclass : 'TestCase', + #category : 'Famix-TypeScript-Tests-Entities', + #package : 'Famix-TypeScript-Tests', + #tag : 'Entities' +} + +{ #category : 'tests' } +FamixTypeScriptTFunctionMetricsTest >> testCyclomaticComplexityPresence [ + | af1 f1 model | + model := FamixTypeScriptModel new. + f1 := FamixTypeScriptFunction named: 'func1' model: model. + af1 := FamixTypeScriptArrowFunction named: 'arrowFunc1' model: model. + + f1 cyclomaticComplexity: 100. + self assert: f1 cyclomaticComplexity equals: 100. + + af1 cyclomaticComplexity: 100. + self assert: af1 cyclomaticComplexity equals: 100. + + +]