https://github.com/skarlso/effrit
Go Efferent and Afferent package metric calculator.
https://github.com/skarlso/effrit
go golang metrics
Last synced: 10 months ago
JSON representation
Go Efferent and Afferent package metric calculator.
- Host: GitHub
- URL: https://github.com/skarlso/effrit
- Owner: Skarlso
- License: mit
- Created: 2019-04-16T18:59:04.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2024-03-14T06:39:49.000Z (over 2 years ago)
- Last Synced: 2025-04-20T13:01:04.759Z (about 1 year ago)
- Topics: go, golang, metrics
- Language: Go
- Size: 910 KB
- Stars: 35
- Watchers: 5
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Effrit
[](https://travis-ci.org/Skarlso/effrit)
Go Efferent and Afferent package metric calculator.
Metrics calculated currently by this package:
- [x] Instability metric
- [x] Abstractness metric
- [x] Distance from main sequence metric
All metrics are now supported and calculated accordingly.
# Description of these metrics
https://en.wikipedia.org/wiki/Software_package_metrics
Please see Robert Cecil Martin's Clean Architecture book on details describing those metrics.
In terms of what this tool is doing, please refer to this post: [Efferent and Afferent Metrics in Go](https://skarlso.github.io/2019/04/21/efferent-and-afferent-metrics-in-go/).
# Usage on Effrit
Here is an example of running this tool on this very project:

# Package Data
Effrit now dumps data as JSON file into the project root directly. Until I finish the CGUI for effrit, this data can be processed by any other tool. Example using Effrit project:
```json
{
"packages":[
{
"Name":"effrit",
"FullName":"github.com/Skarlso/effrit",
"Imports":[
"github.com/Skarlso/effrit/cmd"
],
"ImportCount":1,
"DependedOnByCount":0,
"DependedOnByNames":null,
"Stability":1,
"Abstractness":0,
"DistanceFromMedian":0,
"Dir":"/Users/hannibal/goprojects/effrit",
"GoFiles":[
"main.go"
]
},
{
"Name":"cmd",
"FullName":"github.com/Skarlso/effrit/cmd",
"Imports":[
"github.com/Skarlso/effrit/pkg"
],
"ImportCount":1,
"DependedOnByCount":1,
"DependedOnByNames":[
"github.com/Skarlso/effrit"
],
"Stability":0.5,
"Abstractness":0.5,
"DistanceFromMedian":0,
"Dir":"/Users/hannibal/goprojects/effrit/cmd",
"GoFiles":[
"root.go",
"scan.go"
]
},
{
"Name":"pkg",
"FullName":"github.com/Skarlso/effrit/pkg",
"Imports":[
],
"ImportCount":0,
"DependedOnByCount":1,
"DependedOnByNames":[
"github.com/Skarlso/effrit/cmd"
],
"Stability":0,
"Abstractness":0.3,
"DistanceFromMedian":0.7,
"Dir":"/Users/hannibal/goprojects/effrit/pkg",
"GoFiles":[
"packages.go",
"scan.go"
]
}
]
}
```
# Contributions
Are always welcomed!