-
Couldn't load subscription status.
- Fork 0
identical_operands
Ian Applebaum edited this page Jun 13, 2020
·
1 revision
Comparing two identical operands is likely a mistake.
- Identifier: identical_operands
- Enabled by default: Disabled
- Supports autocorrection: No
- Kind: lint
- Analyzer rule: No
- Minimum Swift compiler version: 3.0.0
- Default configuration: warning
1 == 2foo == barprefixedFoo == foofoo.aProperty == foo.anotherPropertyself.aProperty == self.anotherProperty"1 == 1"self.aProperty == aPropertylhs.aProperty == rhs.aPropertylhs.identifier == rhs.identifieri == index$0 == 0keyValues?.count ?? 0 == 0string == string.lowercased()let num: Int? = 0
_ = num != nil && num == num?.byteSwappednum == num!.byteSwapped1 != 2foo != barprefixedFoo != foofoo.aProperty != foo.anotherPropertyself.aProperty != self.anotherProperty"1 != 1"self.aProperty != aPropertylhs.aProperty != rhs.aPropertylhs.identifier != rhs.identifieri != index$0 != 0keyValues?.count ?? 0 != 0string != string.lowercased()let num: Int? = 0
_ = num != nil && num != num?.byteSwappednum != num!.byteSwapped1 === 2foo === barprefixedFoo === foofoo.aProperty === foo.anotherPropertyself.aProperty === self.anotherProperty"1 === 1"self.aProperty === aPropertylhs.aProperty === rhs.aPropertylhs.identifier === rhs.identifieri === index$0 === 0keyValues?.count ?? 0 === 0string === string.lowercased()let num: Int? = 0
_ = num != nil && num === num?.byteSwappednum === num!.byteSwapped1 !== 2foo !== barprefixedFoo !== foofoo.aProperty !== foo.anotherPropertyself.aProperty !== self.anotherProperty"1 !== 1"self.aProperty !== aPropertylhs.aProperty !== rhs.aPropertylhs.identifier !== rhs.identifieri !== index$0 !== 0keyValues?.count ?? 0 !== 0string !== string.lowercased()let num: Int? = 0
_ = num != nil && num !== num?.byteSwappednum !== num!.byteSwapped1 > 2foo > barprefixedFoo > foofoo.aProperty > foo.anotherPropertyself.aProperty > self.anotherProperty"1 > 1"self.aProperty > aPropertylhs.aProperty > rhs.aPropertylhs.identifier > rhs.identifieri > index$0 > 0keyValues?.count ?? 0 > 0string > string.lowercased()let num: Int? = 0
_ = num != nil && num > num?.byteSwappednum > num!.byteSwapped1 >= 2foo >= barprefixedFoo >= foofoo.aProperty >= foo.anotherPropertyself.aProperty >= self.anotherProperty"1 >= 1"self.aProperty >= aPropertylhs.aProperty >= rhs.aPropertylhs.identifier >= rhs.identifieri >= index$0 >= 0keyValues?.count ?? 0 >= 0string >= string.lowercased()let num: Int? = 0
_ = num != nil && num >= num?.byteSwappednum >= num!.byteSwapped1 < 2foo < barprefixedFoo < foofoo.aProperty < foo.anotherPropertyself.aProperty < self.anotherProperty"1 < 1"self.aProperty < aPropertylhs.aProperty < rhs.aPropertylhs.identifier < rhs.identifieri < index$0 < 0keyValues?.count ?? 0 < 0string < string.lowercased()let num: Int? = 0
_ = num != nil && num < num?.byteSwappednum < num!.byteSwapped1 <= 2foo <= barprefixedFoo <= foofoo.aProperty <= foo.anotherPropertyself.aProperty <= self.anotherProperty"1 <= 1"self.aProperty <= aPropertylhs.aProperty <= rhs.aPropertylhs.identifier <= rhs.identifieri <= index$0 <= 0keyValues?.count ?? 0 <= 0string <= string.lowercased()let num: Int? = 0
_ = num != nil && num <= num?.byteSwappednum <= num!.byteSwappedfunc evaluate(_ mode: CommandMode) -> Result<AutoCorrectOptions, CommandantError<CommandantError<()>>>let array = Array<Array<Int>>()guard Set(identifiers).count != identifiers.count else { return }expect("foo") == "foo"type(of: model).cachePrefix == cachePrefixhistogram[156].0 == 0x003B8D96 && histogram[156].1 == 1↓1 == 1↓foo == foo↓foo.aProperty == foo.aProperty↓self.aProperty == self.aProperty↓$0 == $0↓a?.b == a?.bif (↓elem == elem) {}XCTAssertTrue(↓s3 == s3)if let tab = tabManager.selectedTab, ↓tab.webView == tab.webView↓1 != 1↓foo != foo↓foo.aProperty != foo.aProperty↓self.aProperty != self.aProperty↓$0 != $0↓a?.b != a?.bif (↓elem != elem) {}XCTAssertTrue(↓s3 != s3)if let tab = tabManager.selectedTab, ↓tab.webView != tab.webView↓1 === 1↓foo === foo↓foo.aProperty === foo.aProperty↓self.aProperty === self.aProperty↓$0 === $0↓a?.b === a?.bif (↓elem === elem) {}XCTAssertTrue(↓s3 === s3)if let tab = tabManager.selectedTab, ↓tab.webView === tab.webView↓1 !== 1↓foo !== foo↓foo.aProperty !== foo.aProperty↓self.aProperty !== self.aProperty↓$0 !== $0↓a?.b !== a?.bif (↓elem !== elem) {}XCTAssertTrue(↓s3 !== s3)if let tab = tabManager.selectedTab, ↓tab.webView !== tab.webView↓1 > 1↓foo > foo↓foo.aProperty > foo.aProperty↓self.aProperty > self.aProperty↓$0 > $0↓a?.b > a?.bif (↓elem > elem) {}XCTAssertTrue(↓s3 > s3)if let tab = tabManager.selectedTab, ↓tab.webView > tab.webView↓1 >= 1↓foo >= foo↓foo.aProperty >= foo.aProperty↓self.aProperty >= self.aProperty↓$0 >= $0↓a?.b >= a?.bif (↓elem >= elem) {}XCTAssertTrue(↓s3 >= s3)if let tab = tabManager.selectedTab, ↓tab.webView >= tab.webView↓1 < 1↓foo < foo↓foo.aProperty < foo.aProperty↓self.aProperty < self.aProperty↓$0 < $0↓a?.b < a?.bif (↓elem < elem) {}XCTAssertTrue(↓s3 < s3)if let tab = tabManager.selectedTab, ↓tab.webView < tab.webView↓1 <= 1↓foo <= foo↓foo.aProperty <= foo.aProperty↓self.aProperty <= self.aProperty↓$0 <= $0↓a?.b <= a?.bif (↓elem <= elem) {}XCTAssertTrue(↓s3 <= s3)if let tab = tabManager.selectedTab, ↓tab.webView <= tab.webView