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

moosetechnology / GitProjectHealth / 16163940073

09 Jul 2025 08:10AM UTC coverage: 74.26% (-0.6%) from 74.908%
16163940073

Pull #216

github

web-flow
Merge ee8bd9087 into 8f0fcd09b
Pull Request #216: add issue class in model

10 of 328 new or added lines in 6 files covered. (3.05%)

24 existing lines in 2 files now uncovered.

17584 of 23679 relevant lines covered (74.26%)

0.74 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: aCommitsCollection [
×
12

×
NEW
13
        | c lb horizontal commitGroups groupToCommitByDate alreadyAdded dates commits |
×
14
        c := RSCompositeChart new.
×
NEW
15
        aCommitsCollection ifEmpty: [ ^ c canvas ].
×
NEW
16
        commits := aCommitsCollection sort: [ :c1 :c2 |
×
NEW
17
                           c1 committed_date > c2 committed_date ].
×
18
        "collect dates from oldest to youngest among commits"
×
NEW
19
        dates := (commits last committed_date to:
×
NEW
20
                  commits first committed_date) dates.
×
21

×
22
        "default is group by commitCreator (initialize)"
×
23
        commitGroups := commits groupedBy: self groupCommitBlock.
×
24

×
25
        groupToCommitByDate := commitGroups associations collect: [ :assoc |
×
26
                                       assoc key -> (dates collect: [ :date |
×
27
                                                date
×
28
                                                ->
×
NEW
29
                                                        (assoc value select: [ :commit | "weird, but only way I know to compare two dates with different timezone."
×
NEW
30
                                                                 commit committed_date asDate asString
×
NEW
31
                                                                 = date asString ]) ]) ].
×
NEW
32

×
33
        alreadyAdded := dates collect: [ :d | 0 ].
×
34
        groupToCommitByDate do: [ :assocGroupToCommitByDate |
×
35
                | chart |
×
36
                chart := (RSAbstractChart barHeights:
×
37
                                  (assocGroupToCommitByDate value collect: [ :dateToCommit |
×
38
                                           dateToCommit value size ])) bottom: alreadyAdded.
×
39
                c add: chart.
×
40
                alreadyAdded := alreadyAdded + chart yValues ].
×
41

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

65
{ #category : #'as yet unclassified' }
66
GLHCommitDistributionVisualization >> groupCommitBlock [
×
67

×
68
        ^ groupCommitBlock
×
69
]
×
70

71
{ #category : #'as yet unclassified' }
72
GLHCommitDistributionVisualization >> groupCommitBlock: anObject [
×
73

×
74
        groupCommitBlock := anObject
×
75
]
×
76

77
{ #category : #initialization }
78
GLHCommitDistributionVisualization >> initialize [
×
79

×
80
        super initialize.
×
81
        groupCommitBlock := [ :commit | commit commitCreator ]
×
82
]
×
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