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

moosetechnology / GitProjectHealth / 10849965510

13 Sep 2024 01:03PM UTC coverage: 17.669%. First build
10849965510

Pull #54

github

web-flow
Merge 9d4695b3c into 6bbc9cee6
Pull Request #54: Metrics fixing

0 of 156 new or added lines in 17 files covered. (0.0%)

1589 of 8993 relevant lines covered (17.67%)

0.18 hits per line

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

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

7
{ #category : #calculating }
8
TimeBetweenCommitMetric >> calculate [
×
9

×
10
        | commitSortedByDate commits1 commits2 differences groupedByDate dateOver average |
×
11
        userCommits ifNil: [ self load ].
×
12
        groupedByDate := self setupGroupedDate.
×
13

×
14
        commitSortedByDate := userCommits sorted: [ :commit1 :commit2 |
×
15
                                      commit1 committed_date
×
16
                                      < commit2 committed_date ].
×
17

×
18
        commitSortedByDate do: [ :commit |
×
19
                dateOver := self transformDate: commit committed_date to: over.
×
20

×
21
                groupedByDate
×
22
                        at: dateOver printString
×
23
                        ifPresent: [ :value | value add: commit ] ].
×
24

×
25
        groupedByDate := groupedByDate select: [ :group | group size >= 2 ].
×
26

×
27

×
28
        groupedByDate := groupedByDate collect: [ :group |
×
29
                                 differences := (1 to: group size - 1) collect: [ :i |
×
30
                                                        commits1 := group at: i.
×
31
                                                        commits2 := group at: i + 1.
×
32

×
33
                                                        (commits2 committed_date
×
34
                                                         - commits1 committed_date)
×
35
                                                                asSeconds ].
×
36
                        
×
37

×
38
                                 differences average asFloat ].
×
39

×
40
        average := groupedByDate
×
41
                           ifEmpty: [ nil ]
×
NEW
42
                           ifNotEmpty: [ groupedByDate average asFloat ].
×
43

×
NEW
44
        ^ average 
×
45
]
×
46

47
{ #category : #accessing }
48
TimeBetweenCommitMetric >> description [
×
49

×
50
        ^ 'average time between commits (in seconds)'
×
51
]
×
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