Skip to content
Snippets Groups Projects
Commit f0218ee5 authored by michael.minelli's avatar michael.minelli
Browse files

Sonar => Resolve issues

parent 10de0524
No related branches found
No related tags found
No related merge requests found
Pipeline #30059 passed
...@@ -5,6 +5,9 @@ Wiki/.idea ...@@ -5,6 +5,9 @@ Wiki/.idea
AssignmentChecker/src/config/Version.ts AssignmentChecker/src/config/Version.ts
sonarlint.xml
sonarlint/
############################ MacOS ############################ MacOS
# General # General
.DS_Store .DS_Store
......
...@@ -15,4 +15,7 @@ ...@@ -15,4 +15,7 @@
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="SonarLintModuleSettings">
<option name="uniqueId" value="682e6500-c301-4a49-8741-50d7adfbb82c" />
</component>
</module> </module>
\ No newline at end of file
This diff is collapsed.
...@@ -29,17 +29,20 @@ ...@@ -29,17 +29,20 @@
"test" : "echo \"Error: no test specified\" && exit 1" "test" : "echo \"Error: no test specified\" && exit 1"
}, },
"dependencies" : { "dependencies" : {
"@gitbeaker/rest" : "^39.34.3",
"axios" : "^1.6.5", "axios" : "^1.6.5",
"boxen" : "^5.1.2", "boxen" : "^5.1.2",
"chalk" : "^4.1.2", "chalk" : "^4.1.2",
"dotenv" : "^16.3.1", "dotenv" : "^16.3.1",
"dotenv-expand" : "^10.0.0", "dotenv-expand" : "^10.0.0",
"form-data" : "^4.0.0",
"fs-extra" : "^11.2.0", "fs-extra" : "^11.2.0",
"http-status-codes" : "^2.3.0", "http-status-codes" : "^2.3.0",
"json5" : "^2.2.3", "json5" : "^2.2.3",
"ora" : "^5.4.1", "ora" : "^5.4.1",
"tar-stream" : "^3.1.6", "tar-stream" : "^3.1.6",
"winston" : "^3.11.0", "winston" : "^3.11.0",
"winston-transport" : "^4.7.0",
"yaml" : "^2.3.4", "yaml" : "^2.3.4",
"zod" : "^3.22.4", "zod" : "^3.22.4",
"zod-validation-error": "^3.0.0" "zod-validation-error": "^3.0.0"
......
...@@ -30,15 +30,15 @@ import Icon from './shared/types/Icon'; ...@@ -30,15 +30,15 @@ import Icon from './shared/types/Icon';
try { try {
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
assignmentValidator.events.on('step', (name: string, message: string) => { assignmentValidator.events.on('step', (_name: string, message: string) => {
console.log(Styles.CAT_INFO(`${ Icon.CAT_INFO } ${ message }`)); console.log(Styles.CAT_INFO(`${ Icon.CAT_INFO } ${ message }`));
}); });
assignmentValidator.events.on('subStep', (name: string, message: string) => { assignmentValidator.events.on('subStep', (_name: string, message: string) => {
console.log(Styles.INFO(`\t${ Icon.INFO } ${ message }`)); console.log(Styles.INFO(`\t${ Icon.INFO } ${ message }`));
}); });
assignmentValidator.events.on('endSubStep', (stepName: string, message: string, error: boolean) => { assignmentValidator.events.on('endSubStep', (_stepName: string, message: string, error: boolean) => {
if ( error ) { if ( error ) {
console.error(Styles.ERROR(`\t${ Icon.ERROR } ${ message }`)); console.error(Styles.ERROR(`\t${ Icon.ERROR } ${ message }`));
} }
......
import ClientsSharedConfig from '../sharedByClients/config/ClientsSharedConfig';
import ApiRoute from '../sharedByClients/types/Dojo/ApiRoute';
class DojoBackendManager {
public getApiUrl(route: ApiRoute): string {
return `${ ClientsSharedConfig.apiURL }${ route }`;
}
}
export default new DojoBackendManager();
...@@ -29,9 +29,9 @@ class HttpManager { ...@@ -29,9 +29,9 @@ class HttpManager {
} }
private registerRequestInterceptor() { private registerRequestInterceptor() {
axios.interceptors.request.use((config) => { axios.interceptors.request.use(config => {
if ( config.data instanceof FormData ) { if ( config.data instanceof FormData ) {
config.headers = { ...config.headers, ...(config.data as FormData).getHeaders() } as AxiosRequestHeaders; config.headers = { ...config.headers, ...config.data.getHeaders() } as AxiosRequestHeaders;
} }
if ( config.url && (config.url.indexOf(ClientsSharedConfig.apiURL) !== -1) ) { if ( config.url && (config.url.indexOf(ClientsSharedConfig.apiURL) !== -1) ) {
...@@ -41,8 +41,6 @@ class HttpManager { ...@@ -41,8 +41,6 @@ class HttpManager {
config.headers['Content-Type'] = 'multipart/form-data'; config.headers['Content-Type'] = 'multipart/form-data';
} }
//config.headers.Authorization = `ExerciseSecret ${ Config.exercise.secret }`;
config.headers['client'] = 'DojoAssignmentChecker'; config.headers['client'] = 'DojoAssignmentChecker';
config.headers['client-version'] = version; config.headers['client-version'] = version;
} }
...@@ -52,9 +50,7 @@ class HttpManager { ...@@ -52,9 +50,7 @@ class HttpManager {
} }
private registerResponseInterceptor() { private registerResponseInterceptor() {
axios.interceptors.response.use((response) => { axios.interceptors.response.use(response => response, (error) => {
return response;
}, (error) => {
if ( error.response ) { if ( error.response ) {
if ( error.response.status === StatusCodes.METHOD_NOT_ALLOWED && error.response.data ) { if ( error.response.status === StatusCodes.METHOD_NOT_ALLOWED && error.response.data ) {
const data: DojoBackendResponse<void> = error.response.data; const data: DojoBackendResponse<void> = error.response.data;
......
Subproject commit 89f3579ca9009f793742170928d808ab4c35d931 Subproject commit fca59c4d155603b53d48a30401aabab82d91fc59
Subproject commit 098c6d20f6ed84240c086b979b56afd598fdfea4 Subproject commit 9e75273d4600f5f42c8be3c24bdced6844c32449
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment