Skip to content

Commit

Permalink
fix vsce lint warnings - not complexity or any return type
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Twydell <[email protected]>
  • Loading branch information
AndrewTwydell committed Jan 9, 2025
1 parent 106365f commit 793ba73
Show file tree
Hide file tree
Showing 38 changed files with 347 additions and 379 deletions.
10 changes: 4 additions & 6 deletions packages/vsce/src/commands/clearResourceFilterCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
*/

import { commands, ProgressLocation, TreeView, window } from "vscode";
import { CICSLibraryDatasets } from "../trees/treeItems/CICSLibraryDatasets";
import { CICSLibraryTree } from "../trees/CICSLibraryTree";
import { CICSLocalFileTree } from "../trees/CICSLocalFileTree";
import { CICSProgramTree } from "../trees/CICSProgramTree";
import { CICSTaskTree } from "../trees/CICSTaskTree";
import { CICSTransactionTree } from "../trees/CICSTransactionTree";
import { CICSTree } from "../trees/CICSTree";
import { findSelectedNodes } from "../utils/commandUtils";
import { CICSLibraryDatasets } from "../trees/treeItems/CICSLibraryDatasets";
import { CICSLibraryTreeItem } from "../trees/treeItems/CICSLibraryTreeItem";
import { CICSPipelineTree } from "../trees/treeItems/web/CICSPipelineTree";
import { CICSTCPIPServiceTree } from "../trees/treeItems/web/CICSTCPIPServiceTree";
import { CICSURIMapTree } from "../trees/treeItems/web/CICSURIMapTree";
import { CICSWebServiceTree } from "../trees/treeItems/web/CICSWebServiceTree";
import { CICSPipelineTree } from "../trees/treeItems/web/CICSPipelineTree";
import { findSelectedNodes } from "../utils/commandUtils";

export function getClearResourceFilterCommand(tree: CICSTree, treeview: TreeView<any>) {
return commands.registerCommand("cics-extension-for-zowe.clearFilter", async (node) => {
Expand Down Expand Up @@ -63,9 +63,7 @@ export function getClearResourceFilterCommand(tree: CICSTree, treeview: TreeView
cancellable: false,
},
async (_, token) => {
token.onCancellationRequested(() => {
console.log("Cancelling the loading of resources");
});
token.onCancellationRequested(() => { });
await selectedNode.loadContents();
tree._onDidChangeTreeData.fire(undefined);
}
Expand Down
17 changes: 8 additions & 9 deletions packages/vsce/src/commands/closeLocalFileCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, Utils, IGetResourceUriOptions } from "@zowe/cics-for-zowe-sdk";
import { imperative } from "@zowe/zowe-explorer-api";
import { commands, ProgressLocation, TreeView, window } from "vscode";
import { CICSCombinedLocalFileTree } from "../trees/CICSCombinedTrees/CICSCombinedLocalFileTree";
import { CICSRegionsContainer } from "../trees/CICSRegionsContainer";
import { CICSRegionTree } from "../trees/CICSRegionTree";
import { CICSTree } from "../trees/CICSTree";
import { CICSRegionsContainer } from "../trees/CICSRegionsContainer";
import { CICSLocalFileTreeItem } from "../trees/treeItems/CICSLocalFileTreeItem";
import { findSelectedNodes, splitCmciErrorMessage } from "../utils/commandUtils";
import { CICSCombinedLocalFileTree } from "../trees/CICSCombinedTrees/CICSCombinedLocalFileTree";
import { ICommandParams } from "./ICommandParams";
import constants from "../utils/constants";

export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView<any>) {
return commands.registerCommand("cics-extension-for-zowe.closeLocalFile", async (clickedNode) => {
Expand All @@ -42,13 +43,11 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView<any>
cancellable: true,
},
async (progress, token) => {
token.onCancellationRequested(() => {
console.log("Cancelling the Close");
});
token.onCancellationRequested(() => { });
for (const index in allSelectedNodes) {
progress.report({
message: `Closing ${parseInt(index) + 1} of ${allSelectedNodes.length}`,
increment: (parseInt(index) / allSelectedNodes.length) * 100,
increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX,
});
const currentNode = allSelectedNodes[parseInt(index)];

Expand All @@ -69,7 +68,7 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView<any>
// @ts-ignore
if (error.mMessage) {
// @ts-ignore
const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage);
const [_resp, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage);

window.showErrorMessage(
`Perform CLOSE on local file "${allSelectedNodes[parseInt(index)].localFile.file
Expand Down Expand Up @@ -117,7 +116,7 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView<any>
});
}

async function closeLocalFile(
function closeLocalFile(
session: imperative.AbstractSession,
parms: ICommandParams,
busyDecision: string
Expand Down Expand Up @@ -146,5 +145,5 @@ async function closeLocalFile(

const cmciResource = Utils.getResourceUri(CicsCmciConstants.CICS_CMCI_LOCAL_FILE, options);

return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, Utils, IGetResourceUriOptions } from "@zowe/cics-for-zowe-sdk";
import { imperative } from "@zowe/zowe-explorer-api";
import { commands, ProgressLocation, TreeView, window } from "vscode";
import { CICSCombinedLocalFileTree } from "../../trees/CICSCombinedTrees/CICSCombinedLocalFileTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { CICSRegionTree } from "../../trees/CICSRegionTree";
import { CICSTree } from "../../trees/CICSTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { findSelectedNodes } from "../../utils/commandUtils";
import { CICSLocalFileTreeItem } from "../../trees/treeItems/CICSLocalFileTreeItem";
import { CICSCombinedLocalFileTree } from "../../trees/CICSCombinedTrees/CICSCombinedLocalFileTree";
import { ICommandParams } from "../ICommandParams";
import { CICSLocalFileTreeItem } from "../../trees/treeItems/CICSLocalFileTreeItem";
import constants from "../../utils/constants";

export function getDisableLocalFileCommand(tree: CICSTree, treeview: TreeView<any>) {
return commands.registerCommand("cics-extension-for-zowe.disableLocalFile", async (clickedNode) => {
Expand All @@ -42,13 +43,11 @@ export function getDisableLocalFileCommand(tree: CICSTree, treeview: TreeView<an
cancellable: true,
},
async (progress, token) => {
token.onCancellationRequested(() => {
console.log("Cancelling the Disable");
});
token.onCancellationRequested(() => { });
for (const index in allSelectedNodes) {
progress.report({
message: `Disabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`,
increment: (parseInt(index) / allSelectedNodes.length) * 100,
increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX,
});
const currentNode = allSelectedNodes[parseInt(index)];

Expand Down Expand Up @@ -106,7 +105,7 @@ export function getDisableLocalFileCommand(tree: CICSTree, treeview: TreeView<an
});
}

async function disableLocalFile(
function disableLocalFile(
session: imperative.AbstractSession,
parms: ICommandParams,
busyDecision: string
Expand Down Expand Up @@ -135,5 +134,5 @@ async function disableLocalFile(

const cmciResource = Utils.getResourceUri(CicsCmciConstants.CICS_CMCI_LOCAL_FILE, options);

return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, Utils, IGetResourceUriOptions } from "@zowe/cics-for-zowe-sdk";
import { imperative } from "@zowe/zowe-explorer-api";
import { commands, ProgressLocation, TreeView, window } from "vscode";
import { CICSCombinedProgramTree } from "../../trees/CICSCombinedTrees/CICSCombinedProgramTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { CICSRegionTree } from "../../trees/CICSRegionTree";
import { CICSTree } from "../../trees/CICSTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { findSelectedNodes } from "../../utils/commandUtils";
import { CICSProgramTreeItem } from "../../trees/treeItems/CICSProgramTreeItem";
import { CICSCombinedProgramTree } from "../../trees/CICSCombinedTrees/CICSCombinedProgramTree";
import { ICommandParams } from "../ICommandParams";
import constants from "../../utils/constants";

/**
* Performs disable on selected CICSProgram nodes.
Expand All @@ -40,13 +41,11 @@ export function getDisableProgramCommand(tree: CICSTree, treeview: TreeView<any>
cancellable: true,
},
async (progress, token) => {
token.onCancellationRequested(() => {
console.log("Cancelling the Disable");
});
token.onCancellationRequested(() => { });
for (const index in allSelectedNodes) {
progress.report({
message: `Disabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`,
increment: (parseInt(index) / allSelectedNodes.length) * 100,
increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX,
});
const currentNode = allSelectedNodes[parseInt(index)];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, Utils, IGetResourceUriOptions } from "@zowe/cics-for-zowe-sdk";
import { imperative } from "@zowe/zowe-explorer-api";
import { commands, ProgressLocation, TreeView, window } from "vscode";
import { CICSCombinedTransactionsTree } from "../../trees/CICSCombinedTrees/CICSCombinedTransactionTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { CICSRegionTree } from "../../trees/CICSRegionTree";
import { CICSTree } from "../../trees/CICSTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { findSelectedNodes, splitCmciErrorMessage } from "../../utils/commandUtils";
import { CICSTransactionTreeItem } from "../../trees/treeItems/CICSTransactionTreeItem";
import { CICSCombinedTransactionsTree } from "../../trees/CICSCombinedTrees/CICSCombinedTransactionTree";
import { ICommandParams } from "../ICommandParams";
import constants from "../../utils/constants";

export function getDisableTransactionCommand(tree: CICSTree, treeview: TreeView<any>) {
return commands.registerCommand("cics-extension-for-zowe.disableTransaction", async (clickedNode) => {
Expand All @@ -35,13 +36,11 @@ export function getDisableTransactionCommand(tree: CICSTree, treeview: TreeView<
cancellable: true,
},
async (progress, token) => {
token.onCancellationRequested(() => {
console.log("Cancelling the Disable");
});
token.onCancellationRequested(() => { });
for (const index in allSelectedNodes) {
progress.report({
message: `Disabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`,
increment: (parseInt(index) / allSelectedNodes.length) * 100,
increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX,
});
const currentNode = allSelectedNodes[parseInt(index)];

Expand All @@ -59,10 +58,9 @@ export function getDisableTransactionCommand(tree: CICSTree, treeview: TreeView<
// @ts-ignore
if (error.mMessage) {
// @ts-ignore
const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage);
const [_resp, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage);
window.showErrorMessage(
`Perform DISABLE on Transaction "${
allSelectedNodes[parseInt(index)].transaction.tranid
`Perform DISABLE on Transaction "${allSelectedNodes[parseInt(index)].transaction.tranid
}" failed: EXEC CICS command (${eibfnAlt}) RESP(${respAlt}) RESP2(${resp2})`
);
} else {
Expand Down Expand Up @@ -107,7 +105,7 @@ export function getDisableTransactionCommand(tree: CICSTree, treeview: TreeView<
});
}

async function disableTransaction(
function disableTransaction(
session: imperative.AbstractSession,
parms: ICommandParams
): Promise<ICMCIApiResponse> {
Expand All @@ -129,5 +127,5 @@ async function disableTransaction(

const cmciResource = Utils.getResourceUri(CicsCmciConstants.CICS_LOCAL_TRANSACTION, options);

return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, Utils, IGetResourceUriOptions } from "@zowe/cics-for-zowe-sdk";
import { imperative } from "@zowe/zowe-explorer-api";
import { commands, ProgressLocation, TreeView, window } from "vscode";
import { CICSCombinedLocalFileTree } from "../../trees/CICSCombinedTrees/CICSCombinedLocalFileTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { CICSRegionTree } from "../../trees/CICSRegionTree";
import { CICSTree } from "../../trees/CICSTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { CICSLocalFileTreeItem } from "../../trees/treeItems/CICSLocalFileTreeItem";
import { findSelectedNodes } from "../../utils/commandUtils";
import { CICSCombinedLocalFileTree } from "../../trees/CICSCombinedTrees/CICSCombinedLocalFileTree";
import { ICommandParams } from "../ICommandParams";
import constants from "../../utils/constants";

export function getEnableLocalFileCommand(tree: CICSTree, treeview: TreeView<any>) {
return commands.registerCommand("cics-extension-for-zowe.enableLocalFile", async (clickedNode) => {
Expand All @@ -35,13 +36,11 @@ export function getEnableLocalFileCommand(tree: CICSTree, treeview: TreeView<any
cancellable: true,
},
async (progress, token) => {
token.onCancellationRequested(() => {
console.log("Cancelling the Enable");
});
token.onCancellationRequested(() => { });
for (const index in allSelectedNodes) {
progress.report({
message: `Enabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`,
increment: (parseInt(index) / allSelectedNodes.length) * 100,
increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX,
});
const currentNode = allSelectedNodes[parseInt(index)];

Expand Down Expand Up @@ -115,5 +114,5 @@ async function enableLocalFile(session: imperative.AbstractSession, parms: IComm

const cmciResource = Utils.getResourceUri(CicsCmciConstants.CICS_CMCI_LOCAL_FILE, options);

return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, Utils, IGetResourceUriOptions } from "@zowe/cics-for-zowe-sdk";
import { imperative } from "@zowe/zowe-explorer-api";
import { commands, ProgressLocation, TreeView, window } from "vscode";
import { CICSCombinedProgramTree } from "../../trees/CICSCombinedTrees/CICSCombinedProgramTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { CICSRegionTree } from "../../trees/CICSRegionTree";
import { CICSTree } from "../../trees/CICSTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { CICSProgramTreeItem } from "../../trees/treeItems/CICSProgramTreeItem";
import { findSelectedNodes } from "../../utils/commandUtils";
import { CICSCombinedProgramTree } from "../../trees/CICSCombinedTrees/CICSCombinedProgramTree";
import { ICommandParams } from "../ICommandParams";
import constants from "../../utils/constants";

/**
* Performs enable on selected CICSProgram nodes.
Expand All @@ -40,13 +41,11 @@ export function getEnableProgramCommand(tree: CICSTree, treeview: TreeView<any>)
cancellable: true,
},
async (progress, token) => {
token.onCancellationRequested(() => {
console.log("Cancelling the Enable");
});
token.onCancellationRequested(() => { });
for (const index in allSelectedNodes) {
progress.report({
message: `Enabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`,
increment: (parseInt(index) / allSelectedNodes.length) * 100,
increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX,
});
const currentNode = allSelectedNodes[parseInt(index)];

Expand Down Expand Up @@ -119,5 +118,5 @@ async function enableProgram(session: imperative.AbstractSession, parms: IComman

const cmciResource = Utils.getResourceUri(CicsCmciConstants.CICS_PROGRAM_RESOURCE, options);

return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, Utils, IGetResourceUriOptions } from "@zowe/cics-for-zowe-sdk";
import { imperative } from "@zowe/zowe-explorer-api";
import { commands, ProgressLocation, TreeView, window } from "vscode";
import { CICSCombinedTransactionsTree } from "../../trees/CICSCombinedTrees/CICSCombinedTransactionTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { CICSRegionTree } from "../../trees/CICSRegionTree";
import { CICSTree } from "../../trees/CICSTree";
import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer";
import { findSelectedNodes } from "../../utils/commandUtils";
import { CICSTransactionTreeItem } from "../../trees/treeItems/CICSTransactionTreeItem";
import { CICSCombinedTransactionsTree } from "../../trees/CICSCombinedTrees/CICSCombinedTransactionTree";
import { ICommandParams } from "../ICommandParams";
import constants from "../../utils/constants";

export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView<any>) {
return commands.registerCommand("cics-extension-for-zowe.enableTransaction", async (clickedNode) => {
Expand All @@ -36,13 +37,11 @@ export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView<a
cancellable: true,
},
async (progress, token) => {
token.onCancellationRequested(() => {
console.log("Cancelling the Enable");
});
token.onCancellationRequested(() => { });
for (const index in allSelectedNodes) {
progress.report({
message: `Enabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`,
increment: (parseInt(index) / allSelectedNodes.length) * 100,
increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX,
});
const currentNode = allSelectedNodes[parseInt(index)];

Expand Down Expand Up @@ -115,5 +114,5 @@ async function enableTransaction(session: imperative.AbstractSession, parms: ICo

const cmciResource = Utils.getResourceUri(CicsCmciConstants.CICS_LOCAL_TRANSACTION, options);

return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
}
Loading

0 comments on commit 793ba73

Please sign in to comment.