Skip to content

Commit f82ee40

Browse files
authored
Merge pull request #1097 from moosetechnology/46-accessedAttributes-and-possibly-other-properties-are-manually-defined
46 accessed attributes and possibly other properties are manually defined
2 parents 95e930f + 196d53a commit f82ee40

6 files changed

Lines changed: 24 additions & 48 deletions

File tree

src/Famix-Java-Entities/FamixJavaClass.class.st

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,6 @@ FamixJavaClass >> accept: aVisitor [
7777
^ aVisitor visitFamixJavaClass: self
7878
]
7979

80-
{ #category : 'Famix-Extensions-metrics-support' }
81-
FamixJavaClass >> accessedAttributes [
82-
83-
"Returns my attributes accessed by my methods. If the same attribute is accessed
84-
by two different methods it is counted twice.
85-
Used to support the calculation of LCOM"
86-
87-
^ self methodsWithoutSutbsAndConstructors asOrderedCollection flatCollect: [ :method | method accessedAttributes ]
88-
]
89-
9080
{ #category : 'enumerating' }
9181
FamixJavaClass >> allImplementedInterfacesHierarchy [
9282

src/Famix-Java-Entities/FamixJavaMethod.class.st

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,6 @@ FamixJavaMethod >> accept: aVisitor [
8080
^ aVisitor visitFamixJavaMethod: self
8181
]
8282

83-
{ #category : 'Famix-Extensions-metrics-support' }
84-
FamixJavaMethod >> accessedAttributes [
85-
"Returns the set of attributes of my class accessed by me (method).
86-
Used to support the calculation of LCOM"
87-
88-
^ ((self queryOutgoing: FamixTAccess) opposites withinContainerUsing: FamixTClass) asSet select: #isAttribute
89-
]
90-
9183
{ #category : 'Famix-Extensions' }
9284
FamixJavaMethod >> clientBehaviours [
9385
<FMProperty: #clientBehaviours type: #FamixJavaMethod> <multivalued> <derived>
@@ -124,12 +116,6 @@ FamixJavaMethod >> innerClassesImplementingMethods [
124116
^ self types select: [ :el | el methods anySatisfy: [ :m | m isStub not ] ]
125117
]
126118

127-
{ #category : 'Famix-Extensions' }
128-
FamixJavaMethod >> invokedBehaviours [
129-
130-
^ (self queryOutgoing: FamixTInvocation) opposites
131-
]
132-
133119
{ #category : 'Famix-Extensions' }
134120
FamixJavaMethod >> invokedMethods [
135121
<FMProperty: #invokedMethods type: #FamixJavaMethod> <derived> <multivalued>

src/Famix-PharoSmalltalk-Entities/FamixStClass.class.st

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@ FamixStClass class >> annotation [
6363
^ self
6464
]
6565

66-
{ #category : 'Famix-Extensions-metrics-support' }
67-
FamixStClass >> accessedAttributes [
68-
69-
"Returns my attributes accessed by my methods. If the same attribute is accessed
70-
by two different methods it is counted twice.
71-
Used to support the calculation of LCOM"
72-
73-
^ self methodsWithoutSutbsAndConstructors asOrderedCollection flatCollect: [ :method | method accessedAttributes ]
74-
]
75-
7666
{ #category : 'accessing' }
7767
FamixStClass >> allRecursiveTypes [
7868
"We cannot have children types in Smalltalk but this method is useful to compute some metrics."

src/Famix-PharoSmalltalk-Entities/FamixStMethod.class.st

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,6 @@ FamixStMethod class >> annotation [
7373
^ self
7474
]
7575

76-
{ #category : 'Famix-Extensions-metrics-support' }
77-
FamixStMethod >> accessedAttributes [
78-
"Returns the set of attributes of my class accessed by me (method).
79-
Used to support the calculation of LCOM"
80-
81-
^ ((self queryOutgoing: FamixTAccess) opposites withinContainerUsing: FamixTClass) asSet select: #isAttribute
82-
]
83-
8476
{ #category : 'accessing' }
8577
FamixStMethod >> category [
8678
<FMProperty: #category type: #String>
@@ -148,12 +140,6 @@ FamixStMethod >> hasEmptyBody [
148140
^ self numberOfAccesses = 0 and: [ self numberOfOutgoingInvocations = 0 ]
149141
]
150142

151-
{ #category : 'Famix-Extensions' }
152-
FamixStMethod >> invokedBehaviours [
153-
154-
^ (self queryOutgoing: FamixTInvocation) opposites
155-
]
156-
157143
{ #category : 'Famix-Extensions' }
158144
FamixStMethod >> invokedMethods [
159145
<FMProperty: #invokedMethods type: #FamixStMethod> <derived> <multivalued>

src/Famix-Traits/FamixTClass.trait.st

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ FamixTClass >> accept: aVisitor [
8080
^ aVisitor visitFamixTClass: self
8181
]
8282

83+
{ #category : 'Famix-Extensions-metrics-support' }
84+
FamixTClass >> accessedAttributes [
85+
86+
"Returns my attributes accessed by my methods. If the same attribute is accessed
87+
by two different methods it is counted twice.
88+
Used to support the calculation of LCOM"
89+
90+
^ self methodsWithoutSutbsAndConstructors asOrderedCollection flatCollect: [ :method | method accessedAttributes ]
91+
]
92+
8393
{ #category : 'adding' }
8494
FamixTClass >> addFirstMethodsOverriding: aMethod in: aCollection [
8595

src/Famix-Traits/FamixTMethod.trait.st

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ FamixTMethod >> accept: aVisitor [
8282
^ aVisitor visitFamixTMethod: self
8383
]
8484

85+
{ #category : 'Famix-Extensions-metrics-support' }
86+
FamixTMethod >> accessedAttributes [
87+
"Returns the set of attributes of my class accessed by me (method).
88+
Used to support the calculation of LCOM"
89+
90+
^ ((self queryOutgoing: FamixTAccess) opposites withinContainerUsing: FamixTClass) asSet select: #isAttribute
91+
]
92+
8593
{ #category : 'accessing' }
8694
FamixTMethod >> firstOverridingMethods [
8795

@@ -92,6 +100,12 @@ FamixTMethod >> firstOverridingMethods [
92100
^ overridingMethods
93101
]
94102

103+
{ #category : 'Famix-Extensions' }
104+
FamixTMethod >> invokedBehaviours [
105+
106+
^ (self queryOutgoing: FamixTInvocation) opposites
107+
]
108+
95109
{ #category : 'asserting' }
96110
FamixTMethod >> isAccessor [
97111
^ self isSetter or: [ self isGetter ]

0 commit comments

Comments
 (0)