Skip to content

mccurdyc/splitfile

Repository files navigation

splitfile

CircleCI codecov Maintainability Test Coverage Go Report Card

splitfile aims to improve Go code readability by reducing the lines of code per file and ultimately improving the focus of files in a package.

How it Works

splitfile identifies partitions of packages via the following method. First, a weighted directed graph is constructed, where nodes are type, var, const, or func declarations and weighted directed edges define the relationships between declarations and their uses. splitfile identifies partitions by assigning configurable weights to edges (i.e., type -> method edges should probably be of a higher weight than type -> usage edges, but this is ultimately up to the user). Next, these weights are used by the distance function. After calculating the distance of all paths, partitions are identified by comparing the distance to a configurable epsilon value. Paths with a distance greater than epsilon will be partitioned, leaving path with a distance less than epsilon "clustered".

configurable: edge weights and epsilon can be configured via cli flags or a .splitfile.yml file.

License

About

🪓 [WORK IN PROGRESS] A Go analysis that identifies partitions of declarations and their uses to improve the readability of Go packages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages