Skip to content

Commit b9e8995

Browse files
committed
remove calculate coverage
1 parent accf01b commit b9e8995

File tree

6 files changed

+15
-34733
lines changed

6 files changed

+15
-34733
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@ Use our side bar or the **Command Palette** and type `Flow Scanner` to see the l
1515

1616
* `Configure Rules` Allows to define rules and expressions as per defined in the [core documentation](https://github.com/Flow-Scanner/lightning-flow-scanner-core).
1717
* `Scan Flows` allows choosing either a directory or a selection of flows to run the analysis against.
18-
* `Calc Coverage` calculates the test coverage of Flows in the default org.
1918
* `Fix Flows` will apply available fixes automatically.
2019
* `Open Documentation` can be used to reference the documentation.
2120

2221
## Configuration
2322

24-
| Key | Description | Default Value |
25-
| ----------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------- |
26-
| `flowscanner.SpecifyFiles` | Specify flow file paths instead of a root directory. | `false` |
27-
| `flowscanner.NamingConvention` | Specify a REGEX expression to use as Flow Naming convention. | `"[A-Za-z0-9]+_[A-Za-z0-9]+"` |
28-
| `flowscanner.APIVersion` | Specify an expression to validate the API version, i.e. '===50'(use at least 50). | `">50"` |
23+
| Key | Description | Default Value |
24+
| -------------------------------- | --------------------------------------------------------------------------------- | ----------------------------- |
25+
| `flowscanner.SpecifyFiles` | Specify flow file paths instead of a root directory. | `false` |
26+
| `flowscanner.NamingConvention` | Specify a REGEX expression to use as Flow Naming convention. | `[A-Za-z0-9]+_[A-Za-z0-9]+` |
27+
| `flowscanner.APIVersion` | Specify an expression to validate the API version, i.e. '===50'(use at least 50). | `>50` |
2928

3029
## Development
3130

package.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,16 @@
4343
"commands": [
4444
{
4545
"command": "flowscanner.openDocumentation",
46-
"title": "Open LFS Documentation"
46+
"title": "Flow Scanner Documentation"
4747
},
4848
{
4949
"command": "flowscanner.scanFlows",
5050
"title": "Scan Flows"
5151
},
52-
{
53-
"command": "flowscanner.debugger",
54-
"title": "Debug Flow Scanner"
55-
},
5652
{
5753
"command": "flowscanner.fixFlows",
5854
"title": "Fix Flows"
5955
},
60-
{
61-
"command": "flowscanner.calculateFlowTestCoverage",
62-
"title": "Calculate Flow Coverage"
63-
},
6456
{
6557
"command": "flowscanner.configRules",
6658
"title": "Configure Flow Rules"

src/commands/handlers.ts

Lines changed: 9 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import * as vscode from 'vscode';
2-
import { RuleOverview } from '../panels/RuleOverviewPanel';
32
import { SelectFlows } from '../libs/SelectFlows';
43
import { SaveFlow } from '../libs/SaveFlow';
54
import { ScanOverview } from '../panels/ScanOverviewPanel';
65
import * as core from 'lightning-flow-scanner-core';
76
import { findFlowCoverage } from '../libs/FindFlowCoverage';
87
import { CacheProvider } from '../providers/cache-provider';
9-
import { testdata } from '../store/testdata';
108
import { OutputChannel } from '../providers/outputChannel';
119
import { ConfigProvider } from '../providers/config-provider';
1210
import * as YAML from 'yaml';
@@ -21,10 +19,8 @@ export default class Commands {
2119
const rawHandlers: Record<string, (...args: any[]) => any> = {
2220
'flowscanner.openDocumentation': () => this.openDocumentation(),
2321
'flowscanner.configRules': () => this.configRules(),
24-
'flowscanner.debugger': () => this.debugView(),
2522
'flowscanner.scanFlows': () => this.scanFlows(),
2623
'flowscanner.fixFlows': () => this.fixFlows(),
27-
'flowscanner.calculateFlowTestCoverage': () => this.calculateFlowTestCoverage(),
2824
};
2925

3026
return Object.entries(rawHandlers).map(([command, handler]) => {
@@ -165,57 +161,15 @@ private async configRules() {
165161
OutputChannel.getInstance().logChannel.debug('Stored legacy rule config', ruleConfig);
166162
}
167163

168-
169-
private async ruleConfiguration() {
170-
const workspaceFolders = vscode.workspace.workspaceFolders;
171-
if (!workspaceFolders || workspaceFolders.length === 0) {
172-
vscode.window.showErrorMessage('No workspace folder found.');
173-
return;
174-
}
175-
176-
const workspacePath = workspaceFolders[0].uri.fsPath;
177-
const configProvider = new ConfigProvider();
178-
179-
try {
180-
const config = await configProvider.discover(workspacePath);
181-
const document = await vscode.workspace.openTextDocument(config.fspath);
182-
await vscode.window.showTextDocument(document);
183-
vscode.window.showInformationMessage(`Loaded configuration from ${config.fspath}`);
184-
} catch (err: any) {
185-
vscode.window.showErrorMessage(`Error loading configuration: ${err?.message || err}`);
186-
}
187-
}
188-
189-
190-
private async debugView() {
191-
let results = testdata as unknown as core.ScanResult[];
192-
await CacheProvider.instance.set('results', results);
193-
ScanOverview.createOrShow(this.context.extensionUri, results);
194-
await vscode.commands.executeCommand(
195-
'workbench.action.webview.openDeveloperTools'
196-
);
197-
}
198-
199-
private async calculateFlowTestCoverage() {
200-
const results = CacheProvider.instance.get('results');
201-
ScanOverview.createOrShow(this.context.extensionUri, []);
202-
if (results && results.length > 0) {
203-
const coverageMap = await findFlowCoverage(results);
204-
const newResults = [];
205-
for (let result of results) {
206-
let flowName = result.flow.name;
207-
const coverage = coverageMap.get(flowName);
208-
result['coverage'] = coverage;
209-
newResults.push(result);
210-
await CacheProvider.instance.set('results', newResults);
211-
ScanOverview.createOrShow(this.context.extensionUri, newResults);
212-
}
213-
} else {
214-
vscode.window.showInformationMessage(
215-
'No results found. Please make sure to complete a scan before calculating coverage.'
216-
);
217-
}
218-
}
164+
// debug view
165+
// private async debugView() {
166+
// let results = testdata as unknown as core.ScanResult[];
167+
// await CacheProvider.instance.set('results', results);
168+
// ScanOverview.createOrShow(this.context.extensionUri, results);
169+
// await vscode.commands.executeCommand(
170+
// 'workbench.action.webview.openDeveloperTools'
171+
// );
172+
// }
219173

220174
private async scanFlows() {
221175
const rootPath = vscode.workspace.workspaceFolders?.[0]?.uri;

src/services/message-service.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ export default class MessageService {
3131
vscode.commands.executeCommand('flowscanner.fixFlows');
3232
}
3333

34-
runTests(query: any) {
35-
vscode.commands.executeCommand(
36-
'flowscanner.calculateFlowTestCoverage'
37-
);
38-
}
39-
4034
configRules(query: any) {
4135
vscode.commands.executeCommand('flowscanner.configRules');
4236
}

0 commit comments

Comments
 (0)