Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/GitLabHealth-Model-Analysis/GLPTruckFactor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ GLPTruckFactor >> truckFactor [
numberOfFiles := self blobFiles size.
factor := 0.
coverage := 1.0.
tfInfo fileAuthorship: authorsMap copy.
[
authorsMap isNotEmpty and: [
0.5 < (self computeCoverageOf: numberOfFiles from: authorsMap) ] ]
Expand Down
40 changes: 26 additions & 14 deletions src/GitLabHealth-Model-Analysis/GLPTruckFactorInfo.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Class {
'truckFactor',
'totalFiles',
'coverage',
'developers'
'developers',
'fileAuthorship'
],
#category : #'GitLabHealth-Model-Analysis-TruckFactor'
}
Expand Down Expand Up @@ -34,14 +35,26 @@ GLPTruckFactorInfo >> developers: anObject [
developers := anObject
]

{ #category : #accessing }
GLPTruckFactorInfo >> fileAuthorship [

^ fileAuthorship
]

{ #category : #accessing }
GLPTruckFactorInfo >> fileAuthorship: anObject [

fileAuthorship := anObject
]

{ #category : #initialization }
GLPTruckFactorInfo >> initialize [

super initialize.
developers := OrderedCollection new
]

{ #category : #initialization }
{ #category : #printing }
GLPTruckFactorInfo >> printOn: stream [

stream
Expand All @@ -63,18 +76,17 @@ GLPTruckFactorInfo >> printOn: stream [
cr.

developers do: [ :developer |
| devFiles |
" devFiles := developer authorshipFiles size.
""stream
nextPutAll: repository;
nextPut: $;;
nextPutAll: developer name;
nextPut: $;;
print: ((devFiles asFloat / totalFiles) * 100) roundTo: 0.01;
nextPut: $;;
print: devFiles;
cr"
].
stream
nextPutAll: developer name;
nextPut: $;;
print:
((self fileAuthorship at: developer) size asFloat / totalFiles * 100
roundTo: 0.01);
nextPut: $;;
print: (self fileAuthorship at: developer) size;
cr
"nextPutAll: repository;
nextPut: $;;" ].

stream
]
Expand Down
Loading