Protocol subscripts and `{ get set }` properties were scored as functions
even though they contain no executable body, unlike protocol methods.
The new test lists those requirements and a real subscript, and failed
until entries required a statements node. Accessor tests still pass.
Co-authored-by: Robert C. Martin <[email protected]>
Swift packages and iOS apps had no per-function complexity or coverage join, so crapper could not write a .metrics/crap.edn entry that uml-viewer and mutator can attach to a function. The Swift reader scores top-level functions, methods, initializers, subscripts, computed properties, and closures bound with let or var. Nested closures stay inside the enclosing function. Decision points match the other languages: if, guard, loops, catch, ternary, each switch case, &&, ||, ??, and optional chaining.
Coverage reads llvm-cov JSON from swift test and xccov JSON from xcodebuild, joined on the file suffix and the function's line span. A package runs swift test --enable-code-coverage; an Xcode project runs xcodebuild and xcrun xccov view --report --json.
Proved by tests/test_swift.py against checked-in llvm-cov and xccov fixtures, the existing suite (174 passed), crapper with every function under CRAP 10, dryer with no duplicate at 0.8 or above, and mutator killing every mutant in the Swift reader.
Co-authored-by: Robert C. Martin <[email protected]>