Skip to content

[apex] New Rule: Avoid soql/sosl queries without a where clause or limit statement #635

@JAertgeerts

Description

@JAertgeerts

Rule Set: Apex, perfomance

Description:
When working with very large amounts of data, unfiltered SOQL queries can quickly cause governor limit exceptions

Code Sample demonstrating the issue:

public class Something {
	public static void main( String as[] ) {  
		Account[] accs = [ select id from account ];  //Bad
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:new-ruleProposal to add a new built-in rule

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions