Skip to main content

ActionScript Scan rules

 

Contrast Scan supports these rules for ActionScript.

Severity

Contrast rule

Engine rule ID

Description

Critical 

Avoid Declaring Vars Without Var 

OPT.ACTIONSCRIPT.EST_ACTIONSCRIPT.AvoidDeclaringVarsWithoutVar 

AvoidDeclaringVarsWithoutVar: Avoid declaring vars without reserve word VAR before 

Critical 

End Sentences With Semicolon 

OPT.ACTIONSCRIPT.EST_ACTIONSCRIPT.EndSentencesWithSemicolon 

EndSentencesWithSemicolon: Avoid sentences without semicolon at the end 

Critical 

Avoid Loop With Empty Body 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.AvoidLoopWithEmptyBody 

AvoidLoopWithEmptyBody: Avoid empty loops 

Critical 

Comp Life Cycle 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.CompLifeCycle 

CompLifeCycle: Avoid overriding certain methods 

Critical 

No Keywords As Identifiers 

OPT.ACTIONSCRIPT.NOM_ACTIONSCRIPT.NoKeywordsAsIdentifiers 

NoKeywordsAsIdentifiers: Do not use keywords as identifiers 

Critical 

Avoid Declaring Inside Loops 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.AvoidDeclaringInsideLoops 

AvoidDeclaringInsideLoops: Avoid declaring variables inside loops 

Critical 

Avoid Large Classes 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.AvoidLargeClasses 

AvoidLargeClasses: Avoid large classes 

Critical 

Avoid Large Constructors 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.AvoidLargeConstructors 

AvoidLargeConstructors: Avoid large constructors 

Critical 

Avoid Large Functions 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.AvoidLargeFunctions 

AvoidLargeFunctions: Avoid large functions 

Critical 

Avoid Many Conditionals 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.AvoidManyConditionals 

AvoidManyConditionals: Avoid many conditional sentences in the code 

Critical 

Avoid Mutiple Return 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.AvoidMutipleReturn 

AvoidMutipleReturn: Avoid multiple RETURN statements inside a function 

Critical 

Avoid Nested Loops 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.AvoidNestedLoops 

AvoidNestedLoops: Avoid using nested loops 

Critical 

Declaring Array 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.DeclaringArray 

DeclaringArray: Declaring Arrays using new array instead of [] 

Critical 

No Use Set Style 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.NoUseSetStyle 

NoUseSetStyle: Avoid 'setStyle()' method 

Critical 

Too Many Parameters In Function 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.TooManyParametersInFunction 

TooManyParametersInFunction: Too many parameters in a function 

Critical 

Type Everything 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.TypeEverything 

TypeEverything: Every var, function, parameter and constant must be declared along with a type 

High 

Use Space Betwen Operators 

OPT.ACTIONSCRIPT.EST_ACTIONSCRIPT.UseSpaceBetwenOperators 

UseSpaceBetwenOperators: Put a single space around operators 

High 

Avoid Assignamentin Condition 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.AvoidAssignamentinCondition 

AvoidAssignamentinCondition: Avoid a assignment operation in condition statements 

High 

Avoid Empty Functions 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.AvoidEmptyFunctions 

AvoidEmptyFunctions: Avoid declaring empty functions 

High 

Avoid For With External Control Vars 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.AvoidForWithExternalControlVars 

AvoidForWithExternalControlVars: Avoid using external variables to loop control in FOR statements 

High 

Avoid Unary Ops In Assign 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.AvoidUnaryOpsInAssign 

AvoidUnaryOpsInAssign: Avoid ternary operator in assignment statements (? : ) 

High 

Avoid Unused Function 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.AvoidUnusedFunction 

AvoidUnusedFunction: Avoid having declared unused functions 

High 

Avoid Unused Function Parameter 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.AvoidUnusedFunctionParameter 

AvoidUnusedFunctionParameter: Detect function parameter not used 

High 

Avoid Unused Local Var 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.AvoidUnusedLocalVar 

AvoidUnusedLocalVar: Detect local vars unused 

High 

If With Out Block 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.IfWithOutBlock 

IfWithOutBlock: Avoid using IF statements with empty body 

High 

No Update Loop In For Body 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.NoUpdateLoopInForBody 

NoUpdateLoopInForBody: Avoid to update control var inside FOR loop body 

High 

Unused Constant 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.UnusedConstant 

UnusedConstant: Avoid unused private constant declarations 

High 

Avoid Numbers As Control Var 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.AvoidNumbersAsControlVar 

AvoidNumbersAsControlVar: Avoid declaring control variables as Numbers 

High 

Avoid Popup Windows 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.AvoidPopupWindows 

AvoidPopupWindows: Use javascript to open pop-up windows 

Info 

Document Every Function 

OPT.ACTIONSCRIPT.DOC_ACTIONSCRIPT.DocumentEveryFunction 

DocumentEveryFunction: Provide comments for functions 

Low 

Code Document Percentage 

OPT.ACTIONSCRIPT.DOC_ACTIONSCRIPT.CodeDocumentPercentage 

CodeDocumentPercentage: Avoid files with a very low comment/code ratio 

Low 

Avoid Switch Many Cases 

OPT.ACTIONSCRIPT.GEN_ACTIONSCRIPT.AvoidSwitchManyCases 

AvoidSwitchManyCases: Avoid too many CASE clauses in SWITCH statement 

Medium 

Class Naming Pattern 

OPT.ACTIONSCRIPT.NOM_ACTIONSCRIPT.ClassNamingPattern 

ClassNamingPattern: Class names must comply with the convention 

Medium 

Constant Naming Pattern 

OPT.ACTIONSCRIPT.NOM_ACTIONSCRIPT.ConstantNamingPattern 

ConstantNamingPattern: Constant names must comply with the convention 

Medium 

Function Naming Pattern 

OPT.ACTIONSCRIPT.NOM_ACTIONSCRIPT.FunctionNamingPattern 

FunctionNamingPattern: Function names must comply with the convention 

Medium 

Interface Naming Pattern 

OPT.ACTIONSCRIPT.NOM_ACTIONSCRIPT.InterfaceNamingPattern 

InterfaceNamingPattern: Interface names must comply with the convention 

Medium 

Package Naming Pattern 

OPT.ACTIONSCRIPT.NOM_ACTIONSCRIPT.PackageNamingPattern 

PackageNamingPattern: Package names must comply with the convention 

Medium 

Variable Naming Pattern 

OPT.ACTIONSCRIPT.NOM_ACTIONSCRIPT.VariableNamingPattern 

VariableNamingPattern: Variable names must follow the conventions 

Medium 

Misuse Dynamic Filter 

OPT.ACTIONSCRIPT.PER_ACTIONSCRIPT.MisuseDynamicFilter 

MisuseDynamicFilter: Avoid declaring unused filters