Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NodeSharedCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
Shared
NodeSharedCode
Compare revisions
f520ab1bc078621b5a1de35841cf53bbb6b59464 to 7f368ef971c8bbe9c5c693a6a8cf733f2ed1e3d2
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
dojo_project/projects/shared/nodesharedcode
Select target project
No results found
7f368ef971c8bbe9c5c693a6a8cf733f2ed1e3d2
Select Git revision
Swap
Target
dojo_project/projects/shared/nodesharedcode
Select target project
dojo_project/projects/shared/nodesharedcode
1 result
f520ab1bc078621b5a1de35841cf53bbb6b59464
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Add sonar language utilities
· 7f368ef9
joel.vonderwe
authored
1 year ago
7f368ef9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
managers/SharedSonarManager.ts
+17
-0
17 additions, 0 deletions
managers/SharedSonarManager.ts
types/Sonar/SonarRoute.ts
+2
-1
2 additions, 1 deletion
types/Sonar/SonarRoute.ts
with
19 additions
and
1 deletion
managers/SharedSonarManager.ts
View file @
7f368ef9
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
https
from
'
https
'
;
import
https
from
'
https
'
;
import
SharedConfig
from
'
../config/SharedConfig
'
;
import
SharedConfig
from
'
../config/SharedConfig
'
;
import
{
Language
}
from
'
@prisma/client
'
;
class
SharedSonarManager
{
class
SharedSonarManager
{
...
@@ -22,6 +23,22 @@ class SharedSonarManager {
...
@@ -22,6 +23,22 @@ class SharedSonarManager {
return
false
;
return
false
;
}
}
}
}
/**
* Map a language name to the equivalent language ID in Sonar
* Most language have the same name, so by default the same name is returned, even for languages that doesn't exist in sonar.
* @param language
*/
mapLanguage
(
language
:
Language
):
string
{
switch
(
language
)
{
case
Language
.
csharp
:
return
"
cs
"
;
case
Language
.
python
:
return
"
py
"
;
default
:
return
language
;
}
}
}
}
export
default
new
SharedSonarManager
();
export
default
new
SharedSonarManager
();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
types/Sonar/SonarRoute.ts
View file @
7f368ef9
enum
SonarRoute
{
enum
SonarRoute
{
SET_PAT
=
'
/api/alm_integrations/set_pat
'
,
SET_PAT
=
'
/api/alm_integrations/set_pat
'
,
PROJECT_CREATE_GITLAB
=
'
/api/alm_integrations/import_gitlab_project
'
PROJECT_CREATE_GITLAB
=
'
/api/alm_integrations/import_gitlab_project
'
,
GET_LANGUAGES
=
'
/api/languages/list
'
}
}
export
default
SonarRoute
;
export
default
SonarRoute
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.