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
Commits
4ab3c150
Commit
4ab3c150
authored
1 year ago
by
joel.vonderwe
Committed by
michael.minelli
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
Add sonar language utilities
parent
82c7b8e1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide 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
+
17
−
0
View file @
4ab3c150
import
axios
from
'
axios
'
;
import
https
from
'
https
'
;
import
SharedConfig
from
'
../config/SharedConfig
'
;
import
{
Language
}
from
'
@prisma/client
'
;
class
SharedSonarManager
{
...
...
@@ -22,6 +23,22 @@ class SharedSonarManager {
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
();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
types/Sonar/SonarRoute.ts
+
2
−
1
View file @
4ab3c150
enum
SonarRoute
{
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
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment