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

moosetechnology / GitProjectHealth / 13807399403

12 Mar 2025 08:58AM UTC coverage: 66.731% (+0.2%) from 66.508%
13807399403

Pull #145

github

web-flow
Merge 41a250ee3 into 2c2d8c5e1
Pull Request #145: Code addition merge rerquest project metric

6833 of 8097 new or added lines in 90 files covered. (84.39%)

1 existing line in 1 file now uncovered.

11746 of 17602 relevant lines covered (66.73%)

0.67 hits per line

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

89.74
/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

1✔
29
        groupedByDate := groupedByDate collect: [ :contribs |
1✔
30
                                 contribs
1✔
31
                                         ifNotEmpty: [ contribs sum ]
1✔
32
                                         ifEmpty: [ 0 ] ].
1✔
33

1✔
34

1✔
35
        ^ groupedByDate average asFloat
1✔
36
]
1✔
37

38
{ #category : #accessing }
NEW
39
CommentContributionMetric >> description [
×
NEW
40

×
NEW
41
        ^ 'comment contribution (avg)'
×
NEW
42
]
×
43

44
{ #category : #loading }
45
CommentContributionMetric >> load [
1✔
46

1✔
47
        userCommits := self
1✔
48
                               loadUserCompleteCommitsSince: (period at: #since)
1✔
49
                               until: (period at: #until)
1✔
50
]
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