Skip to content

Commit ed1acd6

Browse files
committed
Improved documentations on generated graphs
1 parent 3f1a283 commit ed1acd6

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
Code metrics analyzer for Swift projects.
77

88
| ![Example code distribution](https://raw.githubusercontent.com/matsoftware/swift-code-metrics/master/docs/assets/code_distribution.jpeg) ![Example deviation main sequence](https://raw.githubusercontent.com/matsoftware/swift-code-metrics/master/docs/assets/example_deviation_main_sequence.jpeg) |
9-
|--------------------------------------------------------------------------------------------------------------------------------------------------------|
10-
| ![Example internal distribution](https://raw.githubusercontent.com/matsoftware/swift-code-metrics/master/docs/assets/example_internal_deps_graph.jpeg) |
9+
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
10+
| ![Example internal distribution](https://raw.githubusercontent.com/matsoftware/swift-code-metrics/master/docs/assets/example_internal_deps_graph.jpeg) |
1111

1212
## Introduction
1313

docs/GUIDE.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,22 @@ In addition:
117117

118118
The `--generate-graphs` option will output the following reports:
119119

120-
| Components coupling |
121-
|:----------------------------------------------------------------------------:|
122-
| ![Dependency graph](assets/dependencies_graph.jpeg) |
123-
| Dependency graph, with number of imports of _destination_ from _origin_ . |
124-
| ![Distance from main sequence](assets/deviation_from_the_main_sequence.jpeg) |
125-
| Distance of a library from the ideal domain. |
120+
### Components coupling
121+
122+
![Dependency graph](assets/example_internal_deps_graph.jpeg)
123+
124+
Dependency graph, with number of imports of _destination_ from _origin_.
125+
The framework width and border size are directly proportional to the framework's LOC percentage compared to the total LOC. The thickness of the connection arrow between two frameworks is directly proportional to the percentage of imports call compared to the total number of imports.
126+
127+
![Distance from main sequence](assets/example_deviation_main_sequence.jpeg)
128+
129+
It express the components coupling in terms of stability and abstraction.
130+
131+
Ideally, components should be close to the ideal domain (in green) and the most distant areas are identified as _zones of pain_ (in red).
132+
A framework with I < 0.5 and A < 0.5 indicates a library that's rigid to change, usually a foundation component. Instead, with I > 0.5 and A > 0.5, it's possible to identify components with few dependents that's easy to change, usually representing a container of leftovers or elements still being fully developed.
133+
134+
For a more detailed description, please refer to the _Clean Architecture, Robert C. Martin_ book, Chapter 14 _Component Coupling_.
135+
126136

127137
| Code distribution |
128138
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
-15.1 KB
Binary file not shown.
-26.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)