From 280fcb7caad7727cb1f16a2444159894ea91dea0 Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Mon, 4 Nov 2024 15:43:56 +0100 Subject: [PATCH 1/4] some tests --- .../GLHApiMock.class.st | 64 ++++++++++++++++++- .../GLHModelImporterLocalTest.class.st | 16 ++++- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/src/GitLabHealth-Model-Importer-Tests/GLHApiMock.class.st b/src/GitLabHealth-Model-Importer-Tests/GLHApiMock.class.st index a5835ef..9a87144 100644 --- a/src/GitLabHealth-Model-Importer-Tests/GLHApiMock.class.st +++ b/src/GitLabHealth-Model-Importer-Tests/GLHApiMock.class.st @@ -1,7 +1,7 @@ Class { #name : #GLHApiMock, #superclass : #GLHApi, - #category : 'GitLabHealth-Model-Importer-Tests' + #category : #'GitLabHealth-Model-Importer-Tests' } { #category : #'api - commits' } @@ -10,3 +10,65 @@ GLHApiMock >> commitDiff: aCommitID ofProject: aProjectId unidiff: aBoolean [ aCommitID = 'createError' ifTrue: [ ^ '{"message":"500 Internal Server Error"}' ] ] + +{ #category : #api } +GLHApiMock >> user: aUserID [ + + ^ '{ + "id": 123, + "username": "jack.dupond", + "name": "dupond jack", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.myCompany.com/uploads/-/system/user/avatar/123/avatar.png", + "web_url": "https://gitlab.myCompany.com/Jack.Dupond", + "created_at": "2021-06-19T21:11:06.114+02:00", + "bio": "I am a very good developer. All my life I try to be as good as Badetitou", + "location": "", + "public_email": "jack.dupond-public@myCompany.com", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "is_followed": false, + "local_time": "3:05 PM", + "last_sign_in_at": "2024-10-31T09:16:46.412+01:00", + "confirmed_at": "2021-06-19T21:11:05.919+02:00", + "last_activity_on": "2024-11-04", + "email": "jack.dupond@myCompany.com", + "theme_id": 8, + "color_scheme_id": 1, + "projects_limit": 0, + "current_sign_in_at": "2024-11-04T09:06:50.149+01:00", + "identities": [ + { + "provider": "azure_activedirectory_v2", + "extern_uid": "3de29e50-1847-11ccd28ddc23e22a" + } + ], + "can_create_group": false, + "can_create_project": false, + "two_factor_enabled": false, + "external": false, + "private_profile": false, + "commit_email": "jack.dupond-commiter@myCompany.com", + "is_admin": false, + "note": null, + "namespace_id": 1234, + "created_by": null, + "email_reset_offered_at": null, + "highest_role": 50, + "current_sign_in_ip": "10.12.0.12", + "last_sign_in_ip": "10.12.0.12", + "sign_in_count": 12345 +} + ' +] diff --git a/src/GitLabHealth-Model-Importer-Tests/GLHModelImporterLocalTest.class.st b/src/GitLabHealth-Model-Importer-Tests/GLHModelImporterLocalTest.class.st index cd121f9..53e1660 100644 --- a/src/GitLabHealth-Model-Importer-Tests/GLHModelImporterLocalTest.class.st +++ b/src/GitLabHealth-Model-Importer-Tests/GLHModelImporterLocalTest.class.st @@ -8,7 +8,7 @@ Class { 'importer', 'model' ], - #category : 'GitLabHealth-Model-Importer-Tests' + #category : #'GitLabHealth-Model-Importer-Tests' } { #category : #running } @@ -19,7 +19,7 @@ GLHModelImporterLocalTest >> setUp [ importer := GLHModelImporter new. model := GLHModel new. importer glhModel: model. - importer glhApi: GLHApiMock new + importer repoApi: GLHApiMock new ] { #category : #tests } @@ -53,3 +53,15 @@ GLHModelImporterLocalTest >> testIsServerError [ self assert: (importer isServerError: '{"message":"500 Internal Server Error"}') ] + +{ #category : #tests } +GLHModelImporterLocalTest >> testParseUserResult [ + + | user | + user := importer importUser: 123. + self assert: user id equals: 123. + + self assert: user name equals: 'dupond jack'. + self assert: user email equals: 'jack.dupond@myCompany.com'. + self assert: user public_email equals: 'jack.dupond-public@myCompany.com'. +] From 0462ff346680cae8dde74a289baeb35196ed79de Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Mon, 4 Nov 2024 16:36:31 +0100 Subject: [PATCH 2/4] export email --- .../AnalysisReport.class.st | 19 ++-- .../ClosedMergeRequestMetric.class.st | 13 ++- .../ClosedTicketsMetric.class.st | 13 ++- .../CodeAdditionByMRMetric.class.st | 13 ++- .../CodeAdditionByTicketMetric.class.st | 13 ++- .../CodeAdditionMetric.class.st | 11 +-- .../CodeChurnMetric.class.st | 13 ++- .../CodeDeletionByMRMetric.class.st | 13 ++- .../CodeDeletionByTicketMetric.class.st | 13 ++- .../CodeDeletionMetric.class.st | 11 +-- .../CommentContributionMetric.class.st | 13 ++- .../CommitFrequencyMetric.class.st | 11 +-- .../CommitsNumberByJiraTicketsMetric.class.st | 13 ++- .../ContributedProjectMetric.class.st | 11 +-- .../DelayUntilFirstChurnMetric.class.st | 13 ++- .../GLHUserCatalogue.class.st | 51 +++++----- .../GLHUserCatalogueItem.class.st | 9 +- .../GLHUserCatalogueV2.class.st | 81 ++++++++------- .../GitAnalyzer.class.st | 57 ++++++----- .../GitMetricExporter.class.st | 98 ++++++++++--------- .../JiraTimeMRTimeDifferenceMetric.class.st | 13 ++- .../MergeRequestDurationMetric.class.st | 13 ++- .../MergedMergeRequestMetric.class.st | 15 ++- .../Metric.class.st | 29 +++--- .../OpenedMergeRequestMetric.class.st | 13 ++- .../PendingMergeRequestMetric.class.st | 13 ++- .../ProjectAnalysisReport.class.st | 11 +-- .../ProjectMetric.class.st | 7 +- .../ReviewedByUserMergeRequestMetric.class.st | 15 ++- ...gedUnderAMinuteMergeRequestMetric.class.st | 15 ++- .../String.extension.st | 6 +- .../TimeBetweenCommitMetric.class.st | 11 +-- .../UserAnalysisReport.class.st | 11 +-- .../UserCommitsMetric.class.st | 15 ++- .../UserJiraMetric.class.st | 15 ++- .../UserMergeRequestMetric.class.st | 15 ++- .../UserMetric.class.st | 45 +++++---- src/GitLabHealth-Model-Analysis/package.st | 2 +- 38 files changed, 361 insertions(+), 392 deletions(-) diff --git a/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st b/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st index c2f60b6..2ec4938 100644 --- a/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st +++ b/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st @@ -1,46 +1,45 @@ Class { - #name : 'AnalysisReport', - #superclass : 'Object', + #name : #AnalysisReport, + #superclass : #Object, #instVars : [ 'period', 'over', 'metrics' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'initialization' } +{ #category : #initialization } AnalysisReport >> initialize [ metrics := Dictionary new ] -{ #category : 'accessing' } +{ #category : #accessing } AnalysisReport >> metrics [ ^ metrics ] -{ #category : 'accessing' } +{ #category : #accessing } AnalysisReport >> over [ ^ over ] -{ #category : 'accessing' } +{ #category : #accessing } AnalysisReport >> over: anObject [ over := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } AnalysisReport >> period [ ^ period ] -{ #category : 'accessing' } +{ #category : #accessing } AnalysisReport >> period: anObject [ period := anObject diff --git a/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st index 95146a0..86add80 100644 --- a/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'ClosedMergeRequestMetric', - #superclass : 'UserMergeRequestMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #ClosedMergeRequestMetric, + #superclass : #UserMergeRequestMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } ClosedMergeRequestMetric >> calculate [ | groupedByDate dateOver | @@ -28,13 +27,13 @@ ClosedMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } ClosedMergeRequestMetric >> description [ ^ 'number of closed merge requests' ] -{ #category : 'accessing' } +{ #category : #accessing } ClosedMergeRequestMetric >> name [ ^ 'closedMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st b/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st index cf4c0da..885f814 100644 --- a/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'ClosedTicketsMetric', - #superclass : 'UserJiraMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #ClosedTicketsMetric, + #superclass : #UserJiraMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } ClosedTicketsMetric >> calculate [ | groupedByDate dateOver | @@ -24,13 +23,13 @@ ClosedTicketsMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } ClosedTicketsMetric >> description [ ^ 'number of closed merge request associated with a jira ticket' ] -{ #category : 'accessing' } +{ #category : #accessing } ClosedTicketsMetric >> name [ ^ 'closedTickets' diff --git a/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st index 4674adb..3e0c4b3 100644 --- a/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'CodeAdditionByMRMetric', - #superclass : 'UserMergeRequestMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #CodeAdditionByMRMetric, + #superclass : #UserMergeRequestMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CodeAdditionByMRMetric >> calculate [ | groupedByDate dateOver | @@ -30,13 +29,13 @@ CodeAdditionByMRMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } CodeAdditionByMRMetric >> description [ ^ 'average code addition by merge request' ] -{ #category : 'loading' } +{ #category : #loading } CodeAdditionByMRMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st index 813d829..210463e 100644 --- a/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'CodeAdditionByTicketMetric', - #superclass : 'UserJiraMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #CodeAdditionByTicketMetric, + #superclass : #UserJiraMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CodeAdditionByTicketMetric >> calculate [ | groupedByDate dateOver | @@ -30,13 +29,13 @@ CodeAdditionByTicketMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } CodeAdditionByTicketMetric >> description [ ^ 'average code addition by merge request associated with a jira ticket' ] -{ #category : 'loading' } +{ #category : #loading } CodeAdditionByTicketMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st index 3ea58bd..064ab99 100644 --- a/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'CodeAdditionMetric', - #superclass : 'UserCommitsMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #CodeAdditionMetric, + #superclass : #UserCommitsMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CodeAdditionMetric >> calculate [ | gitAnalyzer contributions groupedByDate | @@ -37,7 +36,7 @@ CodeAdditionMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } CodeAdditionMetric >> description [ ^ 'code addition (avg)' diff --git a/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st index 62d81e4..46eaff6 100644 --- a/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st @@ -1,14 +1,13 @@ Class { - #name : 'CodeChurnMetric', - #superclass : 'UserCommitsMetric', + #name : #CodeChurnMetric, + #superclass : #UserCommitsMetric, #instVars : [ 'maxCommitWindow' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CodeChurnMetric >> calculate [ | commits res groupedByDate totalContributions gitAnalyzer | @@ -66,13 +65,13 @@ CodeChurnMetric >> calculate [ ^ (groupedByDate collect: [ :date | date at: #percentage ]) average ] -{ #category : 'accessing' } +{ #category : #accessing } CodeChurnMetric >> description [ ^ 'churn % (W=' , maxCommitWindow printString , ')' ] -{ #category : 'initialization' } +{ #category : #initialization } CodeChurnMetric >> initialize [ maxCommitWindow := 3 ] diff --git a/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st index bd3c7ab..abb278a 100644 --- a/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'CodeDeletionByMRMetric', - #superclass : 'UserMergeRequestMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #CodeDeletionByMRMetric, + #superclass : #UserMergeRequestMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CodeDeletionByMRMetric >> calculate [ | groupedByDate dateOver | @@ -30,13 +29,13 @@ CodeDeletionByMRMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } CodeDeletionByMRMetric >> description [ ^ 'average code deletion by merge request' ] -{ #category : 'loading' } +{ #category : #loading } CodeDeletionByMRMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st index b59d283..9cdf88b 100644 --- a/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'CodeDeletionByTicketMetric', - #superclass : 'UserJiraMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #CodeDeletionByTicketMetric, + #superclass : #UserJiraMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CodeDeletionByTicketMetric >> calculate [ | groupedByDate dateOver | @@ -30,13 +29,13 @@ CodeDeletionByTicketMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } CodeDeletionByTicketMetric >> description [ ^ 'average code deletion by merge request associated with a jira ticket' ] -{ #category : 'loading' } +{ #category : #loading } CodeDeletionByTicketMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st index 8feb8e8..0d08a68 100644 --- a/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'CodeDeletionMetric', - #superclass : 'UserCommitsMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #CodeDeletionMetric, + #superclass : #UserCommitsMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CodeDeletionMetric >> calculate [ | gitAnalyzer contributions groupedByDate | @@ -37,7 +36,7 @@ CodeDeletionMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } CodeDeletionMetric >> description [ ^'code deletion (avg)' diff --git a/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st b/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st index f04d16d..149bf55 100644 --- a/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'CommentContributionMetric', - #superclass : 'UserCommitsMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #CommentContributionMetric, + #superclass : #UserCommitsMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CommentContributionMetric >> calculate [ | groupedByDate gitAnalyzer contributions | @@ -40,13 +39,13 @@ CommentContributionMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } CommentContributionMetric >> description [ ^ 'comment contribution (avg)' ] -{ #category : 'loading' } +{ #category : #loading } CommentContributionMetric >> load [ userCommits := self diff --git a/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st b/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st index f1e1855..1994ead 100644 --- a/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'CommitFrequencyMetric', - #superclass : 'UserCommitsMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #CommitFrequencyMetric, + #superclass : #UserCommitsMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CommitFrequencyMetric >> calculate [ | groupedByDate | @@ -22,7 +21,7 @@ CommitFrequencyMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } CommitFrequencyMetric >> description [ ^'commits frequency (avg)' diff --git a/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st b/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st index 7988338..3307e5d 100644 --- a/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'CommitsNumberByJiraTicketsMetric', - #superclass : 'UserJiraMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #CommitsNumberByJiraTicketsMetric, + #superclass : #UserJiraMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } CommitsNumberByJiraTicketsMetric >> calculate [ | groupedByDate dateOver | @@ -24,13 +23,13 @@ CommitsNumberByJiraTicketsMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } CommitsNumberByJiraTicketsMetric >> description [ ^ 'average number of commit by merge request associated to a jira ticket' ] -{ #category : 'loading' } +{ #category : #loading } CommitsNumberByJiraTicketsMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st b/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st index 725367e..8663cad 100644 --- a/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'ContributedProjectMetric', - #superclass : 'UserCommitsMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #ContributedProjectMetric, + #superclass : #UserCommitsMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } ContributedProjectMetric >> calculate [ | groupedByDate dateOver projects | @@ -26,7 +25,7 @@ ContributedProjectMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } ContributedProjectMetric >> description [ ^ 'number of project with min 1 commit of user' diff --git a/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st b/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st index a610633..29e14ac 100644 --- a/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st @@ -1,14 +1,13 @@ Class { - #name : 'DelayUntilFirstChurnMetric', - #superclass : 'UserCommitsMetric', + #name : #DelayUntilFirstChurnMetric, + #superclass : #UserCommitsMetric, #instVars : [ 'maxCommitWindow' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } DelayUntilFirstChurnMetric >> calculate [ | commits groupedByDate res average | @@ -70,14 +69,14 @@ DelayUntilFirstChurnMetric >> calculate [ ^ average ] -{ #category : 'accessing' } +{ #category : #accessing } DelayUntilFirstChurnMetric >> description [ ^ 'delay Until First Churn (W=' , maxCommitWindow printString , ')' ] -{ #category : 'initialization' } +{ #category : #initialization } DelayUntilFirstChurnMetric >> initialize [ super initialize. maxCommitWindow := 3 diff --git a/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st b/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st index e4bdeda..9db688e 100644 --- a/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st +++ b/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st @@ -1,15 +1,14 @@ Class { - #name : 'GLHUserCatalogue', - #superclass : 'Dictionary', + #name : #GLHUserCatalogue, + #superclass : #Dictionary, #instVars : [ 'users', 'anImporter' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'import' } +{ #category : #import } GLHUserCatalogue class >> loadFromJson: aString [ | catalogue dic | @@ -33,7 +32,7 @@ GLHUserCatalogue class >> loadFromJson: aString [ ^ catalogue ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogue class >> scrapeContributedProjectsForCommitAuthorsRelatedToUser: aGLHUser [ "get all " @@ -64,7 +63,7 @@ GLHUserCatalogue class >> scrapeContributedProjectsForCommitAuthorsRelatedToUser ^ (aGLHUser commits collect: [ :commit | commit author_name ]) asSet ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogue class >> scrapeWithImporter: anImporter contributedProjectsForCommitAuthorsRelatedToUser: aGLHUser [ "get all " @@ -88,13 +87,13 @@ GLHUserCatalogue class >> scrapeWithImporter: anImporter contributedProjectsForC ^ (aGLHUser commits collect: [ :commit | commit author_name ]) asSet ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogue >> addUser: aGLHUser [ self at: aGLHUser ifAbsentPut: [ Set new add: (aGLHUser username); add: (aGLHUser name) ; yourself ]. ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogue >> addUser: aGLHUser withName: name [ self @@ -108,7 +107,7 @@ GLHUserCatalogue >> addUser: aGLHUser withName: name [ yourself ] ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogue >> addUser: aGLHUser withNames: aCollectionOfNames [ self @@ -122,20 +121,20 @@ GLHUserCatalogue >> addUser: aGLHUser withNames: aCollectionOfNames [ yourself ] ] -{ #category : 'accessing' } +{ #category : #accessing } GLHUserCatalogue >> anImporter: aGLHModelImporter [ anImporter := aGLHModelImporter ] -{ #category : 'accessing' } +{ #category : #accessing } GLHUserCatalogue >> atWithId: anId [ |res | res := self associations detect: [ :assoc | assoc key id = anId ] ifNone: [ nil ]. ^ res ifNotNil: [ res value ]. ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogue >> collectUsernames [ | username2User | @@ -151,7 +150,7 @@ GLHUserCatalogue >> collectUsernames [ ^ username2User ] -{ #category : 'completion' } +{ #category : #completion } GLHUserCatalogue >> completeAuthorNameOfUser: aGLHUser with: authorName [ self @@ -163,7 +162,7 @@ GLHUserCatalogue >> completeAuthorNameOfUser: aGLHUser with: authorName [ self addUser: aGLHUser withName: authorName ] -{ #category : 'completion' } +{ #category : #completion } GLHUserCatalogue >> completeAuthorNameOfUser: aGLHUser withAll: authorNames [ self @@ -176,7 +175,7 @@ GLHUserCatalogue >> completeAuthorNameOfUser: aGLHUser withAll: authorNames [ self addUser: aGLHUser withNames: authorNames ] -{ #category : 'export' } +{ #category : #export } GLHUserCatalogue >> exportToJson [ | tempDic | @@ -197,13 +196,13 @@ GLHUserCatalogue >> exportToJson [ ^ STONJSON toString: tempDic ] -{ #category : 'initialization' } +{ #category : #initialization } GLHUserCatalogue >> initialize [ anImporter := GLHModelImporter importers anyOne. ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogue >> namesAt: aGLHUser [ | assoc | @@ -211,7 +210,7 @@ GLHUserCatalogue >> namesAt: aGLHUser [ ^ assoc value ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogue >> reImportAllUsers [ "use it after a catalogue import from JSON" @@ -224,7 +223,7 @@ GLHUserCatalogue >> reImportAllUsers [ assoc key: user ] ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogue >> scrapeAuthorNameForAllUsers [ | currentUsers | @@ -234,7 +233,7 @@ GLHUserCatalogue >> scrapeAuthorNameForAllUsers [ scrapeWithImporter: anImporter contributedProjectsForCommitAuthorsRelatedToUser: key) ] ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogue >> scrapeAuthorNameForUser: aGLHUser [ | assoc | @@ -244,7 +243,7 @@ GLHUserCatalogue >> scrapeAuthorNameForUser: aGLHUser [ contributedProjectsForCommitAuthorsRelatedToUser: aGLHUser) ] -{ #category : 'scrape' } +{ #category : #scrape } GLHUserCatalogue >> scrapeAuthorNamesForUsers: aUserCollection [ aUserCollection do: [ :aGLHUser | @@ -252,7 +251,7 @@ GLHUserCatalogue >> scrapeAuthorNamesForUsers: aUserCollection [ ]. ] -{ #category : 'completion' } +{ #category : #completion } GLHUserCatalogue >> searchModelForAuthorNamesOfUser: aGLHUser [ |assoc| assoc := self associationAt: aGLHUser. @@ -260,19 +259,19 @@ GLHUserCatalogue >> searchModelForAuthorNamesOfUser: aGLHUser [ ] -{ #category : 'search' } +{ #category : #search } GLHUserCatalogue >> searchName: aName [ ^ self select: [ :collectionOfName | (' ' join: collectionOfName) asLowercase includesSubstring: aName asLowercase ] ] -{ #category : 'search' } +{ #category : #search } GLHUserCatalogue >> searchUserWithName: aName [ ^ (self searchName: aName) keys. ] -{ #category : 'accessing' } +{ #category : #accessing } GLHUserCatalogue >> users [ ^ self keys ] diff --git a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st index 7d6db7f..5489928 100644 --- a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st +++ b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st @@ -1,15 +1,14 @@ Class { - #name : 'GLHUserCatalogueItem', - #superclass : 'Dictionary', + #name : #GLHUserCatalogueItem, + #superclass : #Dictionary, #instVars : [ 'user', 'names' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'initialization' } +{ #category : #initialization } GLHUserCatalogueItem >> initialize [ names := Set new. diff --git a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st index 39a7c65..856c61d 100644 --- a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st +++ b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st @@ -1,11 +1,10 @@ Class { - #name : 'GLHUserCatalogueV2', - #superclass : 'GLHUserCatalogue', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #GLHUserCatalogueV2, + #superclass : #GLHUserCatalogue, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'import' } +{ #category : #import } GLHUserCatalogueV2 class >> loadFromJson: aString [ | catalogue dic | @@ -31,7 +30,7 @@ GLHUserCatalogueV2 class >> loadFromJson: aString [ ^ catalogue ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 class >> scrapeContributedProjectsForCommitAuthorsRelatedToUser: aGLHUser [ "get all " @@ -62,7 +61,7 @@ GLHUserCatalogueV2 class >> scrapeContributedProjectsForCommitAuthorsRelatedToUs ^ (aGLHUser commits collect: [ :commit | commit author_name ]) asSet ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 class >> scrapeWithImporter: anImporter contributedProjectsForCommitAuthorsRelatedToUser: aGLHUser [ "get all " @@ -86,7 +85,7 @@ GLHUserCatalogueV2 class >> scrapeWithImporter: anImporter contributedProjectsFo ^ (aGLHUser commits collect: [ :commit | commit author_name ]) asSet ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 >> RSHeatMapLevenshtein [ | builder| @@ -101,7 +100,7 @@ GLHUserCatalogueV2 >> RSHeatMapLevenshtein [ builder canvas open ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 >> RSHeatMapLevenshteinTrimedAt: aBlockCondition [ | builder matrice| @@ -126,21 +125,21 @@ GLHUserCatalogueV2 >> RSHeatMapLevenshteinTrimedAt: aBlockCondition [ builder canvas open ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogueV2 >> addUser: aGLHUser [ ^ self at: aGLHUser name ifAbsentPut: [ self initACatalogueEntryForUser: aGLHUser ] ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogueV2 >> addUser: aGLHUser withName: name [ ^ self addUser: aGLHUser withNames: { name } ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames [ | entry | entry := (self @@ -150,13 +149,13 @@ GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames [ ^ entry ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames withProject: aProjectID [ ^ self addUser: aGLHUser withNames: aCollectionOfNames withProjects: { aProjectID } ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames withProjects: aCollectionOfProjectIDs [ |entry| @@ -166,14 +165,14 @@ GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames withProjec ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogueV2 >> addUser: aGLHUser withProject: aProjectID [ ^ self addUser: aGLHUser withProjects: {aProjectID}. ] -{ #category : 'adding' } +{ #category : #adding } GLHUserCatalogueV2 >> addUser: aGLHUser withProjects: aCollectionOfProjectIDs [ |entry| @@ -183,19 +182,19 @@ GLHUserCatalogueV2 >> addUser: aGLHUser withProjects: aCollectionOfProjectIDs [ ] -{ #category : 'accessing' } +{ #category : #accessing } GLHUserCatalogueV2 >> anImporter: aGLHModelImporter [ anImporter := aGLHModelImporter ] -{ #category : 'accessing' } +{ #category : #accessing } GLHUserCatalogueV2 >> atId: anId [ ^ self detect: [ :entry | (entry at: #user) id = anId ] ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 >> collectUsernames [ | username2User | @@ -212,7 +211,7 @@ GLHUserCatalogueV2 >> collectUsernames [ ^ username2User ] -{ #category : 'completion' } +{ #category : #completion } GLHUserCatalogueV2 >> completeAuthorNameOfUser: aGLHUser with: authorName [ self @@ -224,7 +223,7 @@ GLHUserCatalogueV2 >> completeAuthorNameOfUser: aGLHUser with: authorName [ self addUser: aGLHUser withName: authorName ] -{ #category : 'completion' } +{ #category : #completion } GLHUserCatalogueV2 >> completeAuthorNameOfUser: aGLHUser withAll: authorNames [ self @@ -237,7 +236,7 @@ GLHUserCatalogueV2 >> completeAuthorNameOfUser: aGLHUser withAll: authorNames [ self addUser: aGLHUser withNames: authorNames ] -{ #category : 'export' } +{ #category : #export } GLHUserCatalogueV2 >> exportToJson [ | tempDic | @@ -264,7 +263,7 @@ GLHUserCatalogueV2 >> exportToJson [ ^ STONJSON toStringPretty: tempDic ] -{ #category : 'fuse' } +{ #category : #fuse } GLHUserCatalogueV2 >> fuse: mainUser with: subUser [ self at: mainUser ifPresent: [ :entry | self at: subUser ifAbsent: [ ^ self ]. @@ -274,7 +273,7 @@ GLHUserCatalogueV2 >> fuse: mainUser with: subUser [ ]. ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } GLHUserCatalogueV2 >> initACatalogueEntryForUser: aGLHUser [. ^ Dictionary new @@ -289,13 +288,13 @@ GLHUserCatalogueV2 >> initACatalogueEntryForUser: aGLHUser [. yourself ] -{ #category : 'initialization' } +{ #category : #initialization } GLHUserCatalogueV2 >> initialize [ anImporter := GLHModelImporter new. ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 >> levenshteinMatrix [ | matrix| @@ -312,17 +311,17 @@ GLHUserCatalogueV2 >> levenshteinMatrix [ ^ matrix. ] -{ #category : 'accessing - name' } +{ #category : #'accessing - name' } GLHUserCatalogueV2 >> names [ ^ self collect: [ :entry | entry at: #names ] ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 >> namesAt: aGLHUser [ ^ (self at: aGLHUser name) at: #names. ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 >> reImportAllUsers [ "use it after a catalogue import from JSON" @@ -338,7 +337,7 @@ GLHUserCatalogueV2 >> reImportAllUsers [ assoc value at: #user put: user ] ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 >> reImportUser: aGLHUser [ "use it after a catalogue import from JSON" |user| @@ -354,7 +353,7 @@ GLHUserCatalogueV2 >> reImportUser: aGLHUser [ ] -{ #category : 'scrape' } +{ #category : #scrape } GLHUserCatalogueV2 >> scrapeAuthorNameForAllRealUsers [ |listOfUsers| @@ -362,7 +361,7 @@ GLHUserCatalogueV2 >> scrapeAuthorNameForAllRealUsers [ listOfUsers do: [ :user | self scrapeAuthorNameForUser: user ]. ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 >> scrapeAuthorNameForAllUsers [ |listOfUsers| @@ -371,7 +370,7 @@ GLHUserCatalogueV2 >> scrapeAuthorNameForAllUsers [ listOfUsers do: [ :user | self scrapeAuthorNameForUser: user ] ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GLHUserCatalogueV2 >> scrapeAuthorNameForUser: aGLHUser [ self addUser: aGLHUser withNames: (GLHUserCatalogue @@ -379,7 +378,7 @@ GLHUserCatalogueV2 >> scrapeAuthorNameForUser: aGLHUser [ contributedProjectsForCommitAuthorsRelatedToUser: aGLHUser). ] -{ #category : 'scrape' } +{ #category : #scrape } GLHUserCatalogueV2 >> scrapeAuthorNamesForUsers: aUserCollection [ aUserCollection do: [ :aGLHUser | @@ -387,19 +386,19 @@ GLHUserCatalogueV2 >> scrapeAuthorNamesForUsers: aUserCollection [ ]. ] -{ #category : 'search' } +{ #category : #search } GLHUserCatalogueV2 >> searchId: anId [ ^ self select: [ :entry | (entry at: #user) id = anId ]. ] -{ #category : 'completion' } +{ #category : #completion } GLHUserCatalogueV2 >> searchModelForAuthorNamesOfUser: aGLHUser [ self addUser: aGLHUser withNames: (aGLHUser commits collect: [ :c | c author_name ]) ] -{ #category : 'search' } +{ #category : #search } GLHUserCatalogueV2 >> searchName: aName [ ^ self select: [ :entry | @@ -409,24 +408,24 @@ GLHUserCatalogueV2 >> searchName: aName [ aName asLowercase ] ] -{ #category : 'search' } +{ #category : #search } GLHUserCatalogueV2 >> searchUserWithName: aName [ ^ (self searchName: aName) users ] -{ #category : 'accessing' } +{ #category : #accessing } GLHUserCatalogueV2 >> userAt: aGLHUser [ ^ (self at: aGLHUser name) at: #user. ] -{ #category : 'accessing' } +{ #category : #accessing } GLHUserCatalogueV2 >> users [ ^ self collect: [ :entry | entry at: #user ]. ] -{ #category : 'search' } +{ #category : #search } GLHUserCatalogueV2 >> weirdUsers [ "return user that have name containing weird caracter, making them suspicious" ^ self select: [ :entry | diff --git a/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st b/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st index 21aaebb..be075cb 100644 --- a/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st +++ b/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st @@ -1,6 +1,6 @@ Class { - #name : 'GitAnalyzer', - #superclass : 'Object', + #name : #GitAnalyzer, + #superclass : #Object, #instVars : [ 'glModel', 'fromCommit', @@ -8,11 +8,10 @@ Class { 'onProject', 'maxChildCommits' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'analyze' } +{ #category : #analyze } GitAnalyzer >> analyseChurn [ | commitFiles totalContribution childCommits access | @@ -40,7 +39,7 @@ GitAnalyzer >> analyseChurn [ yourself ] ] -{ #category : 'analyze' } +{ #category : #analyze } GitAnalyzer >> analyseCommentContribution [ | numberOfComments | @@ -58,7 +57,7 @@ GitAnalyzer >> analyseCommentContribution [ ^ numberOfComments ] -{ #category : 'commit' } +{ #category : #commit } GitAnalyzer >> analyseCommitContribution [ @@ -69,7 +68,7 @@ GitAnalyzer >> analyseCommitContribution [ (#deletion -> fromCommit deletions). } asDictionary ] -{ #category : 'analyze' } +{ #category : #analyze } GitAnalyzer >> analyseCommitFrequencyFromCommits: initialCommits [ | commits response | @@ -88,7 +87,7 @@ GitAnalyzer >> analyseCommitFrequencyFromCommits: initialCommits [ ^ commits ] -{ #category : 'analyze' } +{ #category : #analyze } GitAnalyzer >> analyseCommitFrequencySince: since until: until [ | commits response | @@ -112,7 +111,7 @@ GitAnalyzer >> analyseCommitFrequencySince: since until: until [ ^ commits ] -{ #category : 'analyze' } +{ #category : #analyze } GitAnalyzer >> analyseDelayUntilFirstChurn [ "return the first commit that modify the same lines of code as the fromCommit" @@ -133,7 +132,7 @@ GitAnalyzer >> analyseDelayUntilFirstChurn [ res] ] -{ #category : 'analyze' } +{ #category : #analyze } GitAnalyzer >> analyseMergeResquestValidation: aGLHPMergeRequest [ | creationDate mergedDate response | @@ -164,7 +163,7 @@ GitAnalyzer >> analyseMergeResquestValidation: aGLHPMergeRequest [ yourself ] ] -{ #category : 'filter' } +{ #category : #filter } GitAnalyzer >> arrangeCommitsByDate: commits [ | date2commits | @@ -183,7 +182,7 @@ GitAnalyzer >> arrangeCommitsByDate: commits [ ^ date2commits ] -{ #category : 'churn' } +{ #category : #churn } GitAnalyzer >> computeChurnOnFiles: aCollection [ | changesDic perFileChanges churns initialAuthor followingAuthors| @@ -242,7 +241,7 @@ GitAnalyzer >> computeChurnOnFiles: aCollection [ (#details -> perFileChanges) } asDictionary ] -{ #category : 'churn' } +{ #category : #churn } GitAnalyzer >> computeSpecificChurnOf: commit2Changes [ | changesDic | @@ -272,7 +271,7 @@ GitAnalyzer >> computeSpecificChurnOf: commit2Changes [ ^ self sortChangeDic: changesDic ] -{ #category : 'accessing' } +{ #category : #accessing } GitAnalyzer >> firstAmandmentFromChrun: aChurnAnalysis [ |details whereChangesOccurs firstCommitsPerFile| @@ -295,17 +294,17 @@ GitAnalyzer >> firstAmandmentFromChrun: aChurnAnalysis [ ] -{ #category : 'accessing' } +{ #category : #accessing } GitAnalyzer >> fromCommit: aCommit [ fromCommit := aCommit. ] -{ #category : 'accessing' } +{ #category : #accessing } GitAnalyzer >> glhImporter: anImporter [ glhImporter := anImporter . ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GitAnalyzer >> impactedFilesInFollowUpCommitsOf: aGLHCommit [ ^ self @@ -313,7 +312,7 @@ GitAnalyzer >> impactedFilesInFollowUpCommitsOf: aGLHCommit [ withMaxCommits: self maxChildCommits. ] -{ #category : 'churn' } +{ #category : #churn } GitAnalyzer >> impactedFilesInFollowUpCommitsOf: aGLHCommit withMaxCommits: max [ | commitFiles | @@ -329,7 +328,7 @@ GitAnalyzer >> impactedFilesInFollowUpCommitsOf: aGLHCommit withMaxCommits: max ^ commitFiles ] -{ #category : 'initialization' } +{ #category : #initialization } GitAnalyzer >> initialize [ glModel := GLHModel new. @@ -339,7 +338,7 @@ GitAnalyzer >> initialize [ maxChildCommits := -1 ] -{ #category : 'insertion' } +{ #category : #insertion } GitAnalyzer >> insertDiff: aGLPHEDiffRange into: fileChangesDic startingFrom: from [ |index| index := from. @@ -357,38 +356,38 @@ GitAnalyzer >> insertDiff: aGLPHEDiffRange into: fileChangesDic startingFrom: fr ] ] -{ #category : 'accessing' } +{ #category : #accessing } GitAnalyzer >> maxChildCommit: max [ maxChildCommits := max ] -{ #category : 'accessing' } +{ #category : #accessing } GitAnalyzer >> maxChildCommits [ ^ maxChildCommits ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GitAnalyzer >> onModel: agitHealthModel [ glModel := agitHealthModel ] -{ #category : 'accessing' } +{ #category : #accessing } GitAnalyzer >> onProject: aGLHProject [ onProject := aGLHProject ] -{ #category : 'sorting' } +{ #category : #sorting } GitAnalyzer >> sortChangeDic: aCollection [ ^ (aCollection associations sortAscending: [ :e | e key ] ) asOrderedDictionary ] -{ #category : 'visiting' } +{ #category : #visiting } GitAnalyzer >> visitChildCommits: commits lookingForFiles: commitFiles [ ^ self visitChildCommits: commits lookingForFiles: commitFiles upto: -1 ] -{ #category : 'visiting' } +{ #category : #visiting } GitAnalyzer >> visitChildCommits: commits lookingForFiles: commitFiles upto: nCommits [ commits ifEmpty: [ ^ commitFiles ]. @@ -412,7 +411,7 @@ GitAnalyzer >> visitChildCommits: commits lookingForFiles: commitFiles upto: nCo ^ commitFiles ] -{ #category : 'visiting' } +{ #category : #visiting } GitAnalyzer >> visitChildCommits: commits toStoreThemIn: commitsFound upto: nCommits [ commits ifEmpty: [ ^ commitsFound ]. diff --git a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st index 5a91996..4e76124 100644 --- a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st +++ b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st @@ -1,6 +1,6 @@ Class { - #name : 'GitMetricExporter', - #superclass : 'Object', + #name : #GitMetricExporter, + #superclass : #Object, #instVars : [ 'glhImporter', 'jiraImporter', @@ -15,11 +15,10 @@ Class { 'metrics', 'analyses' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : #'GitLabHealth-Model-Analysis' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } GitMetricExporter class >> demoPeriod [ ^ self new @@ -28,7 +27,7 @@ GitMetricExporter class >> demoPeriod [ addAPeriodFrom: '01 march 2024' to: '31 may 2024' ] -{ #category : 'adding' } +{ #category : #adding } GitMetricExporter >> addAPeriodFrom: since to: until [ runningPeriods add: { @@ -38,7 +37,7 @@ GitMetricExporter >> addAPeriodFrom: since to: until [ ^runningPeriods ] -{ #category : 'adding' } +{ #category : #adding } GitMetricExporter >> addEntitiesFromUserNames: userNames [ "import all the project since a certain time" @@ -86,7 +85,7 @@ GitMetricExporter >> addEntitiesFromUserNames: userNames [ ^ self ] -{ #category : 'adding' } +{ #category : #adding } GitMetricExporter >> addEntitiesFromUserNamesAndProjects: usersWithProjects [ self @@ -112,7 +111,7 @@ GitMetricExporter >> addEntitiesFromUserNamesAndProjects: usersWithProjects [ ^ self ] -{ #category : 'utilities' } +{ #category : #utilities } GitMetricExporter >> constructFilePath: runningOver [ | file | @@ -125,7 +124,7 @@ GitMetricExporter >> constructFilePath: runningOver [ ^ file ] -{ #category : 'exporting' } +{ #category : #exporting } GitMetricExporter >> csvMetricsFor: metricCollection at: date [ | csvMetrics | @@ -143,12 +142,12 @@ GitMetricExporter >> csvMetricsFor: metricCollection at: date [ ^ csvMetrics asOrderedDictionary ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> entities: aCollection [ entities := aCollection ] -{ #category : 'exporting' } +{ #category : #exporting } GitMetricExporter >> exportFor: usersWithProjects [ self @@ -164,7 +163,7 @@ GitMetricExporter >> exportFor: usersWithProjects [ Year } ] -{ #category : 'exporting' } +{ #category : #exporting } GitMetricExporter >> exportFor: usersWithProjects over: aCollectionOfDateWeekMonthOrYear [ self @@ -179,21 +178,21 @@ GitMetricExporter >> exportFor: usersWithProjects over: aCollectionOfDateWeekMon self exportFor: aCollectionOfDateWeekMonthOrYear ] -{ #category : 'exporting' } +{ #category : #exporting } GitMetricExporter >> exportInCSV [ self exportUserAnalysesInCSV. self exportProjectAnalysesInCSV. ] -{ #category : 'exporting' } +{ #category : #exporting } GitMetricExporter >> exportInDB: repository [ repository enableSingleton. analyses do: [ :analysis | analysis save ] ] -{ #category : 'exporting' } +{ #category : #exporting } GitMetricExporter >> exportInS3: bucketName accessKey: accessKey secretKey: secretKey region: region [ | s3 bucket ston date fileName | @@ -217,7 +216,7 @@ GitMetricExporter >> exportInS3: bucketName accessKey: accessKey secretKey: secr bucket atKey: fileName putObject: ston ] -{ #category : 'exporting' } +{ #category : #exporting } GitMetricExporter >> exportProjectAnalysesInCSV [ | exportBrowserModel groupedByOver group groupOver groupByName periods csvMetrics file | @@ -259,27 +258,32 @@ GitMetricExporter >> exportProjectAnalysesInCSV [ exportBrowserModel writeCSVOn: aStream ] ] ] -{ #category : 'exporting' } +{ #category : #exporting } GitMetricExporter >> exportUserAnalysesInCSV [ | exportBrowserModel groupedByOver group groupOver groupByName periods csvMetrics file | exportBrowserModel := MiExportModel new. groupedByOver := self userAnalyses groupedBy: #over. - + groupedByOver associations do: [ :groupAssociation | group := groupAssociation value. groupOver := groupAssociation key. - + groupByName := group groupedBy: #username. exportBrowserModel entitiesList: groupByName. exportBrowserModel removeColumnForQueryNamed: #Type. exportBrowserModel removeColumnForQueryNamed: #Name. - + exportBrowserModel addColumnForQuery: [ :groupAnalyses | (groupAnalyses at: 1) username ] withName: #'User name'. + exportBrowserModel + addColumnForQuery: [ :groupAnalyses | + (groupAnalyses at: 1) email ifNil: #public_email ] + withName: #'User email'. + periods := (group groupedBy: #period) keys. periods do: [ :period | csvMetrics := self @@ -289,15 +293,15 @@ GitMetricExporter >> exportUserAnalysesInCSV [ exportBrowserModel addColumnForQuery: association value withName: association key ] ]. - - + + file := self constructFilePath: groupOver. - + file writeStreamDo: [ :aStream | exportBrowserModel writeCSVOn: aStream ] ] ] -{ #category : 'projects' } +{ #category : #projects } GitMetricExporter >> findParticipationOfCommitAuthorNamed: username amongProjects: aCollectionOfProjects [ | response itsProjects i size | @@ -327,12 +331,12 @@ GitMetricExporter >> findParticipationOfCommitAuthorNamed: username amongProject ^ itsProjects ] -{ #category : 'projects' } +{ #category : #projects } GitMetricExporter >> findProjectsOfUser: aCollection [ self shouldBeImplemented. ] -{ #category : 'analysis' } +{ #category : #analysis } GitMetricExporter >> generateAnalysesOver: aDateWeekMonthOrYear [ analyses := OrderedCollection new. @@ -348,7 +352,7 @@ GitMetricExporter >> generateAnalysesOver: aDateWeekMonthOrYear [ ^ analyses ] -{ #category : 'analysis' } +{ #category : #analysis } GitMetricExporter >> generateProjectsAnalysesDuringPeriod: period over: aDateWeekMonthOrYear [ ^self projectEntities collect: [ :project | @@ -358,7 +362,7 @@ GitMetricExporter >> generateProjectsAnalysesDuringPeriod: period over: aDateWee over: aDateWeekMonthOrYear ] ] -{ #category : 'analysis' } +{ #category : #analysis } GitMetricExporter >> generateUsersAnalysesDuringPeriod: period over: aDateWeekMonthOrYear [ | userAnalysisReport newMetric result | @@ -385,7 +389,7 @@ GitMetricExporter >> generateUsersAnalysesDuringPeriod: period over: aDateWeekMo userAnalysisReport ] ] -{ #category : 'utilities' } +{ #category : #utilities } GitMetricExporter >> getAnalysisWithDate: date from: analysisCollection [ ^analysisCollection @@ -393,13 +397,13 @@ GitMetricExporter >> getAnalysisWithDate: date from: analysisCollection [ ifNone: [ nil ] ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> glhImporter: anImporter [ glhImporter := anImporter withInitialCommits: false; yourself. ] -{ #category : 'adding' } +{ #category : #adding } GitMetricExporter >> importAnalysesFromS3: bucketName accessKey: accessKey secretKey: secretKey region: region [ | s3 bucket xmlObjects contentElements filesContent | @@ -423,7 +427,7 @@ GitMetricExporter >> importAnalysesFromS3: bucketName accessKey: accessKey secre flattened ] -{ #category : 'initialization' } +{ #category : #initialization } GitMetricExporter >> initialize [ entities := OrderedCollection new. @@ -456,29 +460,29 @@ GitMetricExporter >> initialize [ CommitsNumberByJiraTicketsMetric } ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> jiraImporter: anObject [ jiraImporter := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> label: aString [ label := aString ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> maxCommitWindow: anInteger [ maxCommitWindow := anInteger abs ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> metrics: anObject [ metrics := anObject ] -{ #category : 'adding' } +{ #category : #adding } GitMetricExporter >> onlyImportProjectsOfGroup: groupId [ | group | @@ -486,25 +490,25 @@ GitMetricExporter >> onlyImportProjectsOfGroup: groupId [ projectCache := group toScope: GLHProject ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> projectAnalyses [ ^ analyses select: [ :analysis | analysis class = ProjectAnalysisReport ] ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> projectEntities [ ^ entities select: [ :entity | entity class = GLHProject ] ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> projectMetrics [ ^ metrics select: [ :metric | metric inheritsFrom: ProjectMetric ] ] -{ #category : 'setup' } +{ #category : #setup } GitMetricExporter >> setupAnalysisForProjectsWithIds: projectIds [ | projects | @@ -513,7 +517,7 @@ GitMetricExporter >> setupAnalysisForProjectsWithIds: projectIds [ entities addAll: projects ] -{ #category : 'setup' } +{ #category : #setup } GitMetricExporter >> setupAnalysisForUsersWithNames: userNames [ "import all the project since a certain time" @@ -536,25 +540,25 @@ GitMetricExporter >> setupAnalysisForUsersWithNames: userNames [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> userAnalyses [ ^ analyses select: [ :analysis | analysis class = UserAnalysisReport ] ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> userEntities [ ^ entities select: [ :entity | entity class = GLHUser ] ] -{ #category : 'accessing' } +{ #category : #accessing } GitMetricExporter >> userMetrics [ ^ metrics select: [ :metric | metric inheritsFrom: UserMetric ] ] -{ #category : 'setup' } +{ #category : #setup } GitMetricExporter >> withEmailDomain: anEmailDomain [ "define the email domain of your Git user. Usefull to link them between service (i.e. Jira)" diff --git a/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st b/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st index 68a1437..8e2b064 100644 --- a/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'JiraTimeMRTimeDifferenceMetric', - #superclass : 'UserJiraMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #JiraTimeMRTimeDifferenceMetric, + #superclass : #UserJiraMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } JiraTimeMRTimeDifferenceMetric >> calculate [ | groupedByDate dateOver | @@ -52,13 +51,13 @@ JiraTimeMRTimeDifferenceMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } JiraTimeMRTimeDifferenceMetric >> description [ ^ 'average difference in seconds between jira estimate time and associated merge request time (time between first commit and merge date)' ] -{ #category : 'loading' } +{ #category : #loading } JiraTimeMRTimeDifferenceMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st b/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st index 1cd32d1..8b49bc6 100644 --- a/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'MergeRequestDurationMetric', - #superclass : 'UserMergeRequestMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #MergeRequestDurationMetric, + #superclass : #UserMergeRequestMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } MergeRequestDurationMetric >> calculate [ | groupedByDate gitAnalyzer mergeRequestsValidation filterGroups | @@ -52,13 +51,13 @@ MergeRequestDurationMetric >> calculate [ ^ filterGroups average asSeconds ] -{ #category : 'accessing' } +{ #category : #accessing } MergeRequestDurationMetric >> description [ ^ 'average time to merge a merge request (in seconds)' ] -{ #category : 'accessing' } +{ #category : #accessing } MergeRequestDurationMetric >> name [ ^ 'mergeRequestDuration' diff --git a/src/GitLabHealth-Model-Analysis/MergedMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/MergedMergeRequestMetric.class.st index 208a604..39a6863 100644 --- a/src/GitLabHealth-Model-Analysis/MergedMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/MergedMergeRequestMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'MergedMergeRequestMetric', - #superclass : 'UserMergeRequestMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #MergedMergeRequestMetric, + #superclass : #UserMergeRequestMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } MergedMergeRequestMetric >> calculate [ | groupedByDate userMergedMergeRequests dateOver | @@ -29,13 +28,13 @@ MergedMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } MergedMergeRequestMetric >> description [ ^ 'number of merge request merged by this user' ] -{ #category : 'loading' } +{ #category : #loading } MergedMergeRequestMetric >> load [ userMergeRequests := self @@ -43,7 +42,7 @@ MergedMergeRequestMetric >> load [ until: (period at: #until) ] -{ #category : 'accessing' } +{ #category : #accessing } MergedMergeRequestMetric >> name [ ^ 'mergedMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/Metric.class.st b/src/GitLabHealth-Model-Analysis/Metric.class.st index 5643853..0019531 100644 --- a/src/GitLabHealth-Model-Analysis/Metric.class.st +++ b/src/GitLabHealth-Model-Analysis/Metric.class.st @@ -1,63 +1,62 @@ Class { - #name : 'Metric', - #superclass : 'Object', + #name : #Metric, + #superclass : #Object, #instVars : [ 'period', 'over', 'glhImporter', 'jiraImporter' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } Metric >> accronym [ ^ (self name first uppercase asString), (self name select: #isUppercase) ] -{ #category : 'calculating' } +{ #category : #calculating } Metric >> calculate [ ^self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } Metric >> description [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } Metric >> glhImporter: anObject [ glhImporter := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } Metric >> jiraImporter: anObject [ jiraImporter := anObject ] -{ #category : 'loading' } +{ #category : #loading } Metric >> load [ ^self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } Metric >> name [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } Metric >> over: anObject [ over := anObject ] -{ #category : 'initialization' } +{ #category : #initialization } Metric >> setPeriodSince: since until: until [ period := { @@ -65,7 +64,7 @@ Metric >> setPeriodSince: since until: until [ (#until -> until asDate) } asDictionary ] -{ #category : 'utils - date' } +{ #category : #'utils - date' } Metric >> setupGroupedDate [ | groupedByDate start end increment overSymbol | @@ -111,7 +110,7 @@ Metric >> setupGroupedDate [ ^ groupedByDate ] -{ #category : 'utils - date' } +{ #category : #'utils - date' } Metric >> transformDate: date to: aWeekOrMonthOrYear [ aWeekOrMonthOrYear = Month ifTrue: [ ^ date asDate month asDate ]. diff --git a/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st index 69e5f85..6e349b4 100644 --- a/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'OpenedMergeRequestMetric', - #superclass : 'UserMergeRequestMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #OpenedMergeRequestMetric, + #superclass : #UserMergeRequestMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } OpenedMergeRequestMetric >> calculate [ | groupedByDate dateOver | @@ -25,13 +24,13 @@ OpenedMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } OpenedMergeRequestMetric >> description [ ^'number of opened merge request' ] -{ #category : 'accessing' } +{ #category : #accessing } OpenedMergeRequestMetric >> name [ ^'openedMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st index 727c4e7..946d807 100644 --- a/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'PendingMergeRequestMetric', - #superclass : 'UserMergeRequestMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #PendingMergeRequestMetric, + #superclass : #UserMergeRequestMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } PendingMergeRequestMetric >> calculate [ | groupedByDate userMergedMergeRequests dateOver | @@ -27,13 +26,13 @@ PendingMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } PendingMergeRequestMetric >> description [ ^ 'number of merge request opened during a period and left opened at the end of it' ] -{ #category : 'accessing' } +{ #category : #accessing } PendingMergeRequestMetric >> name [ ^'pendingMergeRequest' ] diff --git a/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st b/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st index 5c107b1..a72b67c 100644 --- a/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st +++ b/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st @@ -1,20 +1,19 @@ Class { - #name : 'ProjectAnalysisReport', - #superclass : 'AnalysisReport', + #name : #ProjectAnalysisReport, + #superclass : #AnalysisReport, #instVars : [ 'projectName' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'accessing' } +{ #category : #accessing } ProjectAnalysisReport >> projectName [ ^ projectName ] -{ #category : 'accessing' } +{ #category : #accessing } ProjectAnalysisReport >> projectName: anObject [ projectName := anObject diff --git a/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st b/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st index 13e703c..c56ebef 100644 --- a/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st @@ -1,9 +1,8 @@ Class { - #name : 'ProjectMetric', - #superclass : 'Metric', + #name : #ProjectMetric, + #superclass : #Metric, #instVars : [ 'project' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } diff --git a/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st index 23eb761..0ca0e40 100644 --- a/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'ReviewedByUserMergeRequestMetric', - #superclass : 'UserMergeRequestMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #ReviewedByUserMergeRequestMetric, + #superclass : #UserMergeRequestMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } ReviewedByUserMergeRequestMetric >> calculate [ | groupedByDate mergedMergeRequest reviewedMergeRequests dateOver gitAnalyzer | @@ -37,13 +36,13 @@ ReviewedByUserMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } ReviewedByUserMergeRequestMetric >> description [ ^ 'number of merger request reviewed by the user' ] -{ #category : 'loading' } +{ #category : #loading } ReviewedByUserMergeRequestMetric >> load [ userMergeRequests := self @@ -51,7 +50,7 @@ ReviewedByUserMergeRequestMetric >> load [ until: (period at: #until) ] -{ #category : 'accessing' } +{ #category : #accessing } ReviewedByUserMergeRequestMetric >> name [ ^ 'reviewedMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st index 2ad8d7a..5c38042 100644 --- a/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'SelfMergedUnderAMinuteMergeRequestMetric', - #superclass : 'UserMergeRequestMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #SelfMergedUnderAMinuteMergeRequestMetric, + #superclass : #UserMergeRequestMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } SelfMergedUnderAMinuteMergeRequestMetric >> calculate [ | groupedByDate mergedMergeRequest noVerificationMergeRequests dateOver gitAnalyzer | @@ -44,13 +43,13 @@ SelfMergedUnderAMinuteMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } SelfMergedUnderAMinuteMergeRequestMetric >> description [ ^ 'number of merge requests merged by its author under a minute after creation' ] -{ #category : 'loading' } +{ #category : #loading } SelfMergedUnderAMinuteMergeRequestMetric >> load [ userMergeRequests := self @@ -59,7 +58,7 @@ SelfMergedUnderAMinuteMergeRequestMetric >> load [ until: (period at: #until) ] -{ #category : 'accessing' } +{ #category : #accessing } SelfMergedUnderAMinuteMergeRequestMetric >> name [ ^ 'SelfMergedUnderAMinuteMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/String.extension.st b/src/GitLabHealth-Model-Analysis/String.extension.st index fd0ba7d..d6be4df 100644 --- a/src/GitLabHealth-Model-Analysis/String.extension.st +++ b/src/GitLabHealth-Model-Analysis/String.extension.st @@ -1,12 +1,12 @@ -Extension { #name : 'String' } +Extension { #name : #String } -{ #category : '*GitLabHealth-Model-Analysis' } +{ #category : #'*GitLabHealth-Model-Analysis' } String >> absLevenshteinDistanceWith: aString [ ^ { self levenshteinDistanceWith: aString . aString levenshteinDistanceWith: self } max. ] -{ #category : '*GitLabHealth-Model-Analysis' } +{ #category : #'*GitLabHealth-Model-Analysis' } String >> levenshteinDistanceWith: aString [ | m n distances cost | diff --git a/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st b/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st index 31ea48b..8b39d2e 100644 --- a/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st @@ -1,11 +1,10 @@ Class { - #name : 'TimeBetweenCommitMetric', - #superclass : 'UserCommitsMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #TimeBetweenCommitMetric, + #superclass : #UserCommitsMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } TimeBetweenCommitMetric >> calculate [ | commitSortedByDate commits1 commits2 differences groupedByDate dateOver average | @@ -45,7 +44,7 @@ TimeBetweenCommitMetric >> calculate [ ^ average ] -{ #category : 'accessing' } +{ #category : #accessing } TimeBetweenCommitMetric >> description [ ^ 'average time between commits (in seconds)' diff --git a/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st b/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st index 8de5c1f..82b130e 100644 --- a/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st +++ b/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st @@ -1,20 +1,19 @@ Class { - #name : 'UserAnalysisReport', - #superclass : 'AnalysisReport', + #name : #UserAnalysisReport, + #superclass : #AnalysisReport, #instVars : [ 'username' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'accessing' } +{ #category : #accessing } UserAnalysisReport >> username [ ^ username ] -{ #category : 'accessing' } +{ #category : #accessing } UserAnalysisReport >> username: anObject [ username := anObject diff --git a/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st b/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st index 953ab4f..a4de30c 100644 --- a/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st @@ -1,23 +1,22 @@ Class { - #name : 'UserCommitsMetric', - #superclass : 'UserMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #UserCommitsMetric, + #superclass : #UserMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } UserCommitsMetric >> calculate [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } UserCommitsMetric >> description [ ^ self subclassResponsibility ] -{ #category : 'loading' } +{ #category : #loading } UserCommitsMetric >> load [ userCommits := self @@ -25,7 +24,7 @@ UserCommitsMetric >> load [ until: (period at: #until) ] -{ #category : 'accessing' } +{ #category : #accessing } UserCommitsMetric >> name [ ^ self class name asString diff --git a/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st b/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st index 2de1b38..e7b6c78 100644 --- a/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st @@ -1,23 +1,22 @@ Class { - #name : 'UserJiraMetric', - #superclass : 'UserMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #UserJiraMetric, + #superclass : #UserMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } UserJiraMetric >> calculate [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } UserJiraMetric >> description [ ^ self subclassResponsibility ] -{ #category : 'loading' } +{ #category : #loading } UserJiraMetric >> load [ userMergeRequests := self @@ -25,7 +24,7 @@ UserJiraMetric >> load [ until: (period at: #until) ] -{ #category : 'accessing' } +{ #category : #accessing } UserJiraMetric >> name [ ^ self class name asString diff --git a/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st index 2102b1d..76258fc 100644 --- a/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st @@ -1,23 +1,22 @@ Class { - #name : 'UserMergeRequestMetric', - #superclass : 'UserMetric', - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #name : #UserMergeRequestMetric, + #superclass : #UserMetric, + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'calculating' } +{ #category : #calculating } UserMergeRequestMetric >> calculate [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } UserMergeRequestMetric >> description [ ^ self subclassResponsibility ] -{ #category : 'loading' } +{ #category : #loading } UserMergeRequestMetric >> load [ userMergeRequests := self @@ -25,7 +24,7 @@ UserMergeRequestMetric >> load [ until: (period at: #until). ] -{ #category : 'accessing' } +{ #category : #accessing } UserMergeRequestMetric >> name [ ^ self class name asString diff --git a/src/GitLabHealth-Model-Analysis/UserMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMetric.class.st index ab9d024..5ed51cd 100644 --- a/src/GitLabHealth-Model-Analysis/UserMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMetric.class.st @@ -1,42 +1,41 @@ Class { - #name : 'UserMetric', - #superclass : 'Metric', + #name : #UserMetric, + #superclass : #Metric, #instVars : [ 'user', 'userCommits', 'userMergeRequests', 'emailDomain' ], - #category : 'GitLabHealth-Model-Analysis', - #package : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis' } -{ #category : 'utils' } +{ #category : #utils } UserMetric >> cacheSymbolFor: anEntityType since: since until: until [ ^ (anEntityType printString , ' since ' , since printString , ' to ' , until printString) asSymbol ] -{ #category : 'calculating' } +{ #category : #calculating } UserMetric >> calculate [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } UserMetric >> description [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } UserMetric >> emailDomain: anObject [ emailDomain := anObject ] -{ #category : 'churn' } +{ #category : #churn } UserMetric >> foundSuccessorOf: commits andCompleteImportForMax: commitLimit [ | analyzingCommits i size | @@ -58,18 +57,18 @@ UserMetric >> foundSuccessorOf: commits andCompleteImportForMax: commitLimit [ ^ analyzingCommits ] -{ #category : 'initialization' } +{ #category : #initialization } UserMetric >> initialize [ over := Date ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> load [ ^ self subclassResponsibility ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> loadCompleteMergeRequestsSince: since until: until [ | mergeRequests | @@ -83,7 +82,7 @@ UserMetric >> loadCompleteMergeRequestsSince: since until: until [ ^ mergeRequests ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> loadMergeRequestsSince: since until: until [ | cacheSymbol mergeRequests | @@ -111,7 +110,7 @@ UserMetric >> loadMergeRequestsSince: since until: until [ mergeRequest author = user ]" ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> loadMergeRequestsWithJiraIssueSince: since until: until [ | email mergeRequests | @@ -131,7 +130,7 @@ UserMetric >> loadMergeRequestsWithJiraIssueSince: since until: until [ mergeRequest jiraIssue isNotNil ] ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> loadUserCommitsSince: since until: until [ | cacheSymbol allCommits | @@ -162,7 +161,7 @@ UserMetric >> loadUserCommitsSince: since until: until [ ^ allCommits reject: [ :commit | commit commitCreator ~= user ] ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> loadUserCompleteCommitsSince: since until: until [ | commits | @@ -171,7 +170,7 @@ UserMetric >> loadUserCompleteCommitsSince: since until: until [ ^ commits ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> loadUserCompleteMergeRequestsSince: since until: until [ | mergeRequests | @@ -184,7 +183,7 @@ UserMetric >> loadUserCompleteMergeRequestsSince: since until: until [ ^ mergeRequests ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> loadUserCompleteMergeRequestsWithJiraIssueSince: since until: until [ | email mergeRequests | @@ -205,7 +204,7 @@ UserMetric >> loadUserCompleteMergeRequestsWithJiraIssueSince: since until: unti mergeRequest jiraIssue isNotNil ] ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> loadUserMergeRequestsSince: since until: until [ | mergeRequests | @@ -214,7 +213,7 @@ UserMetric >> loadUserMergeRequestsSince: since until: until [ ^ mergeRequests select: [ :mergeRequest | mergeRequest author = user ] ] -{ #category : 'loading' } +{ #category : #loading } UserMetric >> loadUserMergeRequestsWithJiraIssueSince: since until: until [ | email mergeRequests | @@ -233,19 +232,19 @@ UserMetric >> loadUserMergeRequestsWithJiraIssueSince: since until: until [ mergeRequest jiraIssue isNotNil ] ] -{ #category : 'accessing' } +{ #category : #accessing } UserMetric >> name [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } UserMetric >> user: anObject [ user := anObject ] -{ #category : 'email' } +{ #category : #email } UserMetric >> userEmail [ user public_email = '' ifFalse: [ ^ user public_email ]. diff --git a/src/GitLabHealth-Model-Analysis/package.st b/src/GitLabHealth-Model-Analysis/package.st index d311de9..b7288f0 100644 --- a/src/GitLabHealth-Model-Analysis/package.st +++ b/src/GitLabHealth-Model-Analysis/package.st @@ -1 +1 @@ -Package { #name : 'GitLabHealth-Model-Analysis' } +Package { #name : #'GitLabHealth-Model-Analysis' } From 6c0a6dc46b6f8d8a19b78d0c970614007dd067b9 Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Mon, 4 Nov 2024 16:45:33 +0100 Subject: [PATCH 3/4] add user email to export csv --- .../AnalysisReport.class.st | 19 +++-- .../ClosedMergeRequestMetric.class.st | 13 +-- .../ClosedTicketsMetric.class.st | 13 +-- .../CodeAdditionByMRMetric.class.st | 13 +-- .../CodeAdditionByTicketMetric.class.st | 13 +-- .../CodeAdditionMetric.class.st | 11 +-- .../CodeChurnMetric.class.st | 13 +-- .../CodeDeletionByMRMetric.class.st | 13 +-- .../CodeDeletionByTicketMetric.class.st | 13 +-- .../CodeDeletionMetric.class.st | 11 +-- .../CommentContributionMetric.class.st | 13 +-- .../CommitFrequencyMetric.class.st | 11 +-- .../CommitsNumberByJiraTicketsMetric.class.st | 13 +-- .../ContributedProjectMetric.class.st | 11 +-- .../DelayUntilFirstChurnMetric.class.st | 13 +-- .../GLHUserCatalogue.class.st | 51 +++++------ .../GLHUserCatalogueItem.class.st | 9 +- .../GLHUserCatalogueV2.class.st | 81 +++++++++--------- .../GitAnalyzer.class.st | 57 ++++++------- .../GitMetricExporter.class.st | 84 ++++++++++--------- .../JiraTimeMRTimeDifferenceMetric.class.st | 13 +-- .../MergeRequestDurationMetric.class.st | 13 +-- .../MergedMergeRequestMetric.class.st | 15 ++-- .../Metric.class.st | 31 +++---- .../OpenedMergeRequestMetric.class.st | 13 +-- .../PendingMergeRequestMetric.class.st | 13 +-- .../ProjectAnalysisReport.class.st | 11 +-- .../ProjectMetric.class.st | 7 +- .../ReviewedByUserMergeRequestMetric.class.st | 15 ++-- ...gedUnderAMinuteMergeRequestMetric.class.st | 15 ++-- .../String.extension.st | 6 +- .../TimeBetweenCommitMetric.class.st | 11 +-- .../UserAnalysisReport.class.st | 26 ++++-- .../UserCommitsMetric.class.st | 15 ++-- .../UserJiraMetric.class.st | 15 ++-- .../UserMergeRequestMetric.class.st | 15 ++-- .../UserMetric.class.st | 45 +++++----- src/GitLabHealth-Model-Analysis/package.st | 2 +- 38 files changed, 403 insertions(+), 353 deletions(-) diff --git a/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st b/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st index 2ec4938..c2f60b6 100644 --- a/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st +++ b/src/GitLabHealth-Model-Analysis/AnalysisReport.class.st @@ -1,45 +1,46 @@ Class { - #name : #AnalysisReport, - #superclass : #Object, + #name : 'AnalysisReport', + #superclass : 'Object', #instVars : [ 'period', 'over', 'metrics' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #initialization } +{ #category : 'initialization' } AnalysisReport >> initialize [ metrics := Dictionary new ] -{ #category : #accessing } +{ #category : 'accessing' } AnalysisReport >> metrics [ ^ metrics ] -{ #category : #accessing } +{ #category : 'accessing' } AnalysisReport >> over [ ^ over ] -{ #category : #accessing } +{ #category : 'accessing' } AnalysisReport >> over: anObject [ over := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } AnalysisReport >> period [ ^ period ] -{ #category : #accessing } +{ #category : 'accessing' } AnalysisReport >> period: anObject [ period := anObject diff --git a/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st index 86add80..95146a0 100644 --- a/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ClosedMergeRequestMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #ClosedMergeRequestMetric, - #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'ClosedMergeRequestMetric', + #superclass : 'UserMergeRequestMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } ClosedMergeRequestMetric >> calculate [ | groupedByDate dateOver | @@ -27,13 +28,13 @@ ClosedMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } ClosedMergeRequestMetric >> description [ ^ 'number of closed merge requests' ] -{ #category : #accessing } +{ #category : 'accessing' } ClosedMergeRequestMetric >> name [ ^ 'closedMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st b/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st index 885f814..cf4c0da 100644 --- a/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ClosedTicketsMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #ClosedTicketsMetric, - #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'ClosedTicketsMetric', + #superclass : 'UserJiraMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } ClosedTicketsMetric >> calculate [ | groupedByDate dateOver | @@ -23,13 +24,13 @@ ClosedTicketsMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } ClosedTicketsMetric >> description [ ^ 'number of closed merge request associated with a jira ticket' ] -{ #category : #accessing } +{ #category : 'accessing' } ClosedTicketsMetric >> name [ ^ 'closedTickets' diff --git a/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st index 3e0c4b3..4674adb 100644 --- a/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeAdditionByMRMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #CodeAdditionByMRMetric, - #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'CodeAdditionByMRMetric', + #superclass : 'UserMergeRequestMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CodeAdditionByMRMetric >> calculate [ | groupedByDate dateOver | @@ -29,13 +30,13 @@ CodeAdditionByMRMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } CodeAdditionByMRMetric >> description [ ^ 'average code addition by merge request' ] -{ #category : #loading } +{ #category : 'loading' } CodeAdditionByMRMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st index 210463e..813d829 100644 --- a/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeAdditionByTicketMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #CodeAdditionByTicketMetric, - #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'CodeAdditionByTicketMetric', + #superclass : 'UserJiraMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CodeAdditionByTicketMetric >> calculate [ | groupedByDate dateOver | @@ -29,13 +30,13 @@ CodeAdditionByTicketMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } CodeAdditionByTicketMetric >> description [ ^ 'average code addition by merge request associated with a jira ticket' ] -{ #category : #loading } +{ #category : 'loading' } CodeAdditionByTicketMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st index 064ab99..3ea58bd 100644 --- a/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeAdditionMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #CodeAdditionMetric, - #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'CodeAdditionMetric', + #superclass : 'UserCommitsMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CodeAdditionMetric >> calculate [ | gitAnalyzer contributions groupedByDate | @@ -36,7 +37,7 @@ CodeAdditionMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } CodeAdditionMetric >> description [ ^ 'code addition (avg)' diff --git a/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st index 46eaff6..62d81e4 100644 --- a/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeChurnMetric.class.st @@ -1,13 +1,14 @@ Class { - #name : #CodeChurnMetric, - #superclass : #UserCommitsMetric, + #name : 'CodeChurnMetric', + #superclass : 'UserCommitsMetric', #instVars : [ 'maxCommitWindow' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CodeChurnMetric >> calculate [ | commits res groupedByDate totalContributions gitAnalyzer | @@ -65,13 +66,13 @@ CodeChurnMetric >> calculate [ ^ (groupedByDate collect: [ :date | date at: #percentage ]) average ] -{ #category : #accessing } +{ #category : 'accessing' } CodeChurnMetric >> description [ ^ 'churn % (W=' , maxCommitWindow printString , ')' ] -{ #category : #initialization } +{ #category : 'initialization' } CodeChurnMetric >> initialize [ maxCommitWindow := 3 ] diff --git a/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st index abb278a..bd3c7ab 100644 --- a/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeDeletionByMRMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #CodeDeletionByMRMetric, - #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'CodeDeletionByMRMetric', + #superclass : 'UserMergeRequestMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CodeDeletionByMRMetric >> calculate [ | groupedByDate dateOver | @@ -29,13 +30,13 @@ CodeDeletionByMRMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } CodeDeletionByMRMetric >> description [ ^ 'average code deletion by merge request' ] -{ #category : #loading } +{ #category : 'loading' } CodeDeletionByMRMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st index 9cdf88b..b59d283 100644 --- a/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeDeletionByTicketMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #CodeDeletionByTicketMetric, - #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'CodeDeletionByTicketMetric', + #superclass : 'UserJiraMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CodeDeletionByTicketMetric >> calculate [ | groupedByDate dateOver | @@ -29,13 +30,13 @@ CodeDeletionByTicketMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } CodeDeletionByTicketMetric >> description [ ^ 'average code deletion by merge request associated with a jira ticket' ] -{ #category : #loading } +{ #category : 'loading' } CodeDeletionByTicketMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st b/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st index 0d08a68..8feb8e8 100644 --- a/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CodeDeletionMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #CodeDeletionMetric, - #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'CodeDeletionMetric', + #superclass : 'UserCommitsMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CodeDeletionMetric >> calculate [ | gitAnalyzer contributions groupedByDate | @@ -36,7 +37,7 @@ CodeDeletionMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } CodeDeletionMetric >> description [ ^'code deletion (avg)' diff --git a/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st b/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st index 149bf55..f04d16d 100644 --- a/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CommentContributionMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #CommentContributionMetric, - #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'CommentContributionMetric', + #superclass : 'UserCommitsMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CommentContributionMetric >> calculate [ | groupedByDate gitAnalyzer contributions | @@ -39,13 +40,13 @@ CommentContributionMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } CommentContributionMetric >> description [ ^ 'comment contribution (avg)' ] -{ #category : #loading } +{ #category : 'loading' } CommentContributionMetric >> load [ userCommits := self diff --git a/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st b/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st index 1994ead..f1e1855 100644 --- a/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CommitFrequencyMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #CommitFrequencyMetric, - #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'CommitFrequencyMetric', + #superclass : 'UserCommitsMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CommitFrequencyMetric >> calculate [ | groupedByDate | @@ -21,7 +22,7 @@ CommitFrequencyMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } CommitFrequencyMetric >> description [ ^'commits frequency (avg)' diff --git a/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st b/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st index 3307e5d..7988338 100644 --- a/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/CommitsNumberByJiraTicketsMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #CommitsNumberByJiraTicketsMetric, - #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'CommitsNumberByJiraTicketsMetric', + #superclass : 'UserJiraMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } CommitsNumberByJiraTicketsMetric >> calculate [ | groupedByDate dateOver | @@ -23,13 +24,13 @@ CommitsNumberByJiraTicketsMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } CommitsNumberByJiraTicketsMetric >> description [ ^ 'average number of commit by merge request associated to a jira ticket' ] -{ #category : #loading } +{ #category : 'loading' } CommitsNumberByJiraTicketsMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st b/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st index 8663cad..725367e 100644 --- a/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ContributedProjectMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #ContributedProjectMetric, - #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'ContributedProjectMetric', + #superclass : 'UserCommitsMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } ContributedProjectMetric >> calculate [ | groupedByDate dateOver projects | @@ -25,7 +26,7 @@ ContributedProjectMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } ContributedProjectMetric >> description [ ^ 'number of project with min 1 commit of user' diff --git a/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st b/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st index 29e14ac..a610633 100644 --- a/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/DelayUntilFirstChurnMetric.class.st @@ -1,13 +1,14 @@ Class { - #name : #DelayUntilFirstChurnMetric, - #superclass : #UserCommitsMetric, + #name : 'DelayUntilFirstChurnMetric', + #superclass : 'UserCommitsMetric', #instVars : [ 'maxCommitWindow' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } DelayUntilFirstChurnMetric >> calculate [ | commits groupedByDate res average | @@ -69,14 +70,14 @@ DelayUntilFirstChurnMetric >> calculate [ ^ average ] -{ #category : #accessing } +{ #category : 'accessing' } DelayUntilFirstChurnMetric >> description [ ^ 'delay Until First Churn (W=' , maxCommitWindow printString , ')' ] -{ #category : #initialization } +{ #category : 'initialization' } DelayUntilFirstChurnMetric >> initialize [ super initialize. maxCommitWindow := 3 diff --git a/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st b/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st index 9db688e..e4bdeda 100644 --- a/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st +++ b/src/GitLabHealth-Model-Analysis/GLHUserCatalogue.class.st @@ -1,14 +1,15 @@ Class { - #name : #GLHUserCatalogue, - #superclass : #Dictionary, + #name : 'GLHUserCatalogue', + #superclass : 'Dictionary', #instVars : [ 'users', 'anImporter' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #import } +{ #category : 'import' } GLHUserCatalogue class >> loadFromJson: aString [ | catalogue dic | @@ -32,7 +33,7 @@ GLHUserCatalogue class >> loadFromJson: aString [ ^ catalogue ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogue class >> scrapeContributedProjectsForCommitAuthorsRelatedToUser: aGLHUser [ "get all " @@ -63,7 +64,7 @@ GLHUserCatalogue class >> scrapeContributedProjectsForCommitAuthorsRelatedToUser ^ (aGLHUser commits collect: [ :commit | commit author_name ]) asSet ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogue class >> scrapeWithImporter: anImporter contributedProjectsForCommitAuthorsRelatedToUser: aGLHUser [ "get all " @@ -87,13 +88,13 @@ GLHUserCatalogue class >> scrapeWithImporter: anImporter contributedProjectsForC ^ (aGLHUser commits collect: [ :commit | commit author_name ]) asSet ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogue >> addUser: aGLHUser [ self at: aGLHUser ifAbsentPut: [ Set new add: (aGLHUser username); add: (aGLHUser name) ; yourself ]. ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogue >> addUser: aGLHUser withName: name [ self @@ -107,7 +108,7 @@ GLHUserCatalogue >> addUser: aGLHUser withName: name [ yourself ] ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogue >> addUser: aGLHUser withNames: aCollectionOfNames [ self @@ -121,20 +122,20 @@ GLHUserCatalogue >> addUser: aGLHUser withNames: aCollectionOfNames [ yourself ] ] -{ #category : #accessing } +{ #category : 'accessing' } GLHUserCatalogue >> anImporter: aGLHModelImporter [ anImporter := aGLHModelImporter ] -{ #category : #accessing } +{ #category : 'accessing' } GLHUserCatalogue >> atWithId: anId [ |res | res := self associations detect: [ :assoc | assoc key id = anId ] ifNone: [ nil ]. ^ res ifNotNil: [ res value ]. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogue >> collectUsernames [ | username2User | @@ -150,7 +151,7 @@ GLHUserCatalogue >> collectUsernames [ ^ username2User ] -{ #category : #completion } +{ #category : 'completion' } GLHUserCatalogue >> completeAuthorNameOfUser: aGLHUser with: authorName [ self @@ -162,7 +163,7 @@ GLHUserCatalogue >> completeAuthorNameOfUser: aGLHUser with: authorName [ self addUser: aGLHUser withName: authorName ] -{ #category : #completion } +{ #category : 'completion' } GLHUserCatalogue >> completeAuthorNameOfUser: aGLHUser withAll: authorNames [ self @@ -175,7 +176,7 @@ GLHUserCatalogue >> completeAuthorNameOfUser: aGLHUser withAll: authorNames [ self addUser: aGLHUser withNames: authorNames ] -{ #category : #export } +{ #category : 'export' } GLHUserCatalogue >> exportToJson [ | tempDic | @@ -196,13 +197,13 @@ GLHUserCatalogue >> exportToJson [ ^ STONJSON toString: tempDic ] -{ #category : #initialization } +{ #category : 'initialization' } GLHUserCatalogue >> initialize [ anImporter := GLHModelImporter importers anyOne. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogue >> namesAt: aGLHUser [ | assoc | @@ -210,7 +211,7 @@ GLHUserCatalogue >> namesAt: aGLHUser [ ^ assoc value ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogue >> reImportAllUsers [ "use it after a catalogue import from JSON" @@ -223,7 +224,7 @@ GLHUserCatalogue >> reImportAllUsers [ assoc key: user ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogue >> scrapeAuthorNameForAllUsers [ | currentUsers | @@ -233,7 +234,7 @@ GLHUserCatalogue >> scrapeAuthorNameForAllUsers [ scrapeWithImporter: anImporter contributedProjectsForCommitAuthorsRelatedToUser: key) ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogue >> scrapeAuthorNameForUser: aGLHUser [ | assoc | @@ -243,7 +244,7 @@ GLHUserCatalogue >> scrapeAuthorNameForUser: aGLHUser [ contributedProjectsForCommitAuthorsRelatedToUser: aGLHUser) ] -{ #category : #scrape } +{ #category : 'scrape' } GLHUserCatalogue >> scrapeAuthorNamesForUsers: aUserCollection [ aUserCollection do: [ :aGLHUser | @@ -251,7 +252,7 @@ GLHUserCatalogue >> scrapeAuthorNamesForUsers: aUserCollection [ ]. ] -{ #category : #completion } +{ #category : 'completion' } GLHUserCatalogue >> searchModelForAuthorNamesOfUser: aGLHUser [ |assoc| assoc := self associationAt: aGLHUser. @@ -259,19 +260,19 @@ GLHUserCatalogue >> searchModelForAuthorNamesOfUser: aGLHUser [ ] -{ #category : #search } +{ #category : 'search' } GLHUserCatalogue >> searchName: aName [ ^ self select: [ :collectionOfName | (' ' join: collectionOfName) asLowercase includesSubstring: aName asLowercase ] ] -{ #category : #search } +{ #category : 'search' } GLHUserCatalogue >> searchUserWithName: aName [ ^ (self searchName: aName) keys. ] -{ #category : #accessing } +{ #category : 'accessing' } GLHUserCatalogue >> users [ ^ self keys ] diff --git a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st index 5489928..7d6db7f 100644 --- a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st +++ b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueItem.class.st @@ -1,14 +1,15 @@ Class { - #name : #GLHUserCatalogueItem, - #superclass : #Dictionary, + #name : 'GLHUserCatalogueItem', + #superclass : 'Dictionary', #instVars : [ 'user', 'names' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #initialization } +{ #category : 'initialization' } GLHUserCatalogueItem >> initialize [ names := Set new. diff --git a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st index 856c61d..39a7c65 100644 --- a/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st +++ b/src/GitLabHealth-Model-Analysis/GLHUserCatalogueV2.class.st @@ -1,10 +1,11 @@ Class { - #name : #GLHUserCatalogueV2, - #superclass : #GLHUserCatalogue, - #category : 'GitLabHealth-Model-Analysis' + #name : 'GLHUserCatalogueV2', + #superclass : 'GLHUserCatalogue', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #import } +{ #category : 'import' } GLHUserCatalogueV2 class >> loadFromJson: aString [ | catalogue dic | @@ -30,7 +31,7 @@ GLHUserCatalogueV2 class >> loadFromJson: aString [ ^ catalogue ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 class >> scrapeContributedProjectsForCommitAuthorsRelatedToUser: aGLHUser [ "get all " @@ -61,7 +62,7 @@ GLHUserCatalogueV2 class >> scrapeContributedProjectsForCommitAuthorsRelatedToUs ^ (aGLHUser commits collect: [ :commit | commit author_name ]) asSet ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 class >> scrapeWithImporter: anImporter contributedProjectsForCommitAuthorsRelatedToUser: aGLHUser [ "get all " @@ -85,7 +86,7 @@ GLHUserCatalogueV2 class >> scrapeWithImporter: anImporter contributedProjectsFo ^ (aGLHUser commits collect: [ :commit | commit author_name ]) asSet ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 >> RSHeatMapLevenshtein [ | builder| @@ -100,7 +101,7 @@ GLHUserCatalogueV2 >> RSHeatMapLevenshtein [ builder canvas open ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 >> RSHeatMapLevenshteinTrimedAt: aBlockCondition [ | builder matrice| @@ -125,21 +126,21 @@ GLHUserCatalogueV2 >> RSHeatMapLevenshteinTrimedAt: aBlockCondition [ builder canvas open ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogueV2 >> addUser: aGLHUser [ ^ self at: aGLHUser name ifAbsentPut: [ self initACatalogueEntryForUser: aGLHUser ] ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogueV2 >> addUser: aGLHUser withName: name [ ^ self addUser: aGLHUser withNames: { name } ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames [ | entry | entry := (self @@ -149,13 +150,13 @@ GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames [ ^ entry ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames withProject: aProjectID [ ^ self addUser: aGLHUser withNames: aCollectionOfNames withProjects: { aProjectID } ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames withProjects: aCollectionOfProjectIDs [ |entry| @@ -165,14 +166,14 @@ GLHUserCatalogueV2 >> addUser: aGLHUser withNames: aCollectionOfNames withProjec ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogueV2 >> addUser: aGLHUser withProject: aProjectID [ ^ self addUser: aGLHUser withProjects: {aProjectID}. ] -{ #category : #adding } +{ #category : 'adding' } GLHUserCatalogueV2 >> addUser: aGLHUser withProjects: aCollectionOfProjectIDs [ |entry| @@ -182,19 +183,19 @@ GLHUserCatalogueV2 >> addUser: aGLHUser withProjects: aCollectionOfProjectIDs [ ] -{ #category : #accessing } +{ #category : 'accessing' } GLHUserCatalogueV2 >> anImporter: aGLHModelImporter [ anImporter := aGLHModelImporter ] -{ #category : #accessing } +{ #category : 'accessing' } GLHUserCatalogueV2 >> atId: anId [ ^ self detect: [ :entry | (entry at: #user) id = anId ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 >> collectUsernames [ | username2User | @@ -211,7 +212,7 @@ GLHUserCatalogueV2 >> collectUsernames [ ^ username2User ] -{ #category : #completion } +{ #category : 'completion' } GLHUserCatalogueV2 >> completeAuthorNameOfUser: aGLHUser with: authorName [ self @@ -223,7 +224,7 @@ GLHUserCatalogueV2 >> completeAuthorNameOfUser: aGLHUser with: authorName [ self addUser: aGLHUser withName: authorName ] -{ #category : #completion } +{ #category : 'completion' } GLHUserCatalogueV2 >> completeAuthorNameOfUser: aGLHUser withAll: authorNames [ self @@ -236,7 +237,7 @@ GLHUserCatalogueV2 >> completeAuthorNameOfUser: aGLHUser withAll: authorNames [ self addUser: aGLHUser withNames: authorNames ] -{ #category : #export } +{ #category : 'export' } GLHUserCatalogueV2 >> exportToJson [ | tempDic | @@ -263,7 +264,7 @@ GLHUserCatalogueV2 >> exportToJson [ ^ STONJSON toStringPretty: tempDic ] -{ #category : #fuse } +{ #category : 'fuse' } GLHUserCatalogueV2 >> fuse: mainUser with: subUser [ self at: mainUser ifPresent: [ :entry | self at: subUser ifAbsent: [ ^ self ]. @@ -273,7 +274,7 @@ GLHUserCatalogueV2 >> fuse: mainUser with: subUser [ ]. ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } GLHUserCatalogueV2 >> initACatalogueEntryForUser: aGLHUser [. ^ Dictionary new @@ -288,13 +289,13 @@ GLHUserCatalogueV2 >> initACatalogueEntryForUser: aGLHUser [. yourself ] -{ #category : #initialization } +{ #category : 'initialization' } GLHUserCatalogueV2 >> initialize [ anImporter := GLHModelImporter new. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 >> levenshteinMatrix [ | matrix| @@ -311,17 +312,17 @@ GLHUserCatalogueV2 >> levenshteinMatrix [ ^ matrix. ] -{ #category : #'accessing - name' } +{ #category : 'accessing - name' } GLHUserCatalogueV2 >> names [ ^ self collect: [ :entry | entry at: #names ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 >> namesAt: aGLHUser [ ^ (self at: aGLHUser name) at: #names. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 >> reImportAllUsers [ "use it after a catalogue import from JSON" @@ -337,7 +338,7 @@ GLHUserCatalogueV2 >> reImportAllUsers [ assoc value at: #user put: user ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 >> reImportUser: aGLHUser [ "use it after a catalogue import from JSON" |user| @@ -353,7 +354,7 @@ GLHUserCatalogueV2 >> reImportUser: aGLHUser [ ] -{ #category : #scrape } +{ #category : 'scrape' } GLHUserCatalogueV2 >> scrapeAuthorNameForAllRealUsers [ |listOfUsers| @@ -361,7 +362,7 @@ GLHUserCatalogueV2 >> scrapeAuthorNameForAllRealUsers [ listOfUsers do: [ :user | self scrapeAuthorNameForUser: user ]. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 >> scrapeAuthorNameForAllUsers [ |listOfUsers| @@ -370,7 +371,7 @@ GLHUserCatalogueV2 >> scrapeAuthorNameForAllUsers [ listOfUsers do: [ :user | self scrapeAuthorNameForUser: user ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GLHUserCatalogueV2 >> scrapeAuthorNameForUser: aGLHUser [ self addUser: aGLHUser withNames: (GLHUserCatalogue @@ -378,7 +379,7 @@ GLHUserCatalogueV2 >> scrapeAuthorNameForUser: aGLHUser [ contributedProjectsForCommitAuthorsRelatedToUser: aGLHUser). ] -{ #category : #scrape } +{ #category : 'scrape' } GLHUserCatalogueV2 >> scrapeAuthorNamesForUsers: aUserCollection [ aUserCollection do: [ :aGLHUser | @@ -386,19 +387,19 @@ GLHUserCatalogueV2 >> scrapeAuthorNamesForUsers: aUserCollection [ ]. ] -{ #category : #search } +{ #category : 'search' } GLHUserCatalogueV2 >> searchId: anId [ ^ self select: [ :entry | (entry at: #user) id = anId ]. ] -{ #category : #completion } +{ #category : 'completion' } GLHUserCatalogueV2 >> searchModelForAuthorNamesOfUser: aGLHUser [ self addUser: aGLHUser withNames: (aGLHUser commits collect: [ :c | c author_name ]) ] -{ #category : #search } +{ #category : 'search' } GLHUserCatalogueV2 >> searchName: aName [ ^ self select: [ :entry | @@ -408,24 +409,24 @@ GLHUserCatalogueV2 >> searchName: aName [ aName asLowercase ] ] -{ #category : #search } +{ #category : 'search' } GLHUserCatalogueV2 >> searchUserWithName: aName [ ^ (self searchName: aName) users ] -{ #category : #accessing } +{ #category : 'accessing' } GLHUserCatalogueV2 >> userAt: aGLHUser [ ^ (self at: aGLHUser name) at: #user. ] -{ #category : #accessing } +{ #category : 'accessing' } GLHUserCatalogueV2 >> users [ ^ self collect: [ :entry | entry at: #user ]. ] -{ #category : #search } +{ #category : 'search' } GLHUserCatalogueV2 >> weirdUsers [ "return user that have name containing weird caracter, making them suspicious" ^ self select: [ :entry | diff --git a/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st b/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st index be075cb..21aaebb 100644 --- a/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st +++ b/src/GitLabHealth-Model-Analysis/GitAnalyzer.class.st @@ -1,6 +1,6 @@ Class { - #name : #GitAnalyzer, - #superclass : #Object, + #name : 'GitAnalyzer', + #superclass : 'Object', #instVars : [ 'glModel', 'fromCommit', @@ -8,10 +8,11 @@ Class { 'onProject', 'maxChildCommits' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #analyze } +{ #category : 'analyze' } GitAnalyzer >> analyseChurn [ | commitFiles totalContribution childCommits access | @@ -39,7 +40,7 @@ GitAnalyzer >> analyseChurn [ yourself ] ] -{ #category : #analyze } +{ #category : 'analyze' } GitAnalyzer >> analyseCommentContribution [ | numberOfComments | @@ -57,7 +58,7 @@ GitAnalyzer >> analyseCommentContribution [ ^ numberOfComments ] -{ #category : #commit } +{ #category : 'commit' } GitAnalyzer >> analyseCommitContribution [ @@ -68,7 +69,7 @@ GitAnalyzer >> analyseCommitContribution [ (#deletion -> fromCommit deletions). } asDictionary ] -{ #category : #analyze } +{ #category : 'analyze' } GitAnalyzer >> analyseCommitFrequencyFromCommits: initialCommits [ | commits response | @@ -87,7 +88,7 @@ GitAnalyzer >> analyseCommitFrequencyFromCommits: initialCommits [ ^ commits ] -{ #category : #analyze } +{ #category : 'analyze' } GitAnalyzer >> analyseCommitFrequencySince: since until: until [ | commits response | @@ -111,7 +112,7 @@ GitAnalyzer >> analyseCommitFrequencySince: since until: until [ ^ commits ] -{ #category : #analyze } +{ #category : 'analyze' } GitAnalyzer >> analyseDelayUntilFirstChurn [ "return the first commit that modify the same lines of code as the fromCommit" @@ -132,7 +133,7 @@ GitAnalyzer >> analyseDelayUntilFirstChurn [ res] ] -{ #category : #analyze } +{ #category : 'analyze' } GitAnalyzer >> analyseMergeResquestValidation: aGLHPMergeRequest [ | creationDate mergedDate response | @@ -163,7 +164,7 @@ GitAnalyzer >> analyseMergeResquestValidation: aGLHPMergeRequest [ yourself ] ] -{ #category : #filter } +{ #category : 'filter' } GitAnalyzer >> arrangeCommitsByDate: commits [ | date2commits | @@ -182,7 +183,7 @@ GitAnalyzer >> arrangeCommitsByDate: commits [ ^ date2commits ] -{ #category : #churn } +{ #category : 'churn' } GitAnalyzer >> computeChurnOnFiles: aCollection [ | changesDic perFileChanges churns initialAuthor followingAuthors| @@ -241,7 +242,7 @@ GitAnalyzer >> computeChurnOnFiles: aCollection [ (#details -> perFileChanges) } asDictionary ] -{ #category : #churn } +{ #category : 'churn' } GitAnalyzer >> computeSpecificChurnOf: commit2Changes [ | changesDic | @@ -271,7 +272,7 @@ GitAnalyzer >> computeSpecificChurnOf: commit2Changes [ ^ self sortChangeDic: changesDic ] -{ #category : #accessing } +{ #category : 'accessing' } GitAnalyzer >> firstAmandmentFromChrun: aChurnAnalysis [ |details whereChangesOccurs firstCommitsPerFile| @@ -294,17 +295,17 @@ GitAnalyzer >> firstAmandmentFromChrun: aChurnAnalysis [ ] -{ #category : #accessing } +{ #category : 'accessing' } GitAnalyzer >> fromCommit: aCommit [ fromCommit := aCommit. ] -{ #category : #accessing } +{ #category : 'accessing' } GitAnalyzer >> glhImporter: anImporter [ glhImporter := anImporter . ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GitAnalyzer >> impactedFilesInFollowUpCommitsOf: aGLHCommit [ ^ self @@ -312,7 +313,7 @@ GitAnalyzer >> impactedFilesInFollowUpCommitsOf: aGLHCommit [ withMaxCommits: self maxChildCommits. ] -{ #category : #churn } +{ #category : 'churn' } GitAnalyzer >> impactedFilesInFollowUpCommitsOf: aGLHCommit withMaxCommits: max [ | commitFiles | @@ -328,7 +329,7 @@ GitAnalyzer >> impactedFilesInFollowUpCommitsOf: aGLHCommit withMaxCommits: max ^ commitFiles ] -{ #category : #initialization } +{ #category : 'initialization' } GitAnalyzer >> initialize [ glModel := GLHModel new. @@ -338,7 +339,7 @@ GitAnalyzer >> initialize [ maxChildCommits := -1 ] -{ #category : #insertion } +{ #category : 'insertion' } GitAnalyzer >> insertDiff: aGLPHEDiffRange into: fileChangesDic startingFrom: from [ |index| index := from. @@ -356,38 +357,38 @@ GitAnalyzer >> insertDiff: aGLPHEDiffRange into: fileChangesDic startingFrom: fr ] ] -{ #category : #accessing } +{ #category : 'accessing' } GitAnalyzer >> maxChildCommit: max [ maxChildCommits := max ] -{ #category : #accessing } +{ #category : 'accessing' } GitAnalyzer >> maxChildCommits [ ^ maxChildCommits ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GitAnalyzer >> onModel: agitHealthModel [ glModel := agitHealthModel ] -{ #category : #accessing } +{ #category : 'accessing' } GitAnalyzer >> onProject: aGLHProject [ onProject := aGLHProject ] -{ #category : #sorting } +{ #category : 'sorting' } GitAnalyzer >> sortChangeDic: aCollection [ ^ (aCollection associations sortAscending: [ :e | e key ] ) asOrderedDictionary ] -{ #category : #visiting } +{ #category : 'visiting' } GitAnalyzer >> visitChildCommits: commits lookingForFiles: commitFiles [ ^ self visitChildCommits: commits lookingForFiles: commitFiles upto: -1 ] -{ #category : #visiting } +{ #category : 'visiting' } GitAnalyzer >> visitChildCommits: commits lookingForFiles: commitFiles upto: nCommits [ commits ifEmpty: [ ^ commitFiles ]. @@ -411,7 +412,7 @@ GitAnalyzer >> visitChildCommits: commits lookingForFiles: commitFiles upto: nCo ^ commitFiles ] -{ #category : #visiting } +{ #category : 'visiting' } GitAnalyzer >> visitChildCommits: commits toStoreThemIn: commitsFound upto: nCommits [ commits ifEmpty: [ ^ commitsFound ]. diff --git a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st index 4e76124..c0381cb 100644 --- a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st +++ b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st @@ -1,6 +1,6 @@ Class { - #name : #GitMetricExporter, - #superclass : #Object, + #name : 'GitMetricExporter', + #superclass : 'Object', #instVars : [ 'glhImporter', 'jiraImporter', @@ -15,10 +15,11 @@ Class { 'metrics', 'analyses' ], - #category : #'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } GitMetricExporter class >> demoPeriod [ ^ self new @@ -27,7 +28,7 @@ GitMetricExporter class >> demoPeriod [ addAPeriodFrom: '01 march 2024' to: '31 may 2024' ] -{ #category : #adding } +{ #category : 'adding' } GitMetricExporter >> addAPeriodFrom: since to: until [ runningPeriods add: { @@ -37,7 +38,7 @@ GitMetricExporter >> addAPeriodFrom: since to: until [ ^runningPeriods ] -{ #category : #adding } +{ #category : 'adding' } GitMetricExporter >> addEntitiesFromUserNames: userNames [ "import all the project since a certain time" @@ -85,7 +86,7 @@ GitMetricExporter >> addEntitiesFromUserNames: userNames [ ^ self ] -{ #category : #adding } +{ #category : 'adding' } GitMetricExporter >> addEntitiesFromUserNamesAndProjects: usersWithProjects [ self @@ -111,7 +112,7 @@ GitMetricExporter >> addEntitiesFromUserNamesAndProjects: usersWithProjects [ ^ self ] -{ #category : #utilities } +{ #category : 'utilities' } GitMetricExporter >> constructFilePath: runningOver [ | file | @@ -124,7 +125,7 @@ GitMetricExporter >> constructFilePath: runningOver [ ^ file ] -{ #category : #exporting } +{ #category : 'exporting' } GitMetricExporter >> csvMetricsFor: metricCollection at: date [ | csvMetrics | @@ -142,12 +143,12 @@ GitMetricExporter >> csvMetricsFor: metricCollection at: date [ ^ csvMetrics asOrderedDictionary ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> entities: aCollection [ entities := aCollection ] -{ #category : #exporting } +{ #category : 'exporting' } GitMetricExporter >> exportFor: usersWithProjects [ self @@ -163,7 +164,7 @@ GitMetricExporter >> exportFor: usersWithProjects [ Year } ] -{ #category : #exporting } +{ #category : 'exporting' } GitMetricExporter >> exportFor: usersWithProjects over: aCollectionOfDateWeekMonthOrYear [ self @@ -178,21 +179,21 @@ GitMetricExporter >> exportFor: usersWithProjects over: aCollectionOfDateWeekMon self exportFor: aCollectionOfDateWeekMonthOrYear ] -{ #category : #exporting } +{ #category : 'exporting' } GitMetricExporter >> exportInCSV [ self exportUserAnalysesInCSV. self exportProjectAnalysesInCSV. ] -{ #category : #exporting } +{ #category : 'exporting' } GitMetricExporter >> exportInDB: repository [ repository enableSingleton. analyses do: [ :analysis | analysis save ] ] -{ #category : #exporting } +{ #category : 'exporting' } GitMetricExporter >> exportInS3: bucketName accessKey: accessKey secretKey: secretKey region: region [ | s3 bucket ston date fileName | @@ -216,7 +217,7 @@ GitMetricExporter >> exportInS3: bucketName accessKey: accessKey secretKey: secr bucket atKey: fileName putObject: ston ] -{ #category : #exporting } +{ #category : 'exporting' } GitMetricExporter >> exportProjectAnalysesInCSV [ | exportBrowserModel groupedByOver group groupOver groupByName periods csvMetrics file | @@ -258,7 +259,7 @@ GitMetricExporter >> exportProjectAnalysesInCSV [ exportBrowserModel writeCSVOn: aStream ] ] ] -{ #category : #exporting } +{ #category : 'exporting' } GitMetricExporter >> exportUserAnalysesInCSV [ | exportBrowserModel groupedByOver group groupOver groupByName periods csvMetrics file | @@ -281,7 +282,7 @@ GitMetricExporter >> exportUserAnalysesInCSV [ exportBrowserModel addColumnForQuery: [ :groupAnalyses | - (groupAnalyses at: 1) email ifNil: #public_email ] + (groupAnalyses at: 1) email ] withName: #'User email'. periods := (group groupedBy: #period) keys. @@ -301,7 +302,7 @@ GitMetricExporter >> exportUserAnalysesInCSV [ exportBrowserModel writeCSVOn: aStream ] ] ] -{ #category : #projects } +{ #category : 'projects' } GitMetricExporter >> findParticipationOfCommitAuthorNamed: username amongProjects: aCollectionOfProjects [ | response itsProjects i size | @@ -331,12 +332,12 @@ GitMetricExporter >> findParticipationOfCommitAuthorNamed: username amongProject ^ itsProjects ] -{ #category : #projects } +{ #category : 'projects' } GitMetricExporter >> findProjectsOfUser: aCollection [ self shouldBeImplemented. ] -{ #category : #analysis } +{ #category : 'analysis' } GitMetricExporter >> generateAnalysesOver: aDateWeekMonthOrYear [ analyses := OrderedCollection new. @@ -352,7 +353,7 @@ GitMetricExporter >> generateAnalysesOver: aDateWeekMonthOrYear [ ^ analyses ] -{ #category : #analysis } +{ #category : 'analysis' } GitMetricExporter >> generateProjectsAnalysesDuringPeriod: period over: aDateWeekMonthOrYear [ ^self projectEntities collect: [ :project | @@ -362,13 +363,14 @@ GitMetricExporter >> generateProjectsAnalysesDuringPeriod: period over: aDateWee over: aDateWeekMonthOrYear ] ] -{ #category : #analysis } +{ #category : 'analysis' } GitMetricExporter >> generateUsersAnalysesDuringPeriod: period over: aDateWeekMonthOrYear [ | userAnalysisReport newMetric result | ^ self userEntities collect: [ :user | userAnalysisReport := UserAnalysisReport new username: user name; + email: (user email ifNil: #public_email); period: period; over: aDateWeekMonthOrYear. @@ -389,7 +391,7 @@ GitMetricExporter >> generateUsersAnalysesDuringPeriod: period over: aDateWeekMo userAnalysisReport ] ] -{ #category : #utilities } +{ #category : 'utilities' } GitMetricExporter >> getAnalysisWithDate: date from: analysisCollection [ ^analysisCollection @@ -397,13 +399,13 @@ GitMetricExporter >> getAnalysisWithDate: date from: analysisCollection [ ifNone: [ nil ] ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> glhImporter: anImporter [ glhImporter := anImporter withInitialCommits: false; yourself. ] -{ #category : #adding } +{ #category : 'adding' } GitMetricExporter >> importAnalysesFromS3: bucketName accessKey: accessKey secretKey: secretKey region: region [ | s3 bucket xmlObjects contentElements filesContent | @@ -427,7 +429,7 @@ GitMetricExporter >> importAnalysesFromS3: bucketName accessKey: accessKey secre flattened ] -{ #category : #initialization } +{ #category : 'initialization' } GitMetricExporter >> initialize [ entities := OrderedCollection new. @@ -460,29 +462,29 @@ GitMetricExporter >> initialize [ CommitsNumberByJiraTicketsMetric } ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> jiraImporter: anObject [ jiraImporter := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> label: aString [ label := aString ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> maxCommitWindow: anInteger [ maxCommitWindow := anInteger abs ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> metrics: anObject [ metrics := anObject ] -{ #category : #adding } +{ #category : 'adding' } GitMetricExporter >> onlyImportProjectsOfGroup: groupId [ | group | @@ -490,25 +492,25 @@ GitMetricExporter >> onlyImportProjectsOfGroup: groupId [ projectCache := group toScope: GLHProject ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> projectAnalyses [ ^ analyses select: [ :analysis | analysis class = ProjectAnalysisReport ] ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> projectEntities [ ^ entities select: [ :entity | entity class = GLHProject ] ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> projectMetrics [ ^ metrics select: [ :metric | metric inheritsFrom: ProjectMetric ] ] -{ #category : #setup } +{ #category : 'setup' } GitMetricExporter >> setupAnalysisForProjectsWithIds: projectIds [ | projects | @@ -517,7 +519,7 @@ GitMetricExporter >> setupAnalysisForProjectsWithIds: projectIds [ entities addAll: projects ] -{ #category : #setup } +{ #category : 'setup' } GitMetricExporter >> setupAnalysisForUsersWithNames: userNames [ "import all the project since a certain time" @@ -540,25 +542,25 @@ GitMetricExporter >> setupAnalysisForUsersWithNames: userNames [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> userAnalyses [ ^ analyses select: [ :analysis | analysis class = UserAnalysisReport ] ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> userEntities [ ^ entities select: [ :entity | entity class = GLHUser ] ] -{ #category : #accessing } +{ #category : 'accessing' } GitMetricExporter >> userMetrics [ ^ metrics select: [ :metric | metric inheritsFrom: UserMetric ] ] -{ #category : #setup } +{ #category : 'setup' } GitMetricExporter >> withEmailDomain: anEmailDomain [ "define the email domain of your Git user. Usefull to link them between service (i.e. Jira)" diff --git a/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st b/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st index 8e2b064..68a1437 100644 --- a/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/JiraTimeMRTimeDifferenceMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #JiraTimeMRTimeDifferenceMetric, - #superclass : #UserJiraMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'JiraTimeMRTimeDifferenceMetric', + #superclass : 'UserJiraMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } JiraTimeMRTimeDifferenceMetric >> calculate [ | groupedByDate dateOver | @@ -51,13 +52,13 @@ JiraTimeMRTimeDifferenceMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } JiraTimeMRTimeDifferenceMetric >> description [ ^ 'average difference in seconds between jira estimate time and associated merge request time (time between first commit and merge date)' ] -{ #category : #loading } +{ #category : 'loading' } JiraTimeMRTimeDifferenceMetric >> load [ userMergeRequests := self diff --git a/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st b/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st index 8b49bc6..1cd32d1 100644 --- a/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/MergeRequestDurationMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #MergeRequestDurationMetric, - #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'MergeRequestDurationMetric', + #superclass : 'UserMergeRequestMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } MergeRequestDurationMetric >> calculate [ | groupedByDate gitAnalyzer mergeRequestsValidation filterGroups | @@ -51,13 +52,13 @@ MergeRequestDurationMetric >> calculate [ ^ filterGroups average asSeconds ] -{ #category : #accessing } +{ #category : 'accessing' } MergeRequestDurationMetric >> description [ ^ 'average time to merge a merge request (in seconds)' ] -{ #category : #accessing } +{ #category : 'accessing' } MergeRequestDurationMetric >> name [ ^ 'mergeRequestDuration' diff --git a/src/GitLabHealth-Model-Analysis/MergedMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/MergedMergeRequestMetric.class.st index 39a6863..208a604 100644 --- a/src/GitLabHealth-Model-Analysis/MergedMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/MergedMergeRequestMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #MergedMergeRequestMetric, - #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'MergedMergeRequestMetric', + #superclass : 'UserMergeRequestMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } MergedMergeRequestMetric >> calculate [ | groupedByDate userMergedMergeRequests dateOver | @@ -28,13 +29,13 @@ MergedMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } MergedMergeRequestMetric >> description [ ^ 'number of merge request merged by this user' ] -{ #category : #loading } +{ #category : 'loading' } MergedMergeRequestMetric >> load [ userMergeRequests := self @@ -42,7 +43,7 @@ MergedMergeRequestMetric >> load [ until: (period at: #until) ] -{ #category : #accessing } +{ #category : 'accessing' } MergedMergeRequestMetric >> name [ ^ 'mergedMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/Metric.class.st b/src/GitLabHealth-Model-Analysis/Metric.class.st index 0019531..fa908bf 100644 --- a/src/GitLabHealth-Model-Analysis/Metric.class.st +++ b/src/GitLabHealth-Model-Analysis/Metric.class.st @@ -1,62 +1,63 @@ Class { - #name : #Metric, - #superclass : #Object, + #name : 'Metric', + #superclass : 'Object', #instVars : [ 'period', 'over', 'glhImporter', 'jiraImporter' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } Metric >> accronym [ ^ (self name first uppercase asString), (self name select: #isUppercase) ] -{ #category : #calculating } +{ #category : 'calculating' } Metric >> calculate [ ^self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } Metric >> description [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } Metric >> glhImporter: anObject [ glhImporter := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } Metric >> jiraImporter: anObject [ jiraImporter := anObject ] -{ #category : #loading } +{ #category : 'loading' } Metric >> load [ ^self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } Metric >> name [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } Metric >> over: anObject [ over := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } Metric >> setPeriodSince: since until: until [ period := { @@ -64,7 +65,7 @@ Metric >> setPeriodSince: since until: until [ (#until -> until asDate) } asDictionary ] -{ #category : #'utils - date' } +{ #category : 'utils - date' } Metric >> setupGroupedDate [ | groupedByDate start end increment overSymbol | @@ -85,7 +86,7 @@ Metric >> setupGroupedDate [ over := #day ]. - [ groupedByDate keys last asDateAndTime < end ] whileTrue: [ + [ groupedByDate keys last asDate asDateAndTime < end ] whileTrue: [ | index | index := groupedByDate keys last asDateAndTime + (increment perform: overSymbol). @@ -110,7 +111,7 @@ Metric >> setupGroupedDate [ ^ groupedByDate ] -{ #category : #'utils - date' } +{ #category : 'utils - date' } Metric >> transformDate: date to: aWeekOrMonthOrYear [ aWeekOrMonthOrYear = Month ifTrue: [ ^ date asDate month asDate ]. diff --git a/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st index 6e349b4..69e5f85 100644 --- a/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/OpenedMergeRequestMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #OpenedMergeRequestMetric, - #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'OpenedMergeRequestMetric', + #superclass : 'UserMergeRequestMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } OpenedMergeRequestMetric >> calculate [ | groupedByDate dateOver | @@ -24,13 +25,13 @@ OpenedMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } OpenedMergeRequestMetric >> description [ ^'number of opened merge request' ] -{ #category : #accessing } +{ #category : 'accessing' } OpenedMergeRequestMetric >> name [ ^'openedMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st index 946d807..727c4e7 100644 --- a/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/PendingMergeRequestMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #PendingMergeRequestMetric, - #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'PendingMergeRequestMetric', + #superclass : 'UserMergeRequestMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } PendingMergeRequestMetric >> calculate [ | groupedByDate userMergedMergeRequests dateOver | @@ -26,13 +27,13 @@ PendingMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } PendingMergeRequestMetric >> description [ ^ 'number of merge request opened during a period and left opened at the end of it' ] -{ #category : #accessing } +{ #category : 'accessing' } PendingMergeRequestMetric >> name [ ^'pendingMergeRequest' ] diff --git a/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st b/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st index a72b67c..5c107b1 100644 --- a/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st +++ b/src/GitLabHealth-Model-Analysis/ProjectAnalysisReport.class.st @@ -1,19 +1,20 @@ Class { - #name : #ProjectAnalysisReport, - #superclass : #AnalysisReport, + #name : 'ProjectAnalysisReport', + #superclass : 'AnalysisReport', #instVars : [ 'projectName' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #accessing } +{ #category : 'accessing' } ProjectAnalysisReport >> projectName [ ^ projectName ] -{ #category : #accessing } +{ #category : 'accessing' } ProjectAnalysisReport >> projectName: anObject [ projectName := anObject diff --git a/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st b/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st index c56ebef..13e703c 100644 --- a/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ProjectMetric.class.st @@ -1,8 +1,9 @@ Class { - #name : #ProjectMetric, - #superclass : #Metric, + #name : 'ProjectMetric', + #superclass : 'Metric', #instVars : [ 'project' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } diff --git a/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st index 0ca0e40..23eb761 100644 --- a/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/ReviewedByUserMergeRequestMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #ReviewedByUserMergeRequestMetric, - #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'ReviewedByUserMergeRequestMetric', + #superclass : 'UserMergeRequestMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } ReviewedByUserMergeRequestMetric >> calculate [ | groupedByDate mergedMergeRequest reviewedMergeRequests dateOver gitAnalyzer | @@ -36,13 +37,13 @@ ReviewedByUserMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } ReviewedByUserMergeRequestMetric >> description [ ^ 'number of merger request reviewed by the user' ] -{ #category : #loading } +{ #category : 'loading' } ReviewedByUserMergeRequestMetric >> load [ userMergeRequests := self @@ -50,7 +51,7 @@ ReviewedByUserMergeRequestMetric >> load [ until: (period at: #until) ] -{ #category : #accessing } +{ #category : 'accessing' } ReviewedByUserMergeRequestMetric >> name [ ^ 'reviewedMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st index 5c38042..2ad8d7a 100644 --- a/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/SelfMergedUnderAMinuteMergeRequestMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #SelfMergedUnderAMinuteMergeRequestMetric, - #superclass : #UserMergeRequestMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'SelfMergedUnderAMinuteMergeRequestMetric', + #superclass : 'UserMergeRequestMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } SelfMergedUnderAMinuteMergeRequestMetric >> calculate [ | groupedByDate mergedMergeRequest noVerificationMergeRequests dateOver gitAnalyzer | @@ -43,13 +44,13 @@ SelfMergedUnderAMinuteMergeRequestMetric >> calculate [ ^ groupedByDate average asFloat ] -{ #category : #accessing } +{ #category : 'accessing' } SelfMergedUnderAMinuteMergeRequestMetric >> description [ ^ 'number of merge requests merged by its author under a minute after creation' ] -{ #category : #loading } +{ #category : 'loading' } SelfMergedUnderAMinuteMergeRequestMetric >> load [ userMergeRequests := self @@ -58,7 +59,7 @@ SelfMergedUnderAMinuteMergeRequestMetric >> load [ until: (period at: #until) ] -{ #category : #accessing } +{ #category : 'accessing' } SelfMergedUnderAMinuteMergeRequestMetric >> name [ ^ 'SelfMergedUnderAMinuteMergeRequest' diff --git a/src/GitLabHealth-Model-Analysis/String.extension.st b/src/GitLabHealth-Model-Analysis/String.extension.st index d6be4df..fd0ba7d 100644 --- a/src/GitLabHealth-Model-Analysis/String.extension.st +++ b/src/GitLabHealth-Model-Analysis/String.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #String } +Extension { #name : 'String' } -{ #category : #'*GitLabHealth-Model-Analysis' } +{ #category : '*GitLabHealth-Model-Analysis' } String >> absLevenshteinDistanceWith: aString [ ^ { self levenshteinDistanceWith: aString . aString levenshteinDistanceWith: self } max. ] -{ #category : #'*GitLabHealth-Model-Analysis' } +{ #category : '*GitLabHealth-Model-Analysis' } String >> levenshteinDistanceWith: aString [ | m n distances cost | diff --git a/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st b/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st index 8b39d2e..31ea48b 100644 --- a/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/TimeBetweenCommitMetric.class.st @@ -1,10 +1,11 @@ Class { - #name : #TimeBetweenCommitMetric, - #superclass : #UserCommitsMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'TimeBetweenCommitMetric', + #superclass : 'UserCommitsMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } TimeBetweenCommitMetric >> calculate [ | commitSortedByDate commits1 commits2 differences groupedByDate dateOver average | @@ -44,7 +45,7 @@ TimeBetweenCommitMetric >> calculate [ ^ average ] -{ #category : #accessing } +{ #category : 'accessing' } TimeBetweenCommitMetric >> description [ ^ 'average time between commits (in seconds)' diff --git a/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st b/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st index 82b130e..d9b5535 100644 --- a/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st +++ b/src/GitLabHealth-Model-Analysis/UserAnalysisReport.class.st @@ -1,19 +1,33 @@ Class { - #name : #UserAnalysisReport, - #superclass : #AnalysisReport, + #name : 'UserAnalysisReport', + #superclass : 'AnalysisReport', #instVars : [ - 'username' + 'username', + 'email' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #accessing } +{ #category : 'accessing' } +UserAnalysisReport >> email [ + + ^ email +] + +{ #category : 'accessing' } +UserAnalysisReport >> email: anObject [ + + email := anObject +] + +{ #category : 'accessing' } UserAnalysisReport >> username [ ^ username ] -{ #category : #accessing } +{ #category : 'accessing' } UserAnalysisReport >> username: anObject [ username := anObject diff --git a/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st b/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st index a4de30c..953ab4f 100644 --- a/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserCommitsMetric.class.st @@ -1,22 +1,23 @@ Class { - #name : #UserCommitsMetric, - #superclass : #UserMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'UserCommitsMetric', + #superclass : 'UserMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } UserCommitsMetric >> calculate [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } UserCommitsMetric >> description [ ^ self subclassResponsibility ] -{ #category : #loading } +{ #category : 'loading' } UserCommitsMetric >> load [ userCommits := self @@ -24,7 +25,7 @@ UserCommitsMetric >> load [ until: (period at: #until) ] -{ #category : #accessing } +{ #category : 'accessing' } UserCommitsMetric >> name [ ^ self class name asString diff --git a/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st b/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st index e7b6c78..2de1b38 100644 --- a/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserJiraMetric.class.st @@ -1,22 +1,23 @@ Class { - #name : #UserJiraMetric, - #superclass : #UserMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'UserJiraMetric', + #superclass : 'UserMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } UserJiraMetric >> calculate [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } UserJiraMetric >> description [ ^ self subclassResponsibility ] -{ #category : #loading } +{ #category : 'loading' } UserJiraMetric >> load [ userMergeRequests := self @@ -24,7 +25,7 @@ UserJiraMetric >> load [ until: (period at: #until) ] -{ #category : #accessing } +{ #category : 'accessing' } UserJiraMetric >> name [ ^ self class name asString diff --git a/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st index 76258fc..2102b1d 100644 --- a/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMergeRequestMetric.class.st @@ -1,22 +1,23 @@ Class { - #name : #UserMergeRequestMetric, - #superclass : #UserMetric, - #category : 'GitLabHealth-Model-Analysis' + #name : 'UserMergeRequestMetric', + #superclass : 'UserMetric', + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #calculating } +{ #category : 'calculating' } UserMergeRequestMetric >> calculate [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } UserMergeRequestMetric >> description [ ^ self subclassResponsibility ] -{ #category : #loading } +{ #category : 'loading' } UserMergeRequestMetric >> load [ userMergeRequests := self @@ -24,7 +25,7 @@ UserMergeRequestMetric >> load [ until: (period at: #until). ] -{ #category : #accessing } +{ #category : 'accessing' } UserMergeRequestMetric >> name [ ^ self class name asString diff --git a/src/GitLabHealth-Model-Analysis/UserMetric.class.st b/src/GitLabHealth-Model-Analysis/UserMetric.class.st index 5ed51cd..ab9d024 100644 --- a/src/GitLabHealth-Model-Analysis/UserMetric.class.st +++ b/src/GitLabHealth-Model-Analysis/UserMetric.class.st @@ -1,41 +1,42 @@ Class { - #name : #UserMetric, - #superclass : #Metric, + #name : 'UserMetric', + #superclass : 'Metric', #instVars : [ 'user', 'userCommits', 'userMergeRequests', 'emailDomain' ], - #category : 'GitLabHealth-Model-Analysis' + #category : 'GitLabHealth-Model-Analysis', + #package : 'GitLabHealth-Model-Analysis' } -{ #category : #utils } +{ #category : 'utils' } UserMetric >> cacheSymbolFor: anEntityType since: since until: until [ ^ (anEntityType printString , ' since ' , since printString , ' to ' , until printString) asSymbol ] -{ #category : #calculating } +{ #category : 'calculating' } UserMetric >> calculate [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } UserMetric >> description [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } UserMetric >> emailDomain: anObject [ emailDomain := anObject ] -{ #category : #churn } +{ #category : 'churn' } UserMetric >> foundSuccessorOf: commits andCompleteImportForMax: commitLimit [ | analyzingCommits i size | @@ -57,18 +58,18 @@ UserMetric >> foundSuccessorOf: commits andCompleteImportForMax: commitLimit [ ^ analyzingCommits ] -{ #category : #initialization } +{ #category : 'initialization' } UserMetric >> initialize [ over := Date ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> load [ ^ self subclassResponsibility ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> loadCompleteMergeRequestsSince: since until: until [ | mergeRequests | @@ -82,7 +83,7 @@ UserMetric >> loadCompleteMergeRequestsSince: since until: until [ ^ mergeRequests ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> loadMergeRequestsSince: since until: until [ | cacheSymbol mergeRequests | @@ -110,7 +111,7 @@ UserMetric >> loadMergeRequestsSince: since until: until [ mergeRequest author = user ]" ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> loadMergeRequestsWithJiraIssueSince: since until: until [ | email mergeRequests | @@ -130,7 +131,7 @@ UserMetric >> loadMergeRequestsWithJiraIssueSince: since until: until [ mergeRequest jiraIssue isNotNil ] ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> loadUserCommitsSince: since until: until [ | cacheSymbol allCommits | @@ -161,7 +162,7 @@ UserMetric >> loadUserCommitsSince: since until: until [ ^ allCommits reject: [ :commit | commit commitCreator ~= user ] ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> loadUserCompleteCommitsSince: since until: until [ | commits | @@ -170,7 +171,7 @@ UserMetric >> loadUserCompleteCommitsSince: since until: until [ ^ commits ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> loadUserCompleteMergeRequestsSince: since until: until [ | mergeRequests | @@ -183,7 +184,7 @@ UserMetric >> loadUserCompleteMergeRequestsSince: since until: until [ ^ mergeRequests ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> loadUserCompleteMergeRequestsWithJiraIssueSince: since until: until [ | email mergeRequests | @@ -204,7 +205,7 @@ UserMetric >> loadUserCompleteMergeRequestsWithJiraIssueSince: since until: unti mergeRequest jiraIssue isNotNil ] ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> loadUserMergeRequestsSince: since until: until [ | mergeRequests | @@ -213,7 +214,7 @@ UserMetric >> loadUserMergeRequestsSince: since until: until [ ^ mergeRequests select: [ :mergeRequest | mergeRequest author = user ] ] -{ #category : #loading } +{ #category : 'loading' } UserMetric >> loadUserMergeRequestsWithJiraIssueSince: since until: until [ | email mergeRequests | @@ -232,19 +233,19 @@ UserMetric >> loadUserMergeRequestsWithJiraIssueSince: since until: until [ mergeRequest jiraIssue isNotNil ] ] -{ #category : #accessing } +{ #category : 'accessing' } UserMetric >> name [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } UserMetric >> user: anObject [ user := anObject ] -{ #category : #email } +{ #category : 'email' } UserMetric >> userEmail [ user public_email = '' ifFalse: [ ^ user public_email ]. diff --git a/src/GitLabHealth-Model-Analysis/package.st b/src/GitLabHealth-Model-Analysis/package.st index b7288f0..d311de9 100644 --- a/src/GitLabHealth-Model-Analysis/package.st +++ b/src/GitLabHealth-Model-Analysis/package.st @@ -1 +1 @@ -Package { #name : #'GitLabHealth-Model-Analysis' } +Package { #name : 'GitLabHealth-Model-Analysis' } From ebaebab4f664b3c24f424046820af88b5abce937 Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Mon, 4 Nov 2024 16:55:07 +0100 Subject: [PATCH 4/4] revert date for pharo 11 compatibility --- src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st | 2 +- src/GitLabHealth-Model-Analysis/Metric.class.st | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st index c0381cb..a5bcf12 100644 --- a/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st +++ b/src/GitLabHealth-Model-Analysis/GitMetricExporter.class.st @@ -370,7 +370,7 @@ GitMetricExporter >> generateUsersAnalysesDuringPeriod: period over: aDateWeekMo ^ self userEntities collect: [ :user | userAnalysisReport := UserAnalysisReport new username: user name; - email: (user email ifNil: #public_email); + email: (user email ifNil: [ user public_email]); period: period; over: aDateWeekMonthOrYear. diff --git a/src/GitLabHealth-Model-Analysis/Metric.class.st b/src/GitLabHealth-Model-Analysis/Metric.class.st index fa908bf..5643853 100644 --- a/src/GitLabHealth-Model-Analysis/Metric.class.st +++ b/src/GitLabHealth-Model-Analysis/Metric.class.st @@ -86,7 +86,7 @@ Metric >> setupGroupedDate [ over := #day ]. - [ groupedByDate keys last asDate asDateAndTime < end ] whileTrue: [ + [ groupedByDate keys last asDateAndTime < end ] whileTrue: [ | index | index := groupedByDate keys last asDateAndTime + (increment perform: overSymbol).