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

moosetechnology / GitProjectHealth / 11667512120

04 Nov 2024 03:36PM UTC coverage: 59.207% (+0.2%) from 59.01%
11667512120

Pull #105

github

web-flow
Merge 0462ff346 into 3c4574e31
Pull Request #105: fix/add email user to the importer + tests

71 of 82 new or added lines in 3 files covered. (86.59%)

149 existing lines in 35 files now uncovered.

9582 of 16184 relevant lines covered (59.21%)

0.59 hits per line

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

90.7
/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 }
8
CommentContributionMetric >> calculate [
1✔
9

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

1✔
14
        gitAnalyzer := GitAnalyzer new.
1✔
15

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

1✔
21

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

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

1✔
38

1✔
39
        ^ groupedByDate average asFloat
1✔
40
]
1✔
41

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

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

48
{ #category : #loading }
49
CommentContributionMetric >> load [
1✔
50

1✔
51
        userCommits := self
1✔
52
                               loadUserCompleteCommitsSince: (period at: #since)
1✔
53
                               until: (period at: #until)
1✔
54
]
1✔
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

© 2025 Coveralls, Inc