-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added dispersed, intensive coupling, existing tests
- Loading branch information
Matthias Barkowsky
committed
Jul 11, 2014
1 parent
e97b38f
commit 06c2dbe
Showing
419 changed files
with
2,297 additions
and
94 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
packages/SwaLint-Core.package/SLCollectionResult.class/instance/formatAsMethodList.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
displaying | ||
formatAsMethodList | ||
|
||
self valueFormatRule: [:v | | value | | ||
value := ''. | ||
v allButLastDo: [:each | value := value, each name, ', ']. | ||
value := value, v last name. | ||
value]. |
4 changes: 4 additions & 0 deletions
4
packages/SwaLint-Core.package/SLCollectionResult.class/instance/itemsSelect..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
itemsSelect: aBlock | ||
|
||
^ self items select: aBlock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7d316aa1-5901-43fe-9b64-081b8492d1d2 | ||
8ce4eba9-5551-0944-8b43-cab41086e16d |
1 change: 1 addition & 0 deletions
1
...package/monticello.meta/version.d/SwaLint-Core-MB.35_8ce4eba9-5551-0944-8b43-cab41086e16d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/SwaLint-PlugIns.package/SLClassMetricsPlugIn.class/instance/classAMW..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
tests | ||
classAMW: aSLClassTestObject | ||
|
||
| amw methodNumber totalWeight | | ||
|
||
methodNumber := (aSLClassTestObject resultOf: #numberOfMethods) result. | ||
totalWeight := (aSLClassTestObject resultOf: #weightedMethodCount) result. | ||
amw := (methodNumber = 0) ifTrue: [0] | ||
ifFalse: [totalWeight / methodNumber]. | ||
|
||
^ self numericResult: amw withThresholdFor: #ClassAMW |
11 changes: 11 additions & 0 deletions
11
packages/SwaLint-PlugIns.package/SLClassMetricsPlugIn.class/instance/classNAS..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
tests | ||
classNAS: aSLClassTestObject | ||
|
||
| publicMethods nonOverridingMethods addedServices | | ||
|
||
publicMethods := aSLClassTestObject resultOf: #allPublicMethods. | ||
nonOverridingMethods := self nonOverridingMethodsOf: aSLClassTestObject. | ||
addedServices := publicMethods itemsSelect: | ||
[:each | nonOverridingMethods includes: each]. | ||
|
||
^ self integerResult: addedServices size withThresholdFor: #NumberOfMethods |
11 changes: 11 additions & 0 deletions
11
packages/SwaLint-PlugIns.package/SLClassMetricsPlugIn.class/instance/classPNAS..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
tests | ||
classPNAS: aSLClassTestObject | ||
|
||
| publicMethods nas | | ||
|
||
publicMethods := aSLClassTestObject resultOf: #allPublicMethods. | ||
nas := aSLClassTestObject resultOf: #classNAS. | ||
|
||
^ self percentageResult: ((publicMethods itemCount = 0) | ||
ifTrue: [0] | ||
ifFalse: [nas / publicMethods itemCount]) |
10 changes: 10 additions & 0 deletions
10
...es/SwaLint-PlugIns.package/SLClassMetricsPlugIn.class/instance/nonOverridingMethodsOf..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
private | ||
nonOverridingMethodsOf: aSLClassTestObject | ||
|
||
| selectors nonOverridingMethods | | ||
|
||
selectors := aSLClassTestObject methods collect: [ :each | each methodSelector]. | ||
nonOverridingMethods := selectors reject: | ||
[ :each | aSLClassTestObject testObject superclass allSelectors includes: each]. | ||
|
||
^ nonOverridingMethods collect: [:each | aSLClassTestObject methodForSelector: each] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/SwaLint-PlugIns.package/SLDisharmonyPlugIn.class/instance/dispersedCoupling..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
tests | ||
dispersedCoupling: aSLMethodTestObject | ||
|
||
aSLMethodTestObject ifClassTestChildrenWith: #dispersedCoupling. | ||
aSLMethodTestObject shouldBeMethod. | ||
^ self successResult: | ||
((self looksLikeDispersedCoupling: aSLMethodTestObject) and: | ||
[(aSLMethodTestObject resultOf: #maxNesting) > #one]) |
8 changes: 8 additions & 0 deletions
8
packages/SwaLint-PlugIns.package/SLDisharmonyPlugIn.class/instance/intensiveCoupling..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
tests | ||
intensiveCoupling: aSLMethodTestObject | ||
|
||
aSLMethodTestObject ifClassTestChildrenWith: #intensiveCoupling. | ||
aSLMethodTestObject shouldBeMethod. | ||
^ self successResult: | ||
((self looksLikeIntensiveCoupling: aSLMethodTestObject) and: | ||
[(aSLMethodTestObject resultOf: #maxNesting) > #one]) |
6 changes: 6 additions & 0 deletions
6
.../SwaLint-PlugIns.package/SLDisharmonyPlugIn.class/instance/looksLikeDispersedCoupling..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
private | ||
looksLikeDispersedCoupling: aSLMethodTestObject | ||
|
||
^ (((aSLMethodTestObject resultOf: #methodCINT) | ||
> (SLPreferences preferenceAt: #ShortMemoryCap) preferenceValue) and: | ||
[(aSLMethodTestObject resultOf: #methodCDISP) >= 0.5]) |
8 changes: 8 additions & 0 deletions
8
.../SwaLint-PlugIns.package/SLDisharmonyPlugIn.class/instance/looksLikeIntensiveCoupling..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
private | ||
looksLikeIntensiveCoupling: aSLMethodTestObject | ||
|
||
^ ((((aSLMethodTestObject resultOf: #methodCINT) | ||
> (SLPreferences preferenceAt: #ShortMemoryCap) preferenceValue) and: | ||
[(aSLMethodTestObject resultOf: #methodCDISP) < 0.5]) or: | ||
[(((aSLMethodTestObject resultOf: #methodCINT) > #few) and: | ||
[(aSLMethodTestObject resultOf: #methodCDISP) < 0.25])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/SwaLint-PlugIns.package/SLMiscPlugIn.class/instance/allPublicMethods..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class tests | ||
allPublicMethods: aSLClassTestObject | ||
|
||
aSLClassTestObject shouldBeClass. | ||
|
||
^ SLCollectionResult | ||
newWith: aSLClassTestObject methods | ||
select: [ :method | (method resultOf: #isPrivate) isNegative] |
6 changes: 6 additions & 0 deletions
6
packages/SwaLint-PlugIns.package/SLMiscPlugIn.class/instance/isPrivate..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
method tests | ||
isPrivate: aSLMethodTestObject | ||
|
||
aSLMethodTestObject shouldBeMethod. | ||
^ self booleanResult: | ||
(self methodIsPrivate: aSLMethodTestObject testObject) |
2 changes: 1 addition & 1 deletion
2
packages/SwaLint-PlugIns.package/SLMiscPlugIn.class/instance/methodCallers..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class tests | ||
method tests | ||
methodCallers: aSLMethodTestObject | ||
|
||
| methods | | ||
|
9 changes: 9 additions & 0 deletions
9
packages/SwaLint-PlugIns.package/SLMiscPlugIn.class/instance/methodIsPrivate..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
private | ||
methodIsPrivate: aCompiledMethod | ||
|
||
| category selector | | ||
|
||
selector := aCompiledMethod selector. | ||
category := aCompiledMethod methodClass categoryForSelector: selector. | ||
|
||
^ (selector beginsWith: '_') or: [category includesSubString: 'private'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
bfae734c-4059-4e5a-817a-eb78d5804e2d | ||
1d27705d-84fb-4b42-b27b-87426b46bd90 |
1 change: 1 addition & 0 deletions
1
...kage/monticello.meta/version.d/SwaLint-PlugIns-MB.36_a359d6ae-fe50-ab42-b879-e97acad59a0f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...kage/monticello.meta/version.d/SwaLint-PlugIns-MB.37_1d27705d-84fb-4b42-b27b-87426b46bd90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
packages/SwaLint-TestClasses.package/SLTestCoupledClass.class/instance/bar..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
bar: anObject | ||
|
||
bar := anObject |
4 changes: 4 additions & 0 deletions
4
packages/SwaLint-TestClasses.package/SLTestCoupledClass.class/instance/bar.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
bar | ||
|
||
^ bar |
4 changes: 4 additions & 0 deletions
4
packages/SwaLint-TestClasses.package/SLTestCoupledClass.class/instance/foo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
foo: anObject | ||
|
||
foo := anObject |
4 changes: 4 additions & 0 deletions
4
packages/SwaLint-TestClasses.package/SLTestCoupledClass.class/instance/foo.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
foo | ||
|
||
^ foo |
2 changes: 2 additions & 0 deletions
2
packages/SwaLint-TestClasses.package/SLTestCoupledClass.class/instance/foobar..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
accessing | ||
foobar: anObject |
Oops, something went wrong.