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

moosetechnology / GitProjectHealth / 11163879852

03 Oct 2024 02:24PM UTC coverage: 58.906% (+25.2%) from 33.667%
11163879852

push

github

web-flow
Merge pull request #75 from moosetechnology/develop

V1.0.0

6210 of 8212 new or added lines in 80 files covered. (75.62%)

130 existing lines in 6 files now uncovered.

8903 of 15114 relevant lines covered (58.91%)

0.59 hits per line

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

95.83
/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 : #calculating }
19
Metric >> calculate [
20

21
        ^self subclassResponsibility
22
]
23

24
{ #category : #accessing }
25
Metric >> description [
26

27
        ^ self subclassResponsibility
28
]
29

30
{ #category : #accessing }
31
Metric >> glhImporter: anObject [
1✔
32

1✔
33
        glhImporter := anObject
1✔
34
]
1✔
35

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

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

42
{ #category : #loading }
43
Metric >> load [
44
        ^self subclassResponsibility
45
]
46

47
{ #category : #accessing }
48
Metric >> name [
49

50
        ^ self subclassResponsibility
51
]
52

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

1✔
56
        over := anObject
1✔
57
]
1✔
58

59
{ #category : #initialization }
60
Metric >> setPeriodSince: since until: until [
1✔
61

1✔
62
        period :=  {
1✔
63
                        (#since -> since asDate).
1✔
64
                        (#until -> until asDate) } asDictionary
1✔
65
]
1✔
66

67
{ #category : #'utils - date' }
68
Metric >> setupGroupedDate [
1✔
69

1✔
70
        | groupedByDate start end increment overSymbol |
1✔
71
        groupedByDate := OrderedDictionary new.
1✔
72

1✔
73
        increment := 1.
1✔
74
        start := self transformDate: (period at: #since) to: over.
1✔
75
        end := self transformDate: (period at: #until) to: over.
1✔
76
        
1✔
77
        groupedByDate
1✔
78
                at: start printString
1✔
79
                ifAbsentPut: [ OrderedCollection new ].
1✔
80

1✔
81
        overSymbol := over name asLowercase asSymbol.
1✔
82
        overSymbol = #date ifTrue: [ over := #day ].
1✔
83
        overSymbol = #month ifTrue: [
1✔
84
                increment := 32.
1✔
85
                over := #day ].
1✔
86

1✔
87

1✔
88
        [ groupedByDate keys last asDateAndTime < end ] whileTrue: [
1✔
89
                | index |
1✔
90
                index := groupedByDate keys last asDateAndTime
1✔
91
                         + (increment perform: overSymbol).
1✔
92
                index := self transformDate: index to: over.
1✔
93
                groupedByDate
1✔
94
                        at: index printString
1✔
95
                        ifAbsentPut: [ OrderedCollection new ] ].
1✔
96

1✔
97

1✔
98
        over = #day ifTrue: [
1✔
99
                groupedByDate := (groupedByDate associations select: [ :date |
1✔
100
                                          | aWeekday |
1✔
101
                                          aWeekday := date key asDate weekday.
1✔
102
                                          (aWeekday = #Sunday or: [ aWeekday = #Saturday ])
1✔
103
                                                  not ]) asOrderedDictionary ].
1✔
104

1✔
105

1✔
106
        groupedByDate
1✔
107
                at: end printString
1✔
108
                ifAbsentPut: [ OrderedCollection new ].
1✔
109

1✔
110
        ^ groupedByDate
1✔
111
]
1✔
112

113
{ #category : #'utils - date' }
114
Metric >> transformDate: date to: aWeekOrMonthOrYear [
1✔
115

1✔
116
        aWeekOrMonthOrYear = Month ifTrue: [ ^ date asDate month asDate ].
1✔
117

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