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

moosetechnology / GitProjectHealth / 13991037947

21 Mar 2025 11:46AM UTC coverage: 69.927% (-0.5%) from 70.404%
13991037947

Pull #157

github

web-flow
Merge 422845cad into deee850ed
Pull Request #157: new Note entity

1195 of 2071 new or added lines in 18 files covered. (57.7%)

2 existing lines in 1 file now uncovered.

14061 of 20108 relevant lines covered (69.93%)

0.7 hits per line

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

91.67
/src/GitLabHealth-Model-Analysis/CreatedNotesByACRByProjectMetric.class.st
1
Class {
2
        #name : #CreatedNotesByACRByProjectMetric,
3
        #superclass : #ProjectMetric,
4
        #category : #'GitLabHealth-Model-Analysis'
5
}
6

7
{ #category : #'as yet unclassified' }
8
CreatedNotesByACRByProjectMetric >> calculate [  
1✔
9
    | groupedByDate regex filteredGroupedByDate |  
1✔
10

1✔
11
    projectMergeRequests ifNil: [ self load ].  
1✔
12
    groupedByDate := self setupGroupedDate.  
1✔
13

1✔
14
    "Définition du regex pour filtrer les notes"
1✔
15
    regex := '.*Auto code review has detected that the code violates this rule.*' asRegex.
1✔
16

1✔
17
    "Parcourir les merge requests et regrouper les notes par date"
1✔
18
    projectMergeRequests do: [ :mr |  
1✔
19
        mr note do: [ :note |  
1✔
20
            | dateOver |  
1✔
21
            dateOver := self transformDate: note created_at to: over.  
1✔
22
            groupedByDate at: dateOver printString ifPresent: [ :v | v add: note ].  
1✔
23
        ]  
1✔
24
    ].  
1✔
25

1✔
26
    "Appliquer le regex sur les notes déjà filtrées par période"
1✔
27
    filteredGroupedByDate := groupedByDate collect: [ :notesGroup |  
1✔
28
        (notesGroup select: [ :note | regex search: note body ]) size.  
1✔
29
    ].  
1✔
30

1✔
31
    "Retourner le total des notes filtrées"
1✔
32
    ^ filteredGroupedByDate sum.
1✔
33

1✔
34
]
1✔
35

36
{ #category : #accessing }
NEW
37
CreatedNotesByACRByProjectMetric >> description [
×
NEW
38
        ^ 'Nb AutoCodeReview notes for a project (all MR) in a given timeline'
×
NEW
39
]
×
40

41
{ #category : #loading }
42
CreatedNotesByACRByProjectMetric >> load [
1✔
43
        projectMergeRequests := self
1✔
44
                              loadMergeRequestsSince:  (period at: #since)
1✔
45
                              until:  (period at: #until) .
1✔
46
        projectMergeRequests do: [ :mr | glhImporter importNotesfromMergeRequest: mr ].
1✔
47
]
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

© 2025 Coveralls, Inc