-
Notifications
You must be signed in to change notification settings - Fork 3
/
analysis_options.yaml
120 lines (116 loc) · 3.63 KB
/
analysis_options.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
analyzer:
plugins:
- dart_code_metrics
linter:
# https://dart-lang.github.io/linter/lints/index.html.
rules:
# Errors
always_use_package_imports: true
avoid_slow_async_io: true
avoid_type_to_string: true
cancel_subscriptions: true
close_sinks: true
literal_only_boolean_expressions: true
no_adjacent_strings_in_list: true
test_types_in_equals: true
throw_in_finally: true
unnecessary_statements: true
# Styles
always_declare_return_types: true
always_put_control_body_on_new_line: true
always_put_required_named_parameters_first: true
always_specify_types: true
avoid_bool_literals_in_conditional_expressions: true
avoid_implementing_value_types: true
avoid_init_to_null: true
avoid_js_rounded_ints: true
avoid_redundant_argument_values: true
avoid_returning_this: true
avoid_setters_without_getters: true
avoid_unused_constructor_parameters: true
avoid_void_async: true
deprecated_consistency: true
directives_ordering: true
do_not_use_environment: true
eol_at_end_of_file: true
flutter_style_todos: true
join_return_with_assignment: true
leading_newlines_in_multiline_strings: true
no_runtimeType_toString: true
noop_primitive_operations: true
only_throw_errors: true
prefer_asserts_in_initializer_lists: true
prefer_constructors_over_static_methods: true
prefer_int_literals: true
prefer_single_quotes: true
sort_child_properties_last: true
tighten_type_of_initializing_formals: true
avoid_function_literals_in_foreach_calls: true
unawaited_futures: true
unnecessary_await_in_return: true
unnecessary_constructor_name: true
unnecessary_null_aware_assignments: true
unnecessary_null_checks: true # experimental
unnecessary_nullable_for_final_variable_declarations: true # experimental
unnecessary_parenthesis: true
unnecessary_raw_strings: true
use_if_null_to_convert_nulls_to_bools: true
use_is_even_rather_than_modulo: true
use_named_constants: true
use_raw_strings: true
use_string_buffers: true
constant_identifier_names: false
# https://stackoverflow.com/questions/53492705/does-using-const-in-the-widget-tree-improve-performance
prefer_const_constructors: true
prefer_const_declarations: true
prefer_const_literals_to_create_immutables: true
unnecessary_const: true
# https://dart.dev/guides/language/analysis-options
dart_code_metrics:
anti-patterns:
- long-method:
severity: warning
- long-parameter-list:
severity: warning
metrics:
cyclomatic-complexity: 20
maintainability-index: 50
maximum-nesting: 5
number-of-parameters: 4
number-of-methods: 15
source-lines-of-code: 80
lines-of-code: 100
halstead-volume: 150
weight-of-class: 0.33
technical-debt:
threshold: 1
todo-cost: 161
ignore-cost: 320
ignore-for-file-cost: 396
as-dynamic-cost: 322
deprecated-annotations-cost: 37
file-nullsafety-migration-cost: 41
unit-type: "Reais"
metrics-exclude:
- test/**
rules:
- avoid-unused-parameters
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- binary-expression-operand-order
- double-literal-format
- no-boolean-literal-compare
- no-empty-block
- no-equal-then-else
- no-object-declaration
- prefer-first
- prefer-last
# - avoid-dynamic
- avoid-collection-methods-with-unrelated-types
- prefer-async-await
- prefer-immediate-return
- prefer-trailing-comma
- prefer-match-file-name:
exclude:
- test/**
- lib/main.dart