• 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

0.0
/src/GitLabHealth-Model-Visualization/GLHCommitDistributionVisualization.class.st
1
Class {
2
        #name : #GLHCommitDistributionVisualization,
3
        #superclass : #MiAbstractVisualization,
4
        #instVars : [
5
                'groupCommitBlock'
6
        ],
7
        #category : 'GitLabHealth-Model-Visualization'
8
}
9

10
{ #category : #'instance creation' }
NEW
11
GLHCommitDistributionVisualization >> forCommits: commits [
×
NEW
12

×
NEW
13
        | c lb oldestCommit horizontal commitGroups groupToCommitByDate alreadyAdded dates |
×
NEW
14
        c := RSCompositeChart new.
×
NEW
15
        oldestCommit := commits last.
×
NEW
16
        dates := (oldestCommit committed_date to: Date today) dates.
×
NEW
17

×
NEW
18
        commitGroups := commits groupedBy: self groupCommitBlock.
×
NEW
19

×
NEW
20
        groupToCommitByDate := commitGroups associations collect: [ :assoc |
×
NEW
21
                                       assoc key -> (dates collect: [ :date |
×
NEW
22
                                                date
×
NEW
23
                                                ->
×
NEW
24
                                                (assoc value select: [ :commit |
×
NEW
25
                                                         commit committed_date asDate = date ]) ]) ].
×
NEW
26

×
NEW
27
        alreadyAdded := dates collect: [ :d | 0 ].
×
NEW
28
        groupToCommitByDate do: [ :assocGroupToCommitByDate |
×
NEW
29
                | chart |
×
NEW
30
                chart := (RSAbstractChart barHeights:
×
NEW
31
                                  (assocGroupToCommitByDate value collect: [ :dateToCommit |
×
NEW
32
                                           dateToCommit value size ])) bottom: alreadyAdded.
×
NEW
33
                c add: chart.
×
NEW
34
                alreadyAdded := chart yValues ].
×
NEW
35

×
NEW
36
        horizontal := c horizontalTick fromNames:
×
NEW
37
                              (dates collect: [ :date | date printString ]).
×
NEW
38
        horizontal configuration fontSize: 2.
×
NEW
39
        horizontal useDiagonalLabel.
×
NEW
40
        c verticalTick integer.
×
NEW
41
        c ylabel: 'Number of commits'.
×
NEW
42
        c title: 'Number of commits by date'.
×
NEW
43
        c build.
×
NEW
44
        lb := RSLegend new.
×
NEW
45
        lb layout vertical.
×
NEW
46
        commitGroups keys doWithIndex: [ :groupObject :index |
×
NEW
47
                lb
×
NEW
48
                        text: groupObject fullDisplayString
×
NEW
49
                        withBoxColor: (c plots at: index) computeColor ].
×
NEW
50
        lb container: c canvas.
×
NEW
51
        lb location
×
NEW
52
                right;
×
NEW
53
                middle;
×
NEW
54
                offset: 10 @ 0.
×
NEW
55
        lb build.
×
NEW
56
        ^ c canvas
×
NEW
57
]
×
58

59
{ #category : #accessing }
NEW
60
GLHCommitDistributionVisualization >> groupCommitBlock [
×
NEW
61

×
NEW
62
        ^ groupCommitBlock
×
NEW
63
]
×
64

65
{ #category : #accessing }
NEW
66
GLHCommitDistributionVisualization >> groupCommitBlock: anObject [
×
NEW
67

×
NEW
68
        groupCommitBlock := anObject
×
NEW
69
]
×
70

71
{ #category : #initialization }
NEW
72
GLHCommitDistributionVisualization >> initialize [
×
NEW
73

×
NEW
74
        super initialize.
×
NEW
75
        groupCommitBlock := [ :commit | commit commitCreator ]
×
NEW
76
]
×
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

© 2025 Coveralls, Inc