-
Couldn't load subscription status.
- Fork 0
function_parameter_count
Ian Applebaum edited this page Jun 13, 2020
·
1 revision
Number of function parameters should be low.
- Identifier: function_parameter_count
- Enabled by default: Enabled
- Supports autocorrection: No
- Kind: metrics
- Analyzer rule: No
- Minimum Swift compiler version: 3.0.0
- Default configuration: warning: 5, error: 8ignores_default_parameters: true
init(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}init (a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}`init`(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}init?(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}init?<T>(a: T, b: Int, c: Int, d: Int, e: Int, f: Int) {}init?<T: String>(a: T, b: Int, c: Int, d: Int, e: Int, f: Int) {}func f2(p1: Int, p2: Int) { }func f(a: Int, b: Int, c: Int, d: Int, x: Int = 42) {}func f(a: [Int], b: Int, c: Int, d: Int, f: Int) -> [Int] {
let s = a.flatMap { $0 as? [String: Int] } ?? []}}override func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}↓func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}↓func initialValue(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}↓func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int = 2, g: Int) {}struct Foo {
init(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
↓func bar(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}}