facebook pixelAPEX Static Code Analysis Rules
BACK TO LIST

Apex rules

All the static analysis rules you need for the Salesforce APEX language. Use Codiga to analyze your code and automate your code reviews for APEX.

ApexCRUDViolation

Security
Medium

Validate CRUD permission before SOQL/DML operation

Learn more

ApexDoc

Documentation
Medium

Unexpected doc

ApexInsecureEndpoint

Security
Medium

Apex callouts should use encrypted communication channels

ApexSharingViolations

Security
Medium

Apex classes should declare a sharing model if DML or SOQL is used

ApexSOQLInjection

Security
Medium

Apex classes should escape variables merged in DML query

ApexSuggestUsingNamedCred

Security
Medium

Consider using named credentials for authenticated callouts

ApexUnitTestClassShouldHaveAsserts

Best practice
Medium

Apex unit test classes should have at least one System.assert() or assertEquals() or AssertNotEquals() call

AvoidDeeplyNestedIfStmts

Design
Medium

Deeply nested if..else statements are hard to read

AvoidGlobalModifier

Best practice
Medium

Avoid using global modifier

AvoidHardcodingId

Error prone
Medium

Avoid hardcoding IDs

AvoidLogicInTrigger

Best practice
Medium

Avoid logic in triggers

ClassNamingConventions

Code style
Medium

Class names should begin with an uppercase character

CyclomaticComplexity

Design
Medium

Cyclomatic complexity too high

DebugsShouldUseLoggingLevel

Best practice
Medium

Calls to System.debug should specify a logging level.

EmptyCatchBlock

Error prone
Medium

Avoid empty catch blocks

EmptyIfStmt

Error prone
Medium

Avoid empty if statements

EmptyStatementBlock

Error prone
Medium

Avoid empty block statements.

ExcessiveParameterList

Design
Medium

Avoid long parameter lists

ExcessivePublicCount

Design
Medium

This class has too many public methods and attributes

FieldNamingConventions

Code style
Medium

Check name conventions

FormalParameterNamingConventions

Code style
Medium

Check name conventions for formal parameters

IfElseStmtsMustUseBraces

Code style
Medium

Avoid using if...else statements without curly braces

IfStmtsMustUseBraces

Code style
Medium

Avoid using if statements without curly braces

LocalVariableNamingConventions

Code style
Medium

Check local variable names conventions

MethodNamingConventions

Code style
Medium

Method name does not begin with a lower case character.

NcssMethodCount

Design
Medium

Too many lines of code in a method

OneDeclarationPerLine

Code style
Medium

Use one statement for each line

OperationWithLimitsInLoop

Performance
Medium

Avoid operations in loops that may hit governor limits

PropertyNamingConventions

Code style
Medium

Ensure property name conventions

StdCyclomaticComplexity

Design
Medium

Check cyclomatic complexity

TooManyFields

Design
Medium

Too many fields

NcssConstructorCount

Best practice
Medium

The constructor has a high NCSS line count

NcssTypeCount

Best practice
Medium

The type has a high NCSS line count

MethodWithSameNameAsEnclosingClass

Error prone
Medium

Non-constructor methods should not have the same name as the enclosing class.

ApexUnitTestShouldNotUseSeeAllDataTrue

Best practice
Medium

Apex unit tests should not use @isTest(seeAllData=true) because it opens up the existing database data for unexpected modification by tests.

ApexDangerousMethods

Security
Critical

Calling potentially dangerous method

ApexOpenRedirect

Security
High

Apex classes should safely redirect to a known location

ApexXSSFromURLParam

Best practice
High

Apex classes should escape Strings obtained from URL parameters

ForLoopsMustUseBraces

Code style
Minor

Avoid using for statements without curly braces

EmptyTryOrFinallyBlock

Design
Medium

Avoid empty try or finally blocks

SUBTYPE_OF_SEALED_CLASS

Design
Medium

Class shouldn't be extended, mixed in, or implemented because it's sealed.

WhileLoopsMustUseBraces

Code style
Minor

Avoid using while statements without curly braces.

CKV_AWS_63

Security
Medium

Ensure no IAM policies documents allow "*" as a statement's actions

CKV_AZURE_14

Security
Medium

Ensure web app redirects all HTTP traffic to HTTPS in Azure App Service