@@ -35,121 +35,9 @@ The syntax is:
3535- ` --tests-paths ` (default: ` Test Tests ` ) space separated list of path substrings matching test classes
3636- ` --generate-graphs ` (optional) if passed, it will generate the graphs related to the analysis and save them in the artifacts folder
3737
38- ### Output format
39-
40- The ` output.json ` file will contain the metrics related to all frameworks
41- and an _ aggregate_ result for the project.
42-
43- The example below is available [ here] ( tests/test_resources/expected_output.json ) .
44-
45- ``` json
46- {
47- "non-test-frameworks" : [
48- {
49- "BusinessLogic" : {
50- "loc" : 49 ,
51- "noc" : 7 ,
52- "poc" : 12.5 ,
53- "n_a" : 0 ,
54- "n_c" : 3 ,
55- "nbm" : 3 ,
56- "analysis" : " The code is under commented. Low abstract component, few interfaces. " ,
57- "not" : 0 ,
58- "fan_in" : 1 ,
59- "fan_out" : 2 ,
60- "i" : 0.667 ,
61- "a" : 0.0 ,
62- "d_3" : 0.333
63- }
64- },
65-
66- ...
67-
68- ],
69- "tests-frameworks" : [
70- {
71- "BusinessLogic_Test" : {
72- "loc" : 7 ,
73- "noc" : 7 ,
74- "poc" : 50.0 ,
75- "n_a" : 0 ,
76- "n_c" : 1 ,
77- "nbm" : 1 ,
78- "analysis" : " The code is over commented. " ,
79- "not" : 1
80- }
81- },
82-
83- ...
84-
85-
86- ],
87- "aggregate" : {
88- "non-test-frameworks" : {
89- "loc" : 97 ,
90- "noc" : 35 ,
91- "n_a" : 1 ,
92- "n_c" : 7 ,
93- "nbm" : 10 ,
94- "not" : 0 ,
95- "poc" : 26.515
96- },
97- "tests-frameworks" : {
98- "loc" : 53 ,
99- "noc" : 28 ,
100- "n_a" : 0 ,
101- "n_c" : 4 ,
102- "nbm" : 7 ,
103- "not" : 5 ,
104- "poc" : 34.568
105- },
106- "total" : {
107- "loc" : 150 ,
108- "noc" : 63 ,
109- "n_a" : 1 ,
110- "n_c" : 11 ,
111- "nbm" : 17 ,
112- "not" : 5 ,
113- "poc" : 29.577
114- }
115- }
116- }
117- ```
118-
119- Legend:
120-
121- | Key | Metric | Description |
122- | :---------:| :--------------------------------:| :---------------------------------------------------------------------------------------------------:|
123- | ` loc ` | Lines Of Code | Number of lines of code (empty lines excluded) |
124- | ` noc ` | Number of Comments | Number of comments |
125- | ` poc ` | Percentage of Comments | 100 * noc / ( noc + loc) |
126- | ` fan_in ` | Fan-In | Incoming dependencies: number of classes outside the framework that depend on classes inside it. |
127- | ` fan_out ` | Fan-Out | Outgoing dependencies: number of classes inside this component that depend on classes outside it. |
128- | ` i ` | Instability | I = fan_out / (fan_in + fan_out) |
129- | ` n_a ` | Number of abstracts | Number of protocols in the framework |
130- | ` n_c ` | Number of concretes | Number of struct and classes in the framework |
131- | ` a ` | Abstractness | A = n_a / n_c |
132- | ` d_3 ` | Distance from the main sequence | D³ = abs( A + I - 1 ) |
133- | ` nbm ` | Number of methods | Number of ` func ` (computed ` var ` excluded) |
134- | ` not ` | Number of tests | Number of methods in test frameworks starting with ` test ` |
135-
136- ## Example
137-
138- A sample project is provided in the ` resources ` folder:
139-
140- ` python3 swift-code-metrics-runner.py --source tests/test_resources/ExampleProject/SwiftCodeMetricsExample --artifacts report --generate-graphs `
141-
142- The graphs that will be generated are the following:
143-
144- | Code distribution |
145- | :-----------:|
146- | ![ LOC] ( docs/assets/lines_of_code_-_loc.jpg ) ![ NOC] ( docs/assets/number_of_comments_-_noc.jpg ) ![ Nc] ( docs/assets/n._of_classes_and_structs.jpg ) ![ Nbm] ( docs/assets/n._of_methods_-_nbm.jpg ) ![ NOT] ( docs/assets/number_of_tests_-_not.jpg ) ![ Abstractness] ( docs/assets/abstractness_-_a.jpg ) ![ Instability] ( docs/assets/instability_-_i.jpg ) ![ Code distribution] ( docs/assets/code_distribution.jpg ) |
147-
148- | Component coupling |
149- | :-----------:|
150- | ![ Distance from main sequence] ( docs/assets/deviation_from_the_main_sequence.jpg )
151- | ![ Dependency graph] ( docs/assets/dependency_graph.jpg )
152- | Dependency graph
38+ ## Documentation
39+
40+ Please follow the [ guide] ( docs/GUIDE.md ) with a practical example to get started.
15341
15442## Current limitations
15543
0 commit comments