Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • dojo_project/projects/shared/nodesharedcode
1 result
Select Git revision
Show changes
Commits on Source (1)
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
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