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
Dart

Dart static code analysis

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

  • All rules 126
  • Vulnerability4
  • Bug15
  • Security Hotspot8
  • Code Smell99
Filtered: 13 rules found
convention
    Impact
      Clean code attribute
        1. "child" properties should be placed last in widget instantiation

           Code Smell
        2. "part of" directives should be used with strings

           Code Smell
        3. Triple slash should be used for documentation comments

           Code Smell
        4. Adjacent string concatenation should be preferred

           Code Smell
        5. Non-constant names should comply with a naming convention

           Code Smell
        6. Function declarations should be preferred over variables

           Code Smell
        7. Extension identifiers should comply with a naming convention

           Code Smell
        8. Local identifiers should not start with underscore

           Code Smell
        9. File names should comply with a naming convention

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

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

           Code Smell
        12. Files should end with a newline

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

           Code Smell

        Non-constant names should comply with a naming convention

        consistency - identifiable
        maintainability
        Code Smell
        • convention

        Non-constant identifiers should be in lowerCamelCase.

        Why is this an issue?

        How can I fix it?

        More Info

        A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.

        The goal of a naming convention is to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.

        Dart recommends using lowerCamelCase for all non-constant identifiers:

        • members of classes and mixins, such as constructors, methods, fields and properties
        • top-level functions and variables
        • parameters of functions and methods

        This means that the first letter of the identifier is lowercase, and the first letter of each subsequent word is capitalized, using no separators such as _.

        The rule doesn’t check enum values. Those are implicitly defined as constants, but treated separately

        What is the potential impact?

        Using the wrong casing can lead to confusion and wrong assumptions about the code. For example naming a top-level function in Pascal Case may mislead the reader to think it’s a type, like a class or a mixin.

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

        © 2008-2025 SonarSource SA. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use