Skip to content

Commit cf62a9c

Browse files
committed
Renamed number of methods acronym (NBM > NOM)
1 parent a08ebcf commit cf62a9c

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Inspired by the book of Robert C. Martin, _Clean Architecture_, the software wil
1919
- LOC (Lines Of Code)
2020
- NOC (Numbers Of Comments)
2121
- POC (Percentage Of Comments)
22-
- NBM (Number of Methods)
22+
- NOM (Number of Methods)
2323
- Number of concretes (Number of classes and structs)
2424
- NOT (Number Of Tests)
2525
- NOI (Number Of Imports)

docs/GUIDE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The example below is an excerpt from the example available [here](../swift_code_
2121
"poc": 12.5,
2222
"n_a": 0,
2323
"n_c": 3,
24-
"nbm": 3,
24+
"nom": 3,
2525
"not": 0,
2626
"noi": 1,
2727
"analysis": "The code is under commented. Zone of Pain. Highly stable and concrete component - rigid, hard to extend (not abstract). This component should not be volatile (e.g. a stable foundation library such as Strings).",
@@ -44,7 +44,7 @@ The example below is an excerpt from the example available [here](../swift_code_
4444
"poc": 50.0,
4545
"n_a": 0,
4646
"n_c": 1,
47-
"nbm": 1,
47+
"nom": 1,
4848
"not": 1,
4949
"noi": 0,
5050
"analysis": "The code is over commented. ",
@@ -58,7 +58,7 @@ The example below is an excerpt from the example available [here](../swift_code_
5858
"noc": 35,
5959
"n_a": 1,
6060
"n_c": 7,
61-
"nbm": 10,
61+
"nom": 10,
6262
"not": 0,
6363
"noi": 2,
6464
"poc": 26.515
@@ -68,7 +68,7 @@ The example below is an excerpt from the example available [here](../swift_code_
6868
"noc": 28,
6969
"n_a": 0,
7070
"n_c": 4,
71-
"nbm": 7,
71+
"nom": 7,
7272
"not": 5,
7373
"noi": 0,
7474
"poc": 34.568
@@ -78,7 +78,7 @@ The example below is an excerpt from the example available [here](../swift_code_
7878
"noc": 63,
7979
"n_a": 1,
8080
"n_c": 11,
81-
"nbm": 17,
81+
"nom": 17,
8282
"not": 5,
8383
"noi": 2,
8484
"poc": 29.577
@@ -101,7 +101,7 @@ KPIs legend:
101101
| `n_c` | Number of concretes | Number of struct and classes in the framework |
102102
| `a` | Abstractness | A = n_a / n_c |
103103
| `d_3` | Distance from the main sequence | D³ = abs( A + I - 1 ) |
104-
| `nbm` | Number of methods | Number of `func` (computed `var` excluded) |
104+
| `nom` | Number of methods | Number of `func` (computed `var` excluded) |
105105
| `not` | Number of tests | Number of methods in test frameworks starting with `test` |
106106
| `noi` | Number of imports | Number of imported frameworks |
107107

swift_code_metrics/_analyzer.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __framework_analysis(self, framework):
5555
analysis = Metrics.poc_analysis(poc)
5656
n_a = framework.number_of_interfaces
5757
n_c = framework.number_of_concrete_data_structures
58-
nbm = framework.number_of_methods
58+
nom = framework.number_of_methods
5959
dependencies = Metrics.total_dependencies(framework)
6060
n_of_tests = framework.number_of_tests
6161
n_of_imports = framework.number_of_imports
@@ -79,7 +79,7 @@ def __framework_analysis(self, framework):
7979
"poc": ReportingHelpers.decimal_format(poc),
8080
"n_a": n_a,
8181
"n_c": n_c,
82-
"nbm": nbm,
82+
"nom": nom,
8383
"not": n_of_tests,
8484
"noi": n_of_imports,
8585
"analysis": analysis,
@@ -152,12 +152,12 @@ def __get_framework(self, name):
152152

153153

154154
class _AggregateData:
155-
def __init__(self, loc=0, noc=0, n_a=0, n_c=0, nbm=0, n_o_t=0, n_o_i=0):
155+
def __init__(self, loc=0, noc=0, n_a=0, n_c=0, nom=0, n_o_t=0, n_o_i=0):
156156
self.loc = loc
157157
self.noc = noc
158158
self.n_a = n_a
159159
self.n_c = n_c
160-
self.nbm = nbm
160+
self.nom = nom
161161
self.n_o_t = n_o_t
162162
self.n_o_i = n_o_i
163163

@@ -166,7 +166,7 @@ def append_framework(self, f: 'Framework'):
166166
self.noc += f.noc
167167
self.n_a += f.number_of_interfaces
168168
self.n_c += f.number_of_concrete_data_structures
169-
self.nbm += f.number_of_methods
169+
self.nom += f.number_of_methods
170170
self.n_o_t += f.number_of_tests
171171
self.n_o_i += f.number_of_imports
172172

@@ -181,7 +181,7 @@ def as_dict(self):
181181
"noc": self.noc,
182182
"n_a": self.n_a,
183183
"n_c": self.n_c,
184-
"nbm": self.nbm,
184+
"nom": self.nom,
185185
"not": self.n_o_t,
186186
"noi": self.n_o_i,
187187
"poc": ReportingHelpers.decimal_format(self.poc)
@@ -193,7 +193,7 @@ def merged_data(first, second):
193193
noc=first.noc + second.noc,
194194
n_a=first.n_a + second.n_a,
195195
n_c=first.n_c + second.n_c,
196-
nbm=first.nbm + second.nbm,
196+
nom=first.nom + second.nom,
197197
n_o_t=first.n_o_t + second.n_o_t,
198198
n_o_i=first.n_o_i + second.n_o_i)
199199

swift_code_metrics/tests/test_resources/expected_output.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"poc": 12.5,
88
"n_a": 0,
99
"n_c": 3,
10-
"nbm": 3,
10+
"nom": 3,
1111
"not": 0,
1212
"noi": 1,
1313
"analysis": "The code is under commented. Zone of Pain. Highly stable and concrete component - rigid, hard to extend (not abstract). This component should not be volatile (e.g. a stable foundation library such as Strings).",
@@ -28,7 +28,7 @@
2828
"poc": 35.0,
2929
"n_a": 1,
3030
"n_c": 2,
31-
"nbm": 3,
31+
"nom": 3,
3232
"not": 0,
3333
"noi": 0,
3434
"analysis": "Zone of Pain. Highly stable and concrete component - rigid, hard to extend (not abstract). This component should not be volatile (e.g. a stable foundation library such as Strings).",
@@ -47,7 +47,7 @@
4747
"poc": 38.889,
4848
"n_a": 0,
4949
"n_c": 2,
50-
"nbm": 4,
50+
"nom": 4,
5151
"not": 0,
5252
"noi": 1,
5353
"analysis": "Highly unstable component (lack of dependents, easy to change, irresponsible) Low abstract component, few interfaces. ",
@@ -70,7 +70,7 @@
7070
"poc": 50.0,
7171
"n_a": 0,
7272
"n_c": 1,
73-
"nbm": 1,
73+
"nom": 1,
7474
"not": 1,
7575
"noi": 0,
7676
"analysis": "The code is over commented. ",
@@ -84,7 +84,7 @@
8484
"poc": 25.455,
8585
"n_a": 0,
8686
"n_c": 2,
87-
"nbm": 5,
87+
"nom": 5,
8888
"not": 3,
8989
"noi": 0,
9090
"analysis": "",
@@ -98,7 +98,7 @@
9898
"poc": 58.333,
9999
"n_a": 0,
100100
"n_c": 1,
101-
"nbm": 1,
101+
"nom": 1,
102102
"not": 1,
103103
"noi": 0,
104104
"analysis": "The code is over commented. ",
@@ -112,7 +112,7 @@
112112
"noc": 35,
113113
"n_a": 1,
114114
"n_c": 7,
115-
"nbm": 10,
115+
"nom": 10,
116116
"not": 0,
117117
"noi": 2,
118118
"poc": 26.515
@@ -122,7 +122,7 @@
122122
"noc": 28,
123123
"n_a": 0,
124124
"n_c": 4,
125-
"nbm": 7,
125+
"nom": 7,
126126
"not": 5,
127127
"noi": 0,
128128
"poc": 34.568
@@ -132,7 +132,7 @@
132132
"noc": 63,
133133
"n_a": 1,
134134
"n_c": 11,
135-
"nbm": 17,
135+
"nom": 17,
136136
"not": 5,
137137
"noi": 2,
138138
"poc": 29.577

swift_code_metrics/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "1.2.1"
1+
VERSION = "1.2.2"

0 commit comments

Comments
 (0)