SonarSource Rules
  • Products

    In-IDE

    Code Quality and Security in your IDE with SonarQube Ide

    IDE extension that lets you fix coding issues before they exist!

    Discover SonarQube for IDE

    SaaS

    Code Quality and Security in the cloud with SonarQube Cloud

    Setup is effortless and analysis is automatic for most languages

    Discover SonarQube Cloud

    Self-Hosted

    Code Quality and Security Self-Hosted with SonarQube Server

    Fast, accurate analysis; enterprise scalability

    Discover SonarQube Server
  • SecretsSecrets
  • ABAPABAP
  • AnsibleAnsible
  • ApexApex
  • AzureResourceManagerAzureResourceManager
  • CC
  • C#C#
  • C++C++
  • CloudFormationCloudFormation
  • COBOLCOBOL
  • CSSCSS
  • DartDart
  • DockerDocker
  • FlexFlex
  • GitHub ActionsGitHub Actions
  • GoGo
  • HTMLHTML
  • JavaJava
  • JavaScriptJavaScript
  • JSONJSON
  • JCLJCL
  • KotlinKotlin
  • KubernetesKubernetes
  • Objective CObjective C
  • PHPPHP
  • PL/IPL/I
  • PL/SQLPL/SQL
  • PythonPython
  • RPGRPG
  • RubyRuby
  • RustRust
  • ScalaScala
  • ShellShell
  • SwiftSwift
  • TerraformTerraform
  • TextText
  • TypeScriptTypeScript
  • T-SQLT-SQL
  • VB.NETVB.NET
  • VB6VB6
  • XMLXML
  • YAMLYAML
Flex

Flex static code analysis

Unique rules to find Bugs, Security Hotspots, and Code Smells in your FLEX code

  • All rules 76
  • Vulnerability5
  • Bug9
  • Security Hotspot1
  • Code Smell61
 
Tags
    Impact
      Clean code attribute
        1. "default" clauses should be first or last

           Code Smell
        2. Delivering code in production with debug features activated is security-sensitive

           Security Hotspot
        3. All branches in a conditional structure should not have exactly the same implementation

           Bug
        4. Flex parser failure

           Code Smell
        5. "MovieClip.onEnterFrame" event handler should not be used

           Code Smell
        6. Objects should not be instantiated inside a loop

           Code Smell
        7. The "trace" function should not be used

           Vulnerability
        8. Cases in a "switch" should not have the same condition

           Bug
        9. Two branches in a conditional structure should not have exactly the same implementation

           Code Smell
        10. "switch" statements should not be nested

           Code Smell
        11. Classes should not have too many fields

           Code Smell
        12. Method visibility should be explicitly declared

           Bug
        13. Cyclomatic Complexity of functions should not be too high

           Code Smell
        14. Unused local variables should be removed

           Code Smell
        15. Classes that extend "Event" should override "Event.clone()"

           Bug
        16. The element type of an array field should be specified

           Code Smell
        17. Security.allowDomain(...) should only be used in a tightly focused manner

           Vulnerability
        18. Constructors should not dispatch events

           Bug
        19. The flash.system.Security.exactSettings property should never be set to false

           Vulnerability
        20. "LocalConnection" should be configured to narrowly specify the domains with which local connections to other Flex application are allowed

           Vulnerability
        21. "ManagedEvents" tags should have companion "Event" tags

           Bug
        22. Event types should be defined in metadata tags

           Code Smell
        23. Event names should not be hardcoded in event listeners

           Code Smell
        24. Package definition should be separate from Class definition

           Code Smell
        25. Multiple "++" or "--" unary operators should not be used in a single arithmetic expression

           Bug
        26. Track lack of copyright and license headers

           Code Smell
        27. Classes should not have too many methods

           Code Smell
        28. Constructor bodies should be as lightweight as possible

           Code Smell
        29. Dynamic classes should not be used

           Code Smell
        30. Constructors should not have a "void" return type

           Code Smell
        31. "public static" fields should be constant

           Code Smell
        32. "Alert.show(...)" should not be used

           Vulnerability
        33. "===" and "!==" should be used instead of "==" and "!="

           Code Smell
        34. Only "while", "do" and "for" statements should be labelled

           Code Smell
        35. Statements should end with semicolons

           Code Smell
        36. The special "star" type should not be used

           Code Smell
        37. Variables of the "Object" type should not be used

           Code Smell
        38. Track breaches of an XPath rule

           Code Smell
        39. Functions should not have too many lines of code

           Code Smell
        40. Control flow statements "if", "for", "while" and "switch" should not be nested too deeply

           Code Smell
        41. "with" statements should not be used

           Bug
        42. Statements, operators and keywords specific to ActionScript 2 should not be used

           Code Smell
        43. Octal values should not be used

           Code Smell
        44. Loggers should be "private static const" and should share naming convention

           Code Smell
        45. Cyclomatic Complexity of classes should not be too high

           Code Smell
        46. "switch" statements should have "default" clauses

           Code Smell
        47. "switch" statements should have at least 3 "case" clauses

           Code Smell
        48. Switch cases should end with an unconditional "break" statement

           Code Smell
        49. "for" loop stop conditions should be invariant

           Code Smell
        50. Sections of code should not be commented out

           Code Smell
        51. Track comments matching a regular expression

           Code Smell
        52. Statements should be on separate lines

           Code Smell
        53. Package names should comply with a naming convention

           Code Smell
        54. Methods should not be empty

           Code Smell
        55. Overriding methods should do more than simply call the same method in the super class

           Code Smell
        56. Public classes, methods, properties and metadata should be documented with ASDoc

           Code Smell
        57. Unused function parameters should be removed

           Code Smell
        58. Public constants and fields initialized at declaration should be "const static" rather than merely "const"

           Code Smell
        59. Local variable and function parameter names should comply with a naming convention

           Code Smell
        60. Field names should comply with a naming convention

           Code Smell
        61. "switch case" clauses should not have too many lines of code

           Code Smell
        62. Constant names should comply with a naming convention

           Code Smell
        63. Useless "if(true) {...}" and "if(false){...}" blocks should be removed

           Bug
        64. Unused "private" functions should be removed

           Code Smell
        65. Functions should not contain too many return statements

           Code Smell
        66. Boolean literals should not be redundant

           Code Smell
        67. Local variables should not shadow class fields

           Code Smell
        68. Empty statements should be removed

           Code Smell
        69. Nested blocks of code should not be left empty

           Code Smell
        70. Functions should not have too many parameters

           Code Smell
        71. Unused "private" fields should be removed

           Code Smell
        72. Mergeable "if" statements should be combined

           Code Smell
        73. Lines should not be too long

           Code Smell
        74. Class names should comply with a naming convention

           Code Smell
        75. A function should have a single point of exit at the end of the function

           Code Smell
        76. Function names should comply with a naming convention

           Code Smell

        Functions should not have too many parameters

        adaptability - focused
        maintainability
        Code Smell

          This rule is deprecated, and will eventually be removed.

          Why is this an issue?

          Functions with a long parameter list are difficult to use because maintainers must figure out the role of each parameter and keep track of their position.

          function setCoordinates(var x1, var y1, var z1, var x2, var y2, var z2) { // Noncompliant
              // ...
          }
          

          The solution can be to:

          • Split the function into smaller ones
          // Each function does a part of what the original setCoordinates function was doing, so confusion risks are lower
          void setOrigin(var x, var y, var z) {
             // ...
          }
          
          void setSize(var width, var height, var depth) {
             // ...
          }
          
          • Find a better data structure for the parameters that group data in a way that makes sense for the specific application domain
          struct Point { // In geometry, Point is a logical structure to group data
              var x;
              var y;
              var z;
          };
          
          function setCoordinates(var p1, var p2) {
              // ...
          }
          

          This rule raises an issue when a function has more parameters than the provided threshold.

            Available In:
          • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories
          • SonarQube Community BuildAnalyze code in your
            on-premise CI
            Available Since
            9.1
          • SonarQube ServerAnalyze code in your
            on-premise CI
            Developer Edition
            Available Since
            9.1

          © 2008-2025 SonarSource SA. All rights reserved.

          Privacy Policy | Cookie Policy | Terms of Use