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

moosetechnology / GitProjectHealth / 11277687347

10 Oct 2024 03:58PM UTC coverage: 58.55% (+2.3%) from 56.272%
11277687347

Pull #81

github

web-flow
Merge 7276be932 into 150421ba8
Pull Request #81: Refactoring/rename

35 of 107 new or added lines in 7 files covered. (32.71%)

53 existing lines in 2 files now uncovered.

8930 of 15252 relevant lines covered (58.55%)

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' }
11
GLHCommitDistributionVisualization >> forCommits: commits [
×
12

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

×
19
        commitGroups := commits groupedBy: self groupCommitBlock.
×
20

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

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

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

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

×
63
        ^ groupCommitBlock
×
64
]
×
65

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

×
69
        groupCommitBlock := anObject
×
70
]
×
71

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

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