ALWAYS_DECLARE_RETURN_TYPES
Method should have return type
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.
Method should have return type
Always specify types
Invalid assignments
Asset does not exists
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 `print` calls in production code.
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
The body might complete normally
Name types using UpperCamelCase.
Don't cast a nullable value to a non nullable type.
The name isn't a type
Close instances of `dart.core.Sink`.\n
Const variables must be initialized with a constant value.
Arguments of a constant creation must be constant expressions.
Cannot infer type
The name 'BubbleStyle' isn't a class.\n
Dead code.
Dead code on catch subtype.
The left operand can't be null.
The default 'List' constructor isn't available when null safety is enabled.
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.
Expected to find '['.
Classes can only extend other classes.
Too many positional arguments.
Name source files using `lowercase\_with\_underscores`.
Invalid return type
Override `hashCode` if overriding `==`
Illegal assignment to non-assignable expression.
Don't import implementation files from another package.
Classes and mixins can only implement other classes and mixins.
Legacy library
Include file not found
Invalid annotation target
Invalid assignments
Invalid constant value
The receiver can't be null because of short-circuiting
Invalid override
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.
List element type not assignable
Missing selector
Missing default value for parameter
Missing case clause for 'null'.
Expected an identifier.
Missing required argument
Missing required parameters
Missing return value
Classes can only mix in mixins and classes.
Mixin can only be applied to class.
Must be immutable
This method overrides a method annotated as '@mustCallSuper' in 'State'
The class doesn't have a default constructor.
No default super constructor
Missing concrete implementations of methods
Conditions must have a static type of 'bool'
Case expressions must be constant
The default value of an optional parameter must be constant
Name non-constant identifiers using lowerCamelCase
The values in a const list literal must be constants
The values in a const map literal must be constant
The name isn't a type so it can't be used as a type argument
The name isn't a type and can't be used in an on-catch clause.
Noop primitive operations.
The non-nullable local variable must be assigned before it can be used.
Non-nullable instance field must be initialized.
The non-nullable variable must be initialized.
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.
Positional arguments must occur before named arguments.
Prefer const with constant constructors.
Prefer declaring const constructors on `@immutable` classes
Prefer const over final for declarations
Prefer const literals as parameters of constructors on @immutable classes.
Prefer final in for-each loop variable if reference is not reassigned.
Prefer final for variable declarations if they are 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.
Name isn't a type and can't be used in a redirected constructor.
Missing a required trailing comma.
Invalid return type
Invalid return type from closure
SizedBox for whitespace.
Sort child properties last in widget instance creations.
Sort pub dependencies.
Type annotate public APIs.
Type arguments do not match bounds
Undefined name
Method can't be unconditionally invoked because the receiver can be 'null'.
Undefined constructor
Undefined getter
Named parameter undefined
Undefined operator
Undefined setter
Undefined super member
Avoid using braces in interpolation when not needed.
Unnecessary cast.
Unnecessary new keyword.
Uneccessary non null assertion
Unnecessary null checks
The operand can't be null
Unnecessary parenthesis
Avoid using unnecessary statements
Unnecessary string interpolation
Unecessary this
The '===' operator is not supported
Unused catch clause
Stack trace not used
Unused element
Unused fiel
Unused import
Unused label
Unused local variable
URI has not been generated
Use build context synchronuously
Use late for private members with non-nullable type.
Use named constants
Use of void results
Use string buffers to compose strings
Avoid relative imports.
Annotate overridden members.
Avoid method calls or property accesses on a "dynamic" target
Avoid returning null for void
Avoid returning null for void
Type mismatch in constructor parameter
Eval throws exception.
Start multiline strings with a newline.
Unnecessary import
Incorrect number of arguments passed to function call
Unnecessary type check
The analyzer produces this diagnostic when a method or function can implicitly return null by falling off the end. While this is valid Dart code, it’s better for the return of null to be explicit.
The dev dependency is unnecessary because there is also a normal dependency on that package.
Function/method shouldn’t be called with a null argument for the non-nullable type argument.
The ‘?’ is unnecessary because the value is nullable without it.
The argument was already specified.
Avoid leading underscores for local identifiers.
Field could be final.
Prefer generic function type aliases.
Type mismatch in assignment
Don't implement classes that override `==`.
Avoid setters without getters.
Prefer using lowerCamelCase for constant names.
Don't override a method to do a super method invocation with the same parameters.
Name already defined.
Directives must appear before any declarations.
The library already contains a part.
Too many positional arguments.
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.
The language version override must be specified before any declaration or directive.
Static method can't be accessed through an instance.
Invalid return type value
Using library private types in public APIs
Equality operator `==` invocation with references of unrelated types
Use key in widget constructors.
Don't use the Null type, unless you are positive that you don't want void.
Diagnostic doesn't need to be ignored here because it's already being ignored
The asset directory doesn't exist.
The constructor being called isn't a const constructor.
Mentioned type is not a type
Type given must be a valid native function type
The type arguments to must be known at compile time, so they can’t be type parameters
Type can’t be used as a superclass constraint.