Repository navigation
Highlights
Behavior changes
- Subscripts with a shorthand getter (
subscript(i: Int) -> T { ... }) are now
reported, namedsubscript. Function counts and averages change for code
that has them, and a threshold gate can fail on a subscript that was
previously skipped. (#58, #60) - Explicit subscript accessors, previously reported as a bare
get/set,
are now namedsubscript.get/subscript.set. (#58, #60) - A
// swift-complexity:disablecomment above a subscript or property whose
accessors are written out (get/set, orwillSet/didSetobservers) now
applies to each accessor. Previously it had to be written above every
accessor. (#60)
New features
- JSON and XML output report where each function ends:
endLocationin JSON,
end-line/end-columnin XML. The position is just past the closing
brace. SARIF and Xcode diagnostics still report only where the declaration
starts. (#58, #60)
Installation
CLI Tool (SwiftComplexityCLI)
Download the appropriate binary for your platform:
- macOS Apple Silicon (M1/M2/M3):
SwiftComplexityCLI-1.7.0-macos-arm64.tar.gz - macOS Intel:
SwiftComplexityCLI-1.7.0-macos-x86_64.tar.gz - Linux x86_64:
SwiftComplexityCLI-1.7.0-linux-x86_64.tar.gz - Linux arm64:
SwiftComplexityCLI-1.7.0-linux-aarch64.tar.gz
tar -xzf SwiftComplexityCLI-1.7.0-*.tar.gz
cd SwiftComplexityCLI-1.7.0-*
./install.shMCP Server (SwiftComplexityMCP)
Download the MCP server for LLM agent integration:
- macOS Apple Silicon (M1/M2/M3):
SwiftComplexityMCP-1.7.0-macos-arm64.tar.gz - macOS Intel:
SwiftComplexityMCP-1.7.0-macos-x86_64.tar.gz - Linux x86_64:
SwiftComplexityMCP-1.7.0-linux-x86_64.tar.gz - Linux arm64:
SwiftComplexityMCP-1.7.0-linux-aarch64.tar.gz
tar -xzf SwiftComplexityMCP-1.7.0-*.tar.gz
cd SwiftComplexityMCP-1.7.0-*
./install.shArtifact Bundle (nest)
nest install fummicc1/swift-complexityOr download the artifact bundle directly:
- SwiftComplexityCLI:
swift-complexity.artifactbundle.zip - SwiftComplexityMCP:
swift-complexity-mcp.artifactbundle.zip
Build from Source
git clone https://github.com/fummicc1/swift-complexity.git
cd swift-complexity
git checkout v1.7.0
# --traits IndexStore enables LCOM4 and coupling (off by default)
swift build -c release --traits IndexStoreVerification
shasum -a 256 -c SwiftComplexityCLI-1.7.0-*.tar.gz.sha256
shasum -a 256 -c SwiftComplexityMCP-1.7.0-*.tar.gz.sha256
shasum -a 256 -c swift-complexity.artifactbundle.zip.sha256
shasum -a 256 -c swift-complexity-mcp.artifactbundle.zip.sha256What's Changed
Breaking Changes
Other Changes
- Refuse a final version marked as pre-release, and the reverse by @fummicc1 in #65
- Skip PR comment steps on pull requests from forks by @fummicc1 in #66
Full Changelog: v1.6.0...v1.7.0