Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkeeler/go-complexity
Tool to analyze Golang Programs Complexity
https://github.com/mkeeler/go-complexity
Last synced: 19 days ago
JSON representation
Tool to analyze Golang Programs Complexity
- Host: GitHub
- URL: https://github.com/mkeeler/go-complexity
- Owner: mkeeler
- License: mpl-2.0
- Created: 2022-09-09T13:11:29.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-24T14:56:12.000Z (over 1 year ago)
- Last Synced: 2024-10-13T01:18:19.369Z (about 1 month ago)
- Language: Go
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-complexity
Tool to analyze Golang Programs Complexity## Function Complexity
### Cyclomatic Complexity
[Wikipedia](https://en.wikipedia.org/wiki/Cyclomatic_complexity) does a good job of explaining the concept. Essentially, more branching and variability in code paths within a function make that function more complex and harder to reason about and maintain.
The cyclomatic complexity calculations done in this repo are ` - + 2`. The `` are return statements from functions. Note that the logic within this code doesn't make an attempt to handle calls to os.Exit, or implicit returns such as for named returns or functions with no return value that simply reach their end. The `` are the following:
* `if` statements
* `range` statements
* `for` statements
* switch `case` clauses
* select `case` clauses
* `||` operator
* `&&` operatorFunction literals can optionally be included as "decision points". Although they do not technically alter branching, they do increase the complexity of the function and degrade readability and therefore it may be good to count them for tracking.
## Package Complexity
## Cyclomatic Complexity## Functions with Many Arguments
## Maintainability Index
https://docs.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022
## LOC
## Callgraph
* edges out to non-sentinal packages
* edges out to any other package
* edges into the package## Exported API
* number of exported functions
* number of exported types
* number of exported methods
* number of exported interfaces