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

moosetechnology / GitProjectHealth / 10682053149

03 Sep 2024 11:29AM UTC coverage: 18.493%. First build
10682053149

Pull #47

github

web-flow
Merge bae5d1107 into 049515451
Pull Request #47: refactor: remove GitMetric class and subclasses

0 of 176 new or added lines in 10 files covered. (0.0%)

1590 of 8598 relevant lines covered (18.49%)

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 }
8
CommentContributionMetric >> calculate [
×
9

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

×
14
        gitAnalyzer := GitAnalyzer new.
×
15

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

×
21

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

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

×
38

×
39
        ^ groupedByDate average asFloat
×
40
]
×
41

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

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

48
{ #category : #loading }
49
CommentContributionMetric >> load [
×
NEW
50

×
NEW
51
        userCommits := self
×
NEW
52
                               loadCompleteCommitsSince: (period at: #since)
×
NEW
53
                               until: (period at: #until)
×
54
]
×
55

56
{ #category : #accessing }
57
CommentContributionMetric >> name [
×
58

×
59
        ^ 'commentContribution'
×
60
]
×
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