Skip to content

Commit 3155002

Browse files
committed
sonarqube
1 parent 7154c49 commit 3155002

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/commands/api/transform.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { TransformationFormats } from "../../types/api/transform.js";
88
const DEFAULT_WORKING_DIRECTORY = "./";
99

1010
export default class Transform extends Command {
11-
static description = `Transform API specifications from one format to another.
11+
static readonly description = `Transform API specifications from one format to another.
1212
Supports multiple formats including OpenAPI/Swagger, RAML, WSDL, and Postman Collections.`;
1313

1414
static examples = [
@@ -48,21 +48,15 @@ Supports multiple formats including OpenAPI/Swagger, RAML, WSDL, and Postman Col
4848

4949
const action = new TransformAction(this.getConfigDir(), authKey);
5050

51-
const result = await action.execute(
52-
format,
53-
destinationDir,
54-
force,
55-
file,
56-
url
57-
);
51+
const result = await action.execute(format, destinationDir, force, file, url);
5852

5953
result.mapAll(
6054
() => this.prompts.displayOutroMessage(destinationDir),
6155
(message: string) => this.prompts.logError(message)
6256
);
6357
}
6458

65-
private getConfigDir = () => {
59+
private readonly getConfigDir = () => {
6660
return new DirectoryPath(this.config.configDir);
6761
};
6862
}

src/infrastructure/services/transform-service.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ import {
1616

1717
import { AuthInfo, getAuthInfo } from "../../client-utils/auth-manager.js";
1818
import { envInfo } from "../env-info.js";
19-
import { getMessageInRedColor } from "../../utils/utils.js";
19+
import { getMessageInRedColor, writeFileUsingReadableStream } from "../../utils/utils.js";
2020
import { TransformationData } from "../../types/api/transform.js";
2121
import { Result } from "../../types/common/result.js";
22-
import { writeFileUsingReadableStream } from "../../utils/utils.js";
2322
import { DirectoryPath } from "../../types/file/directoryPath.js";
2423
import { ApiTransformPrompts } from "../../prompts/api/transform.js";
2524

@@ -109,7 +108,7 @@ export class TransformationService {
109108
});
110109
}
111110

112-
private handleTransformationErrors = async (error: unknown): Promise<string> => {
111+
private readonly handleTransformationErrors = async (error: unknown): Promise<string> => {
113112
if (error instanceof UnauthorizedResponseError) {
114113
//401
115114
const unAuthError = error as UnauthorizedResponseError;

0 commit comments

Comments
 (0)