Compatibility
- 0.5.9 and main5.35.25.15.04.2
- 0.5.9iOSmacOS(Intel)macOS(ARM)LinuxtvOSwatchOS
- mainiOSmacOS(Intel)macOS(ARM)LinuxtvOSwatchOS
CoherentSwift is a command line tool written in Swift that analyses the cohesion level of your Swift codebase.
In computer programming, cohesion refers to the degree to which the elements of a module belong together. Thus, cohesion measures the strength of relationship between pieces of functionality within a given module. For example, in highly cohesive systems functionality is strongly related.
When cohesion is high, it means that the methods and variables of the class are co-dependent and hang together as a logical whole.
- Clean Code pg. 140
Some of the advantages of high cohesion, also by Wikipedia:
coherent-swift is inspired by cohesion.
brew tap arthurpalves/formulae
brew install coherent-swift
mint install arthurpalves/coherent-swift
git clone https://github.com/arthurpalves/coherent-swift.git
cd coherent-swift
make install
git clone https://github.com/arthurpalves/coherent-swift.git
cd coherent-swift
swift run coherent-swift
Usage: coherent-swift <command> [options]
A command-line tool to analyze and report Swift code cohesion
Commands:
init Generate specs (.yml) file
report Generate a report on Swift code cohesion
help Prints help information
version Prints the current version of this app
Before running the report
command you must first have a spec/configuration file. This is a YAML file containing the basic configuration for coherent-swift.
coherent-swift init
This will generate the file coherent-swift.yml
in your working directory.
See the specs template
NOTE: By default,
coherent-swift
expects to find the configuration above in./coherent-swift.yml
, if you do have this file elsewhere or with a different name, please specify it's path by using the parameter-s | --spec
.
Usage: coherent-swift report [options]
Generate a report on Swift code cohesion
Options:
-d, --diffs Only scan modified files
-h, --help Show help information
-s, --spec <value> Use a yaml configuration file
-v, --verbose Log tech details for nerds
coherent-swift report
coherent-swift report --verbose
coherent-swift is released under the MIT license. See LICENSE for more information.