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

moosetechnology / GitProjectHealth / 16020007540

02 Jul 2025 08:25AM UTC coverage: 74.906% (+0.5%) from 74.453%
16020007540

Pull #209

github

web-flow
Merge pull request #215 from moosetechnology/fix-commit-distributions

fixing commit not sort and comparing commit within different time zone
Pull Request #209: Update with correct average for notes

654 of 1074 new or added lines in 8 files covered. (60.89%)

52 existing lines in 2 files now uncovered.

17567 of 23452 relevant lines covered (74.91%)

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

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

×
NEW
20
        "default is group by commitCreator (initialize)"
×
NEW
21
        commitGroups := commits groupedBy: self groupCommitBlock.
×
NEW
22

×
NEW
23
        groupToCommitByDate := commitGroups associations collect: [ :assoc |
×
NEW
24
                                       assoc key -> (dates collect: [ :date |
×
NEW
25
                                                date
×
NEW
26
                                                ->
×
NEW
27
                                                (assoc value select: [ :commit |
×
NEW
28
                                                                                                "weird, but only way I know to compare two dates with different timezone."
×
NEW
29
                                                         commit committed_date asDate asString  = date asString ]) ]) ].
×
NEW
30
         
×
NEW
31
        alreadyAdded := dates collect: [ :d | 0 ].
×
NEW
32
        groupToCommitByDate do: [ :assocGroupToCommitByDate |
×
NEW
33
                | chart |
×
NEW
34
                chart := (RSAbstractChart barHeights:
×
NEW
35
                                  (assocGroupToCommitByDate value collect: [ :dateToCommit |
×
NEW
36
                                           dateToCommit value size ])) bottom: alreadyAdded.
×
NEW
37
                c add: chart.
×
NEW
38
                alreadyAdded := alreadyAdded + chart yValues ].
×
NEW
39

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

63
{ #category : #'as yet unclassified' }
NEW
64
GLHCommitDistributionVisualization >> groupCommitBlock [
×
NEW
65

×
NEW
66
        ^ groupCommitBlock
×
NEW
67
]
×
68

69
{ #category : #'as yet unclassified' }
NEW
70
GLHCommitDistributionVisualization >> groupCommitBlock: anObject [
×
NEW
71

×
NEW
72
        groupCommitBlock := anObject
×
NEW
73
]
×
74

75
{ #category : #initialization }
NEW
76
GLHCommitDistributionVisualization >> initialize [
×
NEW
77

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