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

moosetechnology / GitProjectHealth / 13372773799

17 Feb 2025 02:41PM UTC coverage: 62.03%. Remained the same
13372773799

Pull #130

github

web-flow
Merge 08e63bd1f into 8ff2bbfd9
Pull Request #130: create w new metric class

1464 of 2739 new or added lines in 38 files covered. (53.45%)

3 existing lines in 3 files now uncovered.

9624 of 15515 relevant lines covered (62.03%)

0.62 hits per line

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

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

7
{ #category : #calculating }
8
CodeAdditionMetric >> calculate [
1✔
9

1✔
10
        | gitAnalyzer contributions groupedByDate |
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
                                          analyseCommitContribution) ].
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 sum: [ :v | v at: #addition ] ].
1✔
35

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

39
{ #category : #accessing }
NEW
40
CodeAdditionMetric >> description [
×
NEW
41

×
NEW
42
        ^ 'code addition (avg)'
×
NEW
43
]
×
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