Skip to content

Commit 636890e

Browse files
authored
Fix some code quality issues identified by LGTM (#925)
1 parent 3885c68 commit 636890e

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

src/credentials/providers/sharedCredentialsProvider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,10 @@ export class SharedCredentialsProvider implements CredentialsProvider {
112112
private validateSourceProfileChain(): string | undefined {
113113
const profilesTraversed: string[] = [this.profileName]
114114

115-
let profileName = this.profileName
116115
let profile = this.profile
117116

118117
while (!!profile[SHARED_CREDENTIAL_PROPERTIES.SOURCE_PROFILE]) {
119-
profileName = profile[SHARED_CREDENTIAL_PROPERTIES.SOURCE_PROFILE]!
118+
const profileName = profile[SHARED_CREDENTIAL_PROPERTIES.SOURCE_PROFILE]!
120119

121120
// Cycle
122121
if (profilesTraversed.indexOf(profileName) !== -1) {

src/eventSchemas/commands/downloadSchemaItemCode.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ export class SchemaCodeDownloader {
173173
}
174174

175175
export class CodeGenerator {
176-
public constructor(public client: SchemaClient) {
177-
this.client = client
178-
}
176+
public constructor(public client: SchemaClient) {}
179177

180178
public async generate(
181179
codeDownloadRequest: SchemaCodeDownloadRequestDetails
@@ -210,9 +208,7 @@ export class CodeGenerator {
210208
}
211209

212210
export class CodeGenerationStatusPoller {
213-
public constructor(public client: SchemaClient) {
214-
this.client = client
215-
}
211+
public constructor(public client: SchemaClient) {}
216212

217213
public async pollForCompletion(
218214
codeDownloadRequest: SchemaCodeDownloadRequestDetails,
@@ -258,9 +254,7 @@ export class CodeGenerationStatusPoller {
258254
}
259255
}
260256
export class CodeDownloader {
261-
public constructor(public client: SchemaClient) {
262-
this.client = client
263-
}
257+
public constructor(public client: SchemaClient) {}
264258

265259
public async download(codeDownloadRequest: SchemaCodeDownloadRequestDetails): Promise<ArrayBuffer> {
266260
const response = await this.client.getCodeBindingSource(

src/shared/filesystemUtilities.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ export async function findFileInParentPaths(searchFolder: string, fileToFind: st
6262
}
6363

6464
export const makeTemporaryToolkitFolder = async (...relativePathParts: string[]) => {
65-
const _relativePathParts = relativePathParts || []
66-
if (_relativePathParts.length === 0) {
67-
_relativePathParts.push('vsctk')
65+
if (relativePathParts.length === 0) {
66+
relativePathParts.push('vsctk')
6867
}
6968

70-
const tmpPath = path.join(tempDirPath, ..._relativePathParts)
69+
const tmpPath = path.join(tempDirPath, ...relativePathParts)
7170
const tmpPathParent = path.dirname(tmpPath)
7271
// fs.makeTemporaryToolkitFolder fails on OSX if prefix contains path separator
7372
// so we must create intermediate dirs if needed

0 commit comments

Comments
 (0)