-
Notifications
You must be signed in to change notification settings - Fork 0
/
analysis_options.yaml
60 lines (55 loc) · 1.58 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
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
rules:
analyzer:
plugins:
- dart_code_metrics
dart_code_metrics:
anti-patterns:
- long-method:
severity: warning
exclude:
- test/**
- long-parameter-list:
severity: warning
metrics:
cyclomatic-complexity: 20
number-of-arguments: 4
maximum-nesting-level: 5
lines-of-code: 100
source-lines-of-code: 50
maintainability-index: 50
number-of-methods: 10
number-of-parameters: 4
weight-of-class: 0.33
# technical-debt is optional
metrics-exclude:
- test/**
rules:
#for dart
- avoid-global-state
- avoid-missing-enum-constant-in-map
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- binary-expression-operand-order
- double-literal-format
- no-boolean-literal-compare
- no-empty-block
- no-object-declaration:
exclude:
- test/**
- prefer-conditional-expressions #optional
- prefer-trailing-comma:
exclude:
- test/**
#for flutter
- always-remove-listener
- avoid-unnecessary-setstate