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

moosetechnology / GitProjectHealth / 10880677211

16 Sep 2024 09:01AM UTC coverage: 20.332% (-0.2%) from 20.538%
10880677211

push

github

web-flow
Merge pull request #54 from moosetechnology/metrics-fixing

Metrics fixing

0 of 178 new or added lines in 19 files covered. (0.0%)

18 existing lines in 6 files now uncovered.

1961 of 9645 relevant lines covered (20.33%)

0.2 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 : #'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 [
×
32

×
33
        glhImporter := anObject
×
34
]
×
35

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

×
39
        jiraImporter := anObject
×
40
]
×
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 [
×
55

×
56
        over := anObject
×
57
]
×
58

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

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

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

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

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

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

×
87

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

×
97

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

×
105

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

×
110
        ^ groupedByDate
×
111
]
×
112

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

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

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