always_specify_types
Always specify types
Codiga provides multiple sets of rules for 12+ languages. Below we provide a link and a description for all the rules supported by our platform. Note that not all the rules are being listed and described below.
Always specify types
Avoid bool literals in condition
Avoid defining a class that contains only static members.
Avoid escaping inner quotes by converting surrounding quotes.
Avoid using `forEach` with a function literal.
Don't explicitly initialize variables to null.
Avoid positional boolean parameters.
Avoid redundant argument values.
Avoid return types on setters.
Avoid unnecessary containers.
Avoid async functions that return void.
Avoid using web-only libraries outside Flutter web plugin packages.
await' should only apply to futures
Name types using UpperCamelCase.
Don't cast a nullable value to a non nullable type.
Close instances of `dart.core.Sink`.\n
Dead code.
Dead code on catch subtype.
The left operand can't be null.
Depend on referenced packages.
Member is deprecated and shouldn't be used. This property is no longer used
Import ordering
Duplicate import.
Avoid empty catch blocks.
Use `;` instead of `{}` for empty constructor bodies.
Detect empty statements (dead code)
Put a single newline at end of file.
Name source files using `lowercase\_with\_underscores`.
Override `hashCode` if overriding `==`
Don't import implementation files from another package.
Legacy library
Invalid annotation target
The receiver can't be null because of short-circuiting
Invalid use of protected members
Conditions should not unconditionally evaluate to `true` or to `false`.
Join return statement with assignment when possible.
Use `lowercase\_with\_underscores` when specifying a library prefix.
Missing case clause for 'null'.
Missing return value
Must be immutable
This method overrides a method annotated as '@mustCallSuper' in 'State'
Name non-constant identifiers using lowerCamelCase
Noop primitive operations.
A potentially nullable type can't be used in an 'on' clause because it isn't valid to throw a nullable expression.
Don't override fields.
The field doesn't override an inherited getter or setter.
Prefer const with constant constructors.
Prefer declaring const constructors on `@immutable` classes
Prefer const literals as parameters of constructors on @immutable classes.
Prefer final in for-each loop variable if reference is not reassigned.
Prefer if elements to conditional expressions where possible.
Prefer using if null operators.
Use initializing formals when possible.
Use interpolation to compose strings and values.
Use isEmpty instead of length\n
Use `isNotEmpty` for Iterables and Maps.
Prefer null aware method calls.
Prefer typing uninitialized variables and fields.
Missing a required trailing comma.
SizedBox for whitespace.
Sort pub dependencies.
Avoid using braces in interpolation when not needed.
Unnecessary cast.
Unnecessary new keyword.
Unnecessary null checks
The operand can't be null
Unnecessary parenthesis
Avoid using unnecessary statements
Unnecessary string interpolation
Unused catch clause
Stack trace not used
Unused element
Unused fiel
Unused import
Unused label
Unused local variable
Use build context synchronuously
Use late for private members with non-nullable type.
Use named constants
Use string buffers to compose strings
Directives must appear before any declarations.
Use Flutter TODO format.
Avoid leading underscores for library prefixes.
The name of a factory constructor must be the same as the name of the immediately enclosing class.
We use cookies to improve your site experience, including analytics cookies to understand how you use our product and design better experiences. Please read our Cookie Policy.