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

moosetechnology / GitProjectHealth / 11667512120

04 Nov 2024 03:36PM UTC coverage: 59.207% (+0.2%) from 59.01%
11667512120

Pull #105

github

web-flow
Merge 0462ff346 into 3c4574e31
Pull Request #105: fix/add email user to the importer + tests

71 of 82 new or added lines in 3 files covered. (86.59%)

149 existing lines in 35 files now uncovered.

9582 of 16184 relevant lines covered (59.21%)

0.59 hits per line

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

90.48
/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 [
1✔
9

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

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

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

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

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

1✔
27

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

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

1✔
38
                                 differences average asFloat ].
1✔
39

1✔
40
        average := groupedByDate
1✔
41
                           ifEmpty: [ nil ]
1✔
42
                           ifNotEmpty: [ groupedByDate average asFloat ].
1✔
43

1✔
44
        ^ average 
1✔
45
]
1✔
46

47
{ #category : #accessing }
UNCOV
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