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

moosetechnology / GitProjectHealth / 13942005501

19 Mar 2025 08:26AM UTC coverage: 70.206% (+0.7%) from 69.498%
13942005501

Pull #164

github

web-flow
Merge 1d9f8d731 into a6dda60b9
Pull Request #164: Main-into-branch-for-sync

465 of 470 new or added lines in 3 files covered. (98.94%)

13705 of 19521 relevant lines covered (70.21%)

0.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.84
/src/GitLabHealth-Model-Analysis/CommentLinesAddedProjectMetric.class.st
1
Class {
2
        #name : #CommentLinesAddedProjectMetric,
3
        #superclass : #ProjectMetric,
4
        #instVars : [
5
                'maxCommitWindow'
6
        ],
7
        #category : #'GitLabHealth-Model-Analysis'
8
}
9

10
{ #category : #calculating }
11
CommentLinesAddedProjectMetric >> calculate [
1✔
12

1✔
13
        | groupedByDate gitAnalyzer contributions |
1✔
14
        projectCommits ifNil: [ self load ].
1✔
15
        groupedByDate := self setupGroupedDate.
1✔
16

1✔
17
        gitAnalyzer := GitAnalyzer new.
1✔
18

1✔
19
        contributions := projectCommits collect: [ :commit |
1✔
20
                                 commit -> (gitAnalyzer
1✔
21
                                          fromCommit: commit;
1✔
22
                                          analyseCommentContribution) ].
1✔
23

1✔
24

1✔
25
        contributions do: [ :assoc |
1✔
26
                | dateOver |
1✔
27
                dateOver := self transformDate: assoc key created_at to: over.
1✔
28
                groupedByDate
1✔
29
                        at: dateOver printString
1✔
30
                        ifPresent: [ :v | v add: assoc value ] ].
1✔
31

1✔
32
        groupedByDate := groupedByDate collect: [ :contribs |
1✔
33
                                 contribs
1✔
34
                                         ifNotEmpty: [ contribs sum ]
1✔
35
                                         ifEmpty: [ 0 ] ].
1✔
36

1✔
37

1✔
38
        ^ groupedByDate average asFloat
1✔
39
]
1✔
40

41
{ #category : #accessing }
NEW
42
CommentLinesAddedProjectMetric >> description [
×
NEW
43
        "as the sum of each comment line in commits made in the period, average by the unit scale"
×
NEW
44

×
NEW
45
        ^ 'Comment lines added (avg by ',over printString,')'
×
NEW
46
]
×
47

48
{ #category : #loading }
49
CommentLinesAddedProjectMetric >> load [
1✔
50

1✔
51
        projectCommits := self loadCommitsSince: (period at:#since) until: (period at:#until) 
1✔
52
]
1✔
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