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

moosetechnology / GitProjectHealth / 10924946411

18 Sep 2024 03:06PM UTC coverage: 53.254% (+0.8%) from 52.46%
10924946411

Pull #65

github

web-flow
Merge 48d7e7547 into 97972f643
Pull Request #65: feat: add code addition and deletion by tickets metric

256 of 297 new or added lines in 5 files covered. (86.2%)

7 existing lines in 1 file now uncovered.

6857 of 12876 relevant lines covered (53.25%)

0.53 hits per line

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

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

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

1✔
10
        | groupedByDate dateOver |
1✔
11
        userMergeRequests ifNil: [ self load ].
1✔
12
        groupedByDate := self setupGroupedDate.
1✔
13
        userMergeRequests ifEmpty: [ ^ 0 ].
1✔
14

1✔
15

1✔
16
        userMergeRequests do: [ :userMergeRequest |
1✔
17
                dateOver := self transformDate: userMergeRequest created_at to: over.
1✔
18
                groupedByDate
1✔
19
                        at: dateOver printString
1✔
20
                        ifPresent: [ :value | value add: userMergeRequest ] ].
1✔
21

1✔
22
        groupedByDate := groupedByDate collect: [ :group |  
1✔
23
                | average |
1✔
24
                average := (group collect: [ :mergeRequest | mergeRequest commits sum: [ :commit | commit additions ] ]) average
1✔
25
                 
1✔
26
        ].
1✔
27

1✔
28
        ^ groupedByDate average asFloat
1✔
29
]
1✔
30

31
{ #category : #accessing }
NEW
32
CodeAdditionByTicketMetric >> description [
×
NEW
33

×
NEW
34
        ^ 'average code addition by merge request associated with a jira ticket'
×
NEW
35
]
×
36

37
{ #category : #loading }
38
CodeAdditionByTicketMetric >> load [
1✔
39

1✔
40
        userMergeRequests := self
1✔
41
                                     loadUserCompleteMergeRequestsWithJiraIssueSince:
1✔
42
                                     (period at: #since)
1✔
43
                                     until: (period at: #until).
1✔
44
]
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