• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / GitProjectHealth / 10664257731

02 Sep 2024 09:11AM UTC coverage: 18.06%. First build
10664257731

Pull #46

github

web-flow
Merge f972c3087 into 3d150934d
Pull Request #46: refactor: change metric structure

0 of 840 new or added lines in 23 files covered. (0.0%)

1590 of 8804 relevant lines covered (18.06%)

0.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st
1
Class {
2
        #name : #CommentContributionMetric,
3
        #superclass : #UserCommitsMetric,
4
        #category : #'GitLabHealth-Model-Analysis'
5
}
6

7
{ #category : #calculating }
NEW
8
CommentContributionMetric >> calculate [
×
NEW
9

×
NEW
10
        | groupedByDate gitAnalyzer contributions |
×
NEW
11
        userCommits ifNil: [ self load ].
×
NEW
12
        groupedByDate := self setupGroupedDate.
×
NEW
13

×
NEW
14
        gitAnalyzer := GitAnalyzer new.
×
NEW
15

×
NEW
16
        contributions := userCommits collect: [ :commit |
×
NEW
17
                                 commit -> (gitAnalyzer
×
NEW
18
                                          fromCommit: commit;
×
NEW
19
                                          analyseCommentContribution) ].
×
NEW
20

×
NEW
21

×
NEW
22
        contributions do: [ :assoc |
×
NEW
23
                | dateOver |
×
NEW
24
                dateOver := self transformDate: assoc key created_at to: over.
×
NEW
25
                groupedByDate
×
NEW
26
                        at: dateOver printString
×
NEW
27
                        ifPresent: [ :v | v add: assoc value ]
×
NEW
28
                        ifAbsentPut: [
×
NEW
29
                                OrderedCollection new
×
NEW
30
                                        add: assoc value;
×
NEW
31
                                        yourself ] ].
×
NEW
32

×
NEW
33
        groupedByDate := groupedByDate collect: [ :contribs |
×
NEW
34
                                 contribs
×
NEW
35
                                         ifNotEmpty: [ contribs sum ]
×
NEW
36
                                         ifEmpty: [ 0 ] ].
×
NEW
37

×
NEW
38

×
NEW
39
        ^ groupedByDate average asFloat
×
NEW
40
]
×
41

42
{ #category : #accessing }
NEW
43
CommentContributionMetric >> description [
×
NEW
44

×
NEW
45
        ^ 'comment contribution (avg)'
×
NEW
46
]
×
47

48
{ #category : #loading }
NEW
49
CommentContributionMetric >> load [
×
NEW
50
        userCommits := user loadCompleteCommitsSince: (period at: #since) until: (period at: #until). 
×
NEW
51
]
×
52

53
{ #category : #accessing }
NEW
54
CommentContributionMetric >> name [
×
NEW
55

×
NEW
56
        ^ 'commentContribution'
×
NEW
57
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc