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

moosetechnology / GitProjectHealth / 13453448420

21 Feb 2025 09:02AM UTC coverage: 62.262% (+0.009%) from 62.253%
13453448420

Pull #134

github

web-flow
Merge fc015d9c3 into ddb3b9f35
Pull Request #134: WIP: fix closedMoergeRequest first test

707 of 710 new or added lines in 29 files covered. (99.58%)

5 existing lines in 2 files now uncovered.

9787 of 15719 relevant lines covered (62.26%)

0.62 hits per line

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

96.3
/src/GitLabHealth-Model-Analysis/Metric.class.st
1
Class {
2
        #name : #Metric,
3
        #superclass : #Object,
4
        #instVars : [
5
                'period',
6
                'over',
7
                'glhImporter',
8
                'jiraImporter'
9
        ],
10
        #category : #'GitLabHealth-Model-Analysis'
11
}
12

13
{ #category : #'as yet unclassified' }
NEW
14
Metric >> accronym [
×
NEW
15
        ^ (self name first uppercase asString), (self name select: #isUppercase) 
×
NEW
16
]
×
17

18
{ #category : #'as yet unclassified' }
19
Metric >> cacheSymbolFor: anEntityType since: since until: until [
1✔
20

1✔
21
        ^ (anEntityType printString , ' since ' , since printString , ' to '
1✔
22
           , until printString) asSymbol
1✔
23
]
1✔
24

25
{ #category : #calculating }
26
Metric >> calculate [ 
27
 ^self subclassResponsibility 
28
]
29

30
{ #category : #accessing }
31
Metric >> description [
32

33
        ^ self subclassResponsibility
34
]
35

36
{ #category : #accessing }
37
Metric >> glhImporter: anObject [
1✔
38

1✔
39
        glhImporter := anObject
1✔
40
]
1✔
41

42
{ #category : #accessing }
43
Metric >> jiraImporter: anObject [
1✔
44

1✔
45
        jiraImporter := anObject
1✔
46
]
1✔
47

48
{ #category : #loading }
49
Metric >> load [
50
        ^self subclassResponsibility
51
]
52

53
{ #category : #accessing }
54
Metric >> name [
1✔
55

1✔
56
        ^ self class name asString
1✔
57
]
1✔
58

59
{ #category : #accessing }
60
Metric >> over: anObject [
1✔
61

1✔
62
        over := anObject
1✔
63
]
1✔
64

65
{ #category : #initialization }
66
Metric >> setPeriodSince: since until: until [
1✔
67

1✔
68
        period :=  {
1✔
69
                        (#since -> since asDate).
1✔
70
                        (#until -> until asDate) } asDictionary
1✔
71
]
1✔
72

73
{ #category : #'utils - date' }
74
Metric >> setupGroupedDate [
1✔
75

1✔
76
        | groupedByDate start end increment overSymbol |
1✔
77
        groupedByDate := OrderedDictionary new.
1✔
78

1✔
79
        increment := 1.
1✔
80
        start := self transformDate: (period at: #since) to: over.
1✔
81
        end := self transformDate: (period at: #until) to: over.
1✔
82
        
1✔
83
        groupedByDate
1✔
84
                at: start printString
1✔
85
                ifAbsentPut: [ OrderedCollection new ].
1✔
86

1✔
87
        overSymbol := over name asLowercase asSymbol.
1✔
88
        overSymbol = #date ifTrue: [ over := #day ].
1✔
89
        overSymbol = #month ifTrue: [
1✔
90
                increment := 32.
1✔
91
                over := #day ].
1✔
92

1✔
93

1✔
94
        [ groupedByDate keys last asDate asDateAndTime < end ] whileTrue: [
1✔
95
                | index |
1✔
96
                index := groupedByDate keys last asDate asDateAndTime
1✔
97
                         + (increment perform: overSymbol).
1✔
98
                index := self transformDate: index to: over.
1✔
99
                groupedByDate
1✔
100
                        at: index printString
1✔
101
                        ifAbsentPut: [ OrderedCollection new ] ].
1✔
102

1✔
103

1✔
104
        over = #day ifTrue: [
1✔
105
                groupedByDate := (groupedByDate associations select: [ :date |
1✔
106
                                          | aWeekday |
1✔
107
                                          aWeekday := date key asDate weekday.
1✔
108
                                          (aWeekday = #Sunday or: [ aWeekday = #Saturday ])
1✔
109
                                                  not ]) asOrderedDictionary ].
1✔
110

1✔
111

1✔
112
        groupedByDate
1✔
113
                at: end printString
1✔
114
                ifAbsentPut: [ OrderedCollection new ].
1✔
115

1✔
116
        ^ groupedByDate
1✔
117
]
1✔
118

119
{ #category : #'utils - date' }
120
Metric >> transformDate: date to: aWeekOrMonthOrYear [
1✔
121

1✔
122
        aWeekOrMonthOrYear = Month ifTrue: [ ^ date asDate month asDate ].
1✔
123

1✔
124
        ^ (date asDate perform: ('as' , aWeekOrMonthOrYear name) asSymbol)
1✔
125
                  asDate
1✔
126
]
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

© 2026 Coveralls, Inc