Skip to content

Commit

Permalink
Renamed number of methods acronym (NBM > NOM)
Browse files Browse the repository at this point in the history
  • Loading branch information
matsoftware committed Feb 10, 2019
1 parent a08ebcf commit cf62a9c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Inspired by the book of Robert C. Martin, _Clean Architecture_, the software wil
- LOC (Lines Of Code)
- NOC (Numbers Of Comments)
- POC (Percentage Of Comments)
- NBM (Number of Methods)
- NOM (Number of Methods)
- Number of concretes (Number of classes and structs)
- NOT (Number Of Tests)
- NOI (Number Of Imports)
Expand Down
12 changes: 6 additions & 6 deletions docs/GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The example below is an excerpt from the example available [here](../swift_code_
"poc": 12.5,
"n_a": 0,
"n_c": 3,
"nbm": 3,
"nom": 3,
"not": 0,
"noi": 1,
"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).",
Expand All @@ -44,7 +44,7 @@ The example below is an excerpt from the example available [here](../swift_code_
"poc": 50.0,
"n_a": 0,
"n_c": 1,
"nbm": 1,
"nom": 1,
"not": 1,
"noi": 0,
"analysis": "The code is over commented. ",
Expand All @@ -58,7 +58,7 @@ The example below is an excerpt from the example available [here](../swift_code_
"noc": 35,
"n_a": 1,
"n_c": 7,
"nbm": 10,
"nom": 10,
"not": 0,
"noi": 2,
"poc": 26.515
Expand All @@ -68,7 +68,7 @@ The example below is an excerpt from the example available [here](../swift_code_
"noc": 28,
"n_a": 0,
"n_c": 4,
"nbm": 7,
"nom": 7,
"not": 5,
"noi": 0,
"poc": 34.568
Expand All @@ -78,7 +78,7 @@ The example below is an excerpt from the example available [here](../swift_code_
"noc": 63,
"n_a": 1,
"n_c": 11,
"nbm": 17,
"nom": 17,
"not": 5,
"noi": 2,
"poc": 29.577
Expand All @@ -101,7 +101,7 @@ KPIs legend:
| `n_c` | Number of concretes | Number of struct and classes in the framework |
| `a` | Abstractness | A = n_a / n_c |
| `d_3` | Distance from the main sequence | D³ = abs( A + I - 1 ) |
| `nbm` | Number of methods | Number of `func` (computed `var` excluded) |
| `nom` | Number of methods | Number of `func` (computed `var` excluded) |
| `not` | Number of tests | Number of methods in test frameworks starting with `test` |
| `noi` | Number of imports | Number of imported frameworks |

Expand Down
14 changes: 7 additions & 7 deletions swift_code_metrics/_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __framework_analysis(self, framework):
analysis = Metrics.poc_analysis(poc)
n_a = framework.number_of_interfaces
n_c = framework.number_of_concrete_data_structures
nbm = framework.number_of_methods
nom = framework.number_of_methods
dependencies = Metrics.total_dependencies(framework)
n_of_tests = framework.number_of_tests
n_of_imports = framework.number_of_imports
Expand All @@ -79,7 +79,7 @@ def __framework_analysis(self, framework):
"poc": ReportingHelpers.decimal_format(poc),
"n_a": n_a,
"n_c": n_c,
"nbm": nbm,
"nom": nom,
"not": n_of_tests,
"noi": n_of_imports,
"analysis": analysis,
Expand Down Expand Up @@ -152,12 +152,12 @@ def __get_framework(self, name):


class _AggregateData:
def __init__(self, loc=0, noc=0, n_a=0, n_c=0, nbm=0, n_o_t=0, n_o_i=0):
def __init__(self, loc=0, noc=0, n_a=0, n_c=0, nom=0, n_o_t=0, n_o_i=0):
self.loc = loc
self.noc = noc
self.n_a = n_a
self.n_c = n_c
self.nbm = nbm
self.nom = nom
self.n_o_t = n_o_t
self.n_o_i = n_o_i

Expand All @@ -166,7 +166,7 @@ def append_framework(self, f: 'Framework'):
self.noc += f.noc
self.n_a += f.number_of_interfaces
self.n_c += f.number_of_concrete_data_structures
self.nbm += f.number_of_methods
self.nom += f.number_of_methods
self.n_o_t += f.number_of_tests
self.n_o_i += f.number_of_imports

Expand All @@ -181,7 +181,7 @@ def as_dict(self):
"noc": self.noc,
"n_a": self.n_a,
"n_c": self.n_c,
"nbm": self.nbm,
"nom": self.nom,
"not": self.n_o_t,
"noi": self.n_o_i,
"poc": ReportingHelpers.decimal_format(self.poc)
Expand All @@ -193,7 +193,7 @@ def merged_data(first, second):
noc=first.noc + second.noc,
n_a=first.n_a + second.n_a,
n_c=first.n_c + second.n_c,
nbm=first.nbm + second.nbm,
nom=first.nom + second.nom,
n_o_t=first.n_o_t + second.n_o_t,
n_o_i=first.n_o_i + second.n_o_i)

Expand Down
18 changes: 9 additions & 9 deletions swift_code_metrics/tests/test_resources/expected_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"poc": 12.5,
"n_a": 0,
"n_c": 3,
"nbm": 3,
"nom": 3,
"not": 0,
"noi": 1,
"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).",
Expand All @@ -28,7 +28,7 @@
"poc": 35.0,
"n_a": 1,
"n_c": 2,
"nbm": 3,
"nom": 3,
"not": 0,
"noi": 0,
"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).",
Expand All @@ -47,7 +47,7 @@
"poc": 38.889,
"n_a": 0,
"n_c": 2,
"nbm": 4,
"nom": 4,
"not": 0,
"noi": 1,
"analysis": "Highly unstable component (lack of dependents, easy to change, irresponsible) Low abstract component, few interfaces. ",
Expand All @@ -70,7 +70,7 @@
"poc": 50.0,
"n_a": 0,
"n_c": 1,
"nbm": 1,
"nom": 1,
"not": 1,
"noi": 0,
"analysis": "The code is over commented. ",
Expand All @@ -84,7 +84,7 @@
"poc": 25.455,
"n_a": 0,
"n_c": 2,
"nbm": 5,
"nom": 5,
"not": 3,
"noi": 0,
"analysis": "",
Expand All @@ -98,7 +98,7 @@
"poc": 58.333,
"n_a": 0,
"n_c": 1,
"nbm": 1,
"nom": 1,
"not": 1,
"noi": 0,
"analysis": "The code is over commented. ",
Expand All @@ -112,7 +112,7 @@
"noc": 35,
"n_a": 1,
"n_c": 7,
"nbm": 10,
"nom": 10,
"not": 0,
"noi": 2,
"poc": 26.515
Expand All @@ -122,7 +122,7 @@
"noc": 28,
"n_a": 0,
"n_c": 4,
"nbm": 7,
"nom": 7,
"not": 5,
"noi": 0,
"poc": 34.568
Expand All @@ -132,7 +132,7 @@
"noc": 63,
"n_a": 1,
"n_c": 11,
"nbm": 17,
"nom": 17,
"not": 5,
"noi": 2,
"poc": 29.577
Expand Down
2 changes: 1 addition & 1 deletion swift_code_metrics/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "1.2.1"
VERSION = "1.2.2"

0 comments on commit cf62a9c

Please sign in to comment.