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

moosetechnology / GitProjectHealth / 13943480841

19 Mar 2025 09:45AM UTC coverage: 70.207% (+2.2%) from 68.041%
13943480841

push

github

web-flow
Merge pull request #163 from moosetechnology/develop

add more metric to main

2397 of 3773 new or added lines in 42 files covered. (63.53%)

1 existing line in 1 file now uncovered.

13708 of 19525 relevant lines covered (70.21%)

0.7 hits per line

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

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

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

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

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

1✔
16
        contributions := projectCommits 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

1✔
29
        groupedByDate := groupedByDate collect: [ :contribs |
1✔
30
                                 contribs sum: [ :v | v at: #addition ] ].
1✔
31

1✔
32
        ^ groupedByDate average asFloat
1✔
33
]
1✔
34

35
{ #category : #accessing }
NEW
36
CodeAdditionByCommitProjectMetric >> description [
×
NEW
37

×
NEW
38
        ^ 'Code Addition by Commits (avg)'
×
NEW
39
]
×
40

41
{ #category : #loading }
42
CodeAdditionByCommitProjectMetric >> load [
1✔
43

1✔
44
        projectCommits := self
1✔
45
                                  loadCommitsSince: (period at: #since)
1✔
46
                                  until: (period at: #until)
1✔
47
]
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