Implicit Getter
ID |
swift.implicit_getter |
Severity |
info |
Remediation Complexity |
medium |
Remediation Risk |
low |
Remediation Effort |
medium |
Resource |
Code Smell |
Language |
Swift |
Tags |
code-smell, redundancy |
Description
Reports a read-only computed property that wraps its body in an explicit
get {} block. Swift allows the get keyword to be dropped on read-only
computed properties, and the bare-brace form is the idiomatic style.
var name: String { // OK — bare braces
return _name
}
var name: String { // FLAW
get {
return _name
}
}