Skip to content

Conversation

@SamarthAroraa
Copy link
Contributor

@SamarthAroraa SamarthAroraa commented Jan 19, 2026

@W-20397770@

What does this PR do?

What issues does this PR fix or reference?

SamarthAroraa and others added 25 commits November 20, 2025 16:11
- Implemented AST-based detector for SOQL queries lacking WHERE or LIMIT clauses
- Added SOQLAstUtils for robust query extraction and analysis
- Created comprehensive fix instructions with severity levels and code examples
- Registered new detector in scan-apex-antipatterns-tool
…tern

- Add unit tests for SOQLAstUtils (soql-ast-utils.test.ts)
- Add unit tests for SOQLNoWhereLimitDetector (soql-no-where-limit-detector.test.ts)
- Add unit tests for SOQLNoWhereLimitRecommender (soql-no-where-limit-recommender.test.ts)
- Cover edge cases: multi-line queries, nested subqueries, SOQL in loops, comments, complex WHERE clauses
- ast-analyzer.ts was not used anywhere in the codebase
- All AST operations are handled directly by @apexdevtools/apex-parser
- Reduces unnecessary code complexity
@SamarthAroraa SamarthAroraa requested a review from a team as a code owner January 19, 2026 06:19
@SamarthAroraa SamarthAroraa changed the title @W-20397770 [Do not merge - WIP] Enriching scan apex class for antipatterns tool with runtime based criticality insights @W-20397770 Enriching scan apex class for antipatterns tool with runtime based criticality insights Jan 19, 2026
return null;
}

const connection = await orgService.getConnection(defaultOrg.value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried this with local vs global default target orgs? I have found that different MCP Clients will start the MCP Server node process in different locations. It is not necessarily the route of your IDE Workspace. So if you have a global Default Target Org AND a local Default Target Org the Tool might connect to the incorrect one.

In our Tools, we use a directory parameter to change the directory of the process before executing the "get the org" logic. Here is a simple example https://github.com/salesforcecli/mcp/blob/main/packages/mcp-provider-dx-core/src/tools/run_soql_query.ts#L84

We probably want to allow the user to pass in the usernameOrAlias input as well to be consistent to the rest of the MCP tooling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants