facebook pixelCodiga Analysis Dart Rules, severity warning , category code style
BACK TO LIST

Dart rules

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.

ARGUMENT_TYPE_NOT_ASSIGNABLE

Code style
Warning

Invalid assignments

ASSET_DOES_NOT_EXIST

Code style
Warning

Asset does not exists

BODY_MIGHT_COMPLETE_NORMALLY

Code style
Warning

The body might complete normally

CAST_TO_NON_TYPE

Code style
Warning

The name isn't a type

CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE

Code style
Warning

Const variables must be initialized with a constant value.

CONST_WITH_NON_CONSTANT_ARGUMENT

Code style
Warning

Arguments of a constant creation must be constant expressions.

COULD_NOT_INFER

Code style
Warning

Cannot infer type

CREATION_WITH_NON_TYPE

Code style
Warning

The name 'BubbleStyle' isn't a class.\n

DEFAULT_LIST_CONSTRUCTOR

Code style
Warning

The default 'List' constructor isn't available when null safety is enabled.

EXPECTED_TOKEN

Code style
Warning

Expected to find '['.

EXTENDS_NON_CLASS

Code style
Warning

Classes can only extend other classes.

EXTRA_POSITIONAL_ARGUMENTS

Code style
Warning

Too many positional arguments.

GETTER_NOT_SUBTYPE_SETTER_TYPES

Code style
Warning

Invalid return type

IMPLEMENTS_NON_CLASS

Code style
Warning

Classes and mixins can only implement other classes and mixins.

INCLUDE_FILE_NOT_FOUND

Code style
Warning

Include file not found

INVALID_ASSIGNMENT

Code style
Warning

Invalid assignments

INVALID_CONSTANT

Code style
Warning

Invalid constant value

INVALID_OVERRIDE

Code style
Warning

Invalid override

LIST_ELEMENT_TYPE_NOT_ASSIGNABLE

Code style
Warning

List element type not assignable

MISSING_DEFAULT_VALUE_FOR_PARAMETER

Code style
Warning

Missing default value for parameter

MISSING_IDENTIFIER

Code style
Warning

Expected an identifier.

MISSING_REQUIRED_PARAM

Code style
Warning

Missing required parameters

MIXIN_OF_NON_CLASS

Code style
Warning

Classes can only mix in mixins and classes.

MIXIN_WITH_NON_CLASS_SUPERCLASS

Code style
Warning

Mixin can only be applied to class.

NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT

Code style
Warning

The class doesn't have a default constructor.

NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER

Code style
Warning

Missing concrete implementations of methods

NON_BOOL_CONDITION

Code style
Warning

Conditions must have a static type of 'bool'

NON_CONSTANT_CASE_EXPRESSION

Code style
Warning

Case expressions must be constant

NON_CONSTANT_DEFAULT_VALUE

Code style
Warning

The default value of an optional parameter must be constant

NON_CONSTANT_LIST_ELEMENT

Code style
Warning

The values in a const list literal must be constants

NON_CONSTANT_MAP_VALUE

Code style
Warning

The values in a const map literal must be constant

NON_TYPE_AS_TYPE_ARGUMENT

Code style
Warning

The name isn't a type so it can't be used as a type argument

NON_TYPE_IN_CATCH_CLAUSE

Code style
Warning

The name isn't a type and can't be used in an on-catch clause.

NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE

Code style
Warning

The non-nullable local variable must be assigned before it can be used.

NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD

Code style
Warning

Non-nullable instance field must be initialized.

NOT_INITIALIZED_NON_NULLABLE_VARIABLE

Code style
Warning

The non-nullable variable must be initialized.

POSITIONAL_AFTER_NAMED_ARGUMENT

Code style
Warning

Positional arguments must occur before named arguments.

RETURN_OF_INVALID_TYPE

Code style
Warning

Invalid return type

RETURN_OF_INVALID_TYPE_FROM_CLOSURE

Code style
Warning

Invalid return type from closure

TYPE_TEST_WITH_UNDEFINED_NAME

Code style
Warning

Undefined name

UNCHECKED_USE_OF_NULLABLE_VALUE

Code style
Warning

Method can't be unconditionally invoked because the receiver can be 'null'.

UNDEFINED_CONSTRUCTOR_IN_INITIALIZER

Code style
Warning

Undefined constructor

UNDEFINED_GETTER

Code style
Warning

Undefined getter

UNDEFINED_NAMED_PARAMETER

Code style
Warning

Named parameter undefined

UNDEFINED_SETTER

Code style
Warning

Undefined setter

UNDEFINED_SUPER_MEMBER

Code style
Warning

Undefined super member

UNNECESSARY_NON_NULL_ASSERTION

Code style
Warning

Uneccessary non null assertion

URI_HAS_NOT_BEEN_GENERATED

Code style
Warning

URI has not been generated

NO_LEADING_UNDERSCORES_FOR_LOCAL_IDENTIFIERS

Code style
Warning

Avoid leading underscores for local identifiers.

Learn more

CONSTANT_IDENTIFIER_NAMES

Code style
Warning

Prefer using lowerCamelCase for constant names.