Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit a6e4dfd

Browse files
authored
refactor: cleanup anti-patterns documentation (#548)
1 parent b3d2806 commit a6e4dfd

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Unreleased
44

55
* feat: introduce file metrics
6-
* refactor: cleanup metric documentation
6+
* refactor: cleanup anti-patterns, metrics documentation
77

88
## 4.6.0
99

lib/src/analyzers/lint_analyzer/anti_patterns/anti_patterns_list/long_method.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ class LongMethod extends Pattern {
3939
id: patternId,
4040
documentation: const PatternDocumentation(
4141
name: 'Long Method',
42-
brief:
43-
'Long blocks of code are difficult to reuse and understand because they are usually responsible for more than one thing. Separating those to several short ones with proper names helps you reuse your code and understand it better without reading methods body.',
4442
supportedType: EntityType.methodEntity,
4543
),
4644
severity: readSeverity(patternSettings, Severity.none),

lib/src/analyzers/lint_analyzer/anti_patterns/anti_patterns_list/long_parameter_list.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ class LongParameterList extends Pattern {
3737
id: patternId,
3838
documentation: const PatternDocumentation(
3939
name: 'Long Parameter List',
40-
brief:
41-
'Long parameter lists are difficult to understand and use. Wrapping them into an object allows grouping parameters and change transferred data only by the object modification.',
4240
supportedType: EntityType.methodEntity,
4341
),
4442
severity: readSeverity(patternSettings, Severity.none),

lib/src/analyzers/lint_analyzer/anti_patterns/models/pattern_documentation.dart

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,11 @@ class PatternDocumentation {
88
/// The name of the pattern
99
final String name;
1010

11-
/// The short message with formal statement about the pattern
12-
final String brief;
13-
1411
/// The type of entities which will be analyzed by the pattern.
1512
final EntityType supportedType;
1613

1714
/// Initialize a newly created [PatternDocumentation].
1815
///
1916
/// This data object is used for a documentation generating from a source code.
20-
const PatternDocumentation({
21-
required this.name,
22-
required this.brief,
23-
required this.supportedType,
24-
});
17+
const PatternDocumentation({required this.name, required this.supportedType});
2518
}

website/docs/anti-patterns/overview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ Anti-patterns configuration is [described here](../getting-started/configuration
1010
Available anti-patterns:
1111

1212
- [Long Method](./long-method.md)
13+
14+
Long blocks of code are difficult to reuse and understand because they are usually responsible for more than one thing.
15+
1316
- [Long Parameter List](./long-parameter-list.md)
17+
18+
Long parameter lists are difficult to understand and use.

website/docs/metrics/overview.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,39 @@ Metrics configuration is [described here](../getting-started/configuration#confi
1212
## Function specific metrics {#function-specific-metrics}
1313

1414
- [Cyclomatic Complexity](./cyclomatic-complexity.md)
15+
1516
The number of linearly-independent paths through a method.
1617

1718
- [Halstead Volume](./halstead-volume.md)
19+
1820
The method size, based on the numbers of operators and operands.
1921

2022
- [Lines of Code](./lines-of-code.md)
23+
2124
The number of physical lines of code of a method, including blank lines and comments.
2225

2326
- [Maintainability Index](./maintainability-index.md)
27+
2428
The indicator which mean how maintainable the source code is.
2529

2630
- [Maximum Nesting](./maximum-nesting-level.md)
31+
2732
The maximum nesting level of control structures within a method.
2833

2934
- [Number of Parameters](./number-of-parameters.md)
35+
3036
The number of parameters received by a method.
3137

3238
- [Source lines of Code](./source-lines-of-code.md)
39+
3340
The approximate number of source code lines in a method, blank lines and comments are not counted.
3441

3542
## Class specific metrics {#class-specific-metrics}
3643

3744
- [Number of Methods](./number-of-methods.md)
45+
3846
The number of methods of a class.
3947

4048
- [Weight of a Class](./weight-of-class.md)
49+
4150
The number of "functional" public methods divided by the total number of public members.

0 commit comments

Comments
 (0)