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

moosetechnology / GitProjectHealth / 13372773799

17 Feb 2025 02:41PM UTC coverage: 62.03%. Remained the same
13372773799

Pull #130

github

web-flow
Merge 08e63bd1f into 8ff2bbfd9
Pull Request #130: create w new metric class

1464 of 2739 new or added lines in 38 files covered. (53.45%)

3 existing lines in 3 files now uncovered.

9624 of 15515 relevant lines covered (62.03%)

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

28
        ^self subclassResponsibility
29
]
30

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

34
        ^ self subclassResponsibility
35
]
36

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1✔
94

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

1✔
104

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

1✔
112

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

1✔
117
        ^ groupedByDate
1✔
118
]
1✔
119

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

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

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