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

moosetechnology / GitProjectHealth / 12087642532

29 Nov 2024 03:56PM UTC coverage: 59.195% (-0.004%) from 59.199%
12087642532

Pull #112

github

web-flow
Merge 8d4e0e080 into 2f02e4eeb
Pull Request #112: feat(Metrics): add CommitFrequencyProjectMetric

76 of 141 new or added lines in 5 files covered. (53.9%)

5 existing lines in 2 files now uncovered.

9663 of 16324 relevant lines covered (59.2%)

0.59 hits per line

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

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

11
{ #category : #loading }
12
ProjectMetric >> loadCommitsSince: since until: until [
1✔
13

1✔
14
        | cacheSymbol allCommits |
1✔
15
        glhImporter withCommitDiffs: false.
1✔
16

1✔
17
        cacheSymbol := self
1✔
18
                               cacheSymbolFor: GLHCommit
1✔
19
                               since: since
1✔
20
                               until: until.
1✔
21

1✔
22
        "download commits unless project cache is not empty"
1✔
23
        allCommits := project repository
1✔
24
                                      cacheAt: cacheSymbol
1✔
25
                                      ifAbsentPut: [
1✔
26
                                              | foundCommits |
1✔
27
                                              foundCommits := glhImporter
1✔
28
                                                                      importCommitsOfProject: project
1✔
29
                                                                      since: since
1✔
30
                                                                      until: until.
1✔
31
                                              foundCommits ].
1✔
32

1✔
33
        allCommits do: [ :commit | glhImporter importCreatorOfCommit: commit ].
1✔
34
        glhImporter chainsCommitsFrom: allCommits.
1✔
35
        glhImporter withCommitDiffs: true.
1✔
36

1✔
37
        ^ allCommits
1✔
38
]
1✔
39

40
{ #category : #loading }
NEW
41
ProjectMetric >> loadMergeRequestsSince: since until: until [
×
NEW
42

×
NEW
43
        | cacheSymbol mergeRequests |
×
NEW
44
        glhImporter withCommitDiffs: false.
×
NEW
45
        cacheSymbol := self
×
NEW
46
                               cacheSymbolFor: GLHMergeRequest
×
NEW
47
                               since: since
×
NEW
48
                               until: until.
×
NEW
49

×
NEW
50
        mergeRequests := project cacheAt: cacheSymbol ifAbsentPut: [
×
NEW
51
                                         glhImporter
×
NEW
52
                                                       importMergeRequests: project
×
NEW
53
                                                       since: since
×
NEW
54
                                                       until: until].
×
NEW
55
                                         .
×
NEW
56

×
NEW
57
        mergeRequests := mergeRequests flattened.
×
NEW
58
        glhImporter withCommitDiffs: true.
×
NEW
59

×
NEW
60
        mergeRequests do: [ :mr | glhImporter importMergeResquestAuthor: mr ].
×
NEW
61

×
NEW
62
        ^ mergeRequests
×
NEW
63
]
×
64

65
{ #category : #accessing }
NEW
66
ProjectMetric >> project [
×
NEW
67

×
NEW
68
        ^ project
×
NEW
69
]
×
70

71
{ #category : #accessing }
72
ProjectMetric >> project: anObject [
1✔
73

1✔
74
        project := anObject
1✔
75
]
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