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

moosetechnology / GitProjectHealth / 10682053149

03 Sep 2024 11:29AM UTC coverage: 18.493%. First build
10682053149

Pull #47

github

web-flow
Merge bae5d1107 into 049515451
Pull Request #47: refactor: remove GitMetric class and subclasses

0 of 176 new or added lines in 10 files covered. (0.0%)

1590 of 8598 relevant lines covered (18.49%)

0.18 hits per line

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

0.0
/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 : #calculating }
14
Metric >> calculate [
15

16
        ^self subclassResponsibility
17
]
18

19
{ #category : #accessing }
20
Metric >> description [
21

22
        ^ self subclassResponsibility
23
]
24

25
{ #category : #accessing }
NEW
26
Metric >> glhImporter: anObject [
×
NEW
27

×
NEW
28
        glhImporter := anObject
×
NEW
29
]
×
30

31
{ #category : #accessing }
NEW
32
Metric >> jiraImporter: anObject [
×
NEW
33

×
NEW
34
        jiraImporter := anObject
×
NEW
35
]
×
36

37
{ #category : #loading }
38
Metric >> load [
39
        ^self subclassResponsibility
40
]
41

42
{ #category : #accessing }
43
Metric >> name [
44

45
        ^ self subclassResponsibility
46
]
47

48
{ #category : #accessing }
49
Metric >> over: anObject [
×
50

×
51
        over := anObject
×
52
]
×
53

54
{ #category : #initialization }
55
Metric >> setPeriodSince: since until: until [
×
56

×
57
        period :=  {
×
58
                        (#since -> since asDate).
×
59
                        (#until -> until asDate) } asDictionary
×
60
]
×
61

62
{ #category : #'utils - date' }
63
Metric >> setupGroupedDate [
×
64

×
65
        | groupedByDate start end increment overSymbol |
×
66
        groupedByDate := OrderedDictionary new.
×
67

×
68
        increment := 1.
×
69
        start := self transformDate: (period at: #since) to: over.
×
70
        end := self transformDate: (period at: #until) to: over.
×
71

×
72
        groupedByDate
×
73
                at: start printString
×
74
                ifAbsentPut: [ OrderedCollection new ].
×
75

×
76
        overSymbol := over name asLowercase asSymbol.
×
77
        overSymbol = #date ifTrue: [ over := #day ].
×
78
        overSymbol = #month ifTrue: [
×
79
                increment := 32.
×
80
                over := #day ].
×
81

×
82

×
83
        [ groupedByDate keys last asDateAndTime < end ] whileTrue: [
×
84
                | index |
×
85
                index := groupedByDate keys last asDateAndTime
×
86
                         + (increment perform: overSymbol).
×
87
                index := self transformDate: index to: over.
×
88
                groupedByDate
×
89
                        at: index printString
×
90
                        ifAbsentPut: [ OrderedCollection new ] ].
×
91

×
92

×
93
        over = #day ifTrue: [
×
94
                groupedByDate := (groupedByDate associations select: [ :date |
×
95
                                          | aWeekday |
×
96
                                          aWeekday := date key asDate weekday.
×
97
                                          (aWeekday = #Sunday or: [ aWeekday = #Saturday ])
×
98
                                                  not ]) asOrderedDictionary ].
×
99

×
100

×
101
        groupedByDate
×
102
                at: end printString
×
103
                ifAbsentPut: [ OrderedCollection new ].
×
104

×
105
        ^ groupedByDate
×
106
]
×
107

108
{ #category : #'utils - date' }
109
Metric >> transformDate: date to: aWeekOrMonthOrYear [
×
110

×
111
        aWeekOrMonthOrYear = Month ifTrue: [ ^ date asDate month asDate ].
×
112

×
113
        ^ (date asDate perform: ('as' , aWeekOrMonthOrYear name) asSymbol)
×
114
                  asDate
×
115
]
×
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