Skip to content

CA2249: Also trigger on String.IndexOf() != -1 #6774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

mpidash
Copy link

@mpidash mpidash commented Jul 16, 2023

Ran the new version against dotnet/runtime and found one new case:
runtime/src/coreclr/tools/Common/Compiler/ProcessLinkerXmlBase.cs#L214

Also ran it against dotnet/roslyn -- found multiple CA2249, but most of them were already covered before this PR:

Paths
W:\roslyn\src\Compilers\Core\CodeAnalysisTest\Diagnostics\AnalysisContextInfoTests.cs(50,25): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs(273,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs(273,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs(274,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs(274,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs(636,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs(636,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs(637,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs(637,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\DocumentationCommentId.cs(263,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\DocumentationCommentId.cs(263,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\DocumentationCommentId.cs(1502,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\DocumentationCommentId.cs(1502,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs(214,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs(214,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs(214,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs(214,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(76,29): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(76,29): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(76,29): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(76,29): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(77,33): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(77,33): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(77,33): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(77,33): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(499,20): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(499,20): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(499,20): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(499,20): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(500,20): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(500,20): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(500,20): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(500,20): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(722,37): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(722,37): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(722,37): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(722,37): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(723,41): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(723,41): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(723,41): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs(723,41): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs(100,57): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs(100,57): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs(100,57): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs(100,57): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReader\MetadataHelpers.cs(155,66): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReader\MetadataHelpers.cs(155,66): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReader\MetadataHelpers.cs(947,80): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReader\MetadataHelpers.cs(947,80): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReader\MetadataTypeName.cs(154,84): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReader\MetadataTypeName.cs(154,84): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentity.DisplayName.cs(221,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentity.DisplayName.cs(221,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentity.DisplayName.cs(449,26): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\MetadataReference\AssemblyIdentity.DisplayName.cs(449,26): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\PEWriter\TypeNameSerializer.cs(221,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Core\Portable\PEWriter\TypeNameSerializer.cs(221,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Portable\Symbols\AssemblySymbol.cs(684,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Portable\Symbols\AssemblySymbol.cs(684,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNames.cs(223,30): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNames.cs(223,30): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Emit\CodeGen\CodeGenDynamicTests.cs(137,118): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SemanticModelGetDeclaredSymbolAPITests.cs(4324,29): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SymbolSearchTests.cs(157,36): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SymbolSearchTests.cs(158,36): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SymbolSearchTests.cs(159,36): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SymbolSearchTests.cs(160,36): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SymbolSearchTests.cs(161,36): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SymbolSearchTests.cs(162,36): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SymbolSearchTests.cs(163,36): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SymbolSearchTests.cs(165,36): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\CSharp\Test\Symbol\Compilation\SymbolSearchTests.cs(190,36): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\ClrGlobalAssemblyCache.cs(250,30): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\ClrGlobalAssemblyCache.cs(250,30): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(345,30): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(345,30): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(345,30): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(442,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(442,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(442,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(467,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(467,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(467,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(502,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(502,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs(502,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Test\Core\Compilation\CompilationTestDataExtensions.cs(33,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\Test\Core\Compilation\CompilationTestDataExtensions.cs(33,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\VisualBasic\Test\Emit\CodeGen\CodeGenAsyncTests.vb(5380,20): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\VisualBasic\Test\Semantic\Semantics\MyBaseMyClassTests.vb(3991,28): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Compilers\VisualBasic\Test\Symbol\SymbolsTests\AnonymousTypes\AnonymousTypesEmittedSymbolsTests.vb(578,28): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\EditorFeatures\Core.Cocoa\Snippets\AbstractSnippetExpansionClient.cs(191,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\EditorFeatures\Core.Cocoa\Snippets\AbstractSnippetExpansionClient.cs(370,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\EditorFeatures\Core.Cocoa\Snippets\AbstractSnippetExpansionClient.cs(371,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Features\Core\Portable\PdbSourceDocument\SourceLinkMap.cs(146,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Features\Core\Portable\PdbSourceDocument\SourceLinkMap.cs(146,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Features\Core\Portable\PdbSourceDocument\SourceLinkMap.cs(180,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Features\Core\Portable\PdbSourceDocument\SourceLinkMap.cs(180,17): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Tools\BuildValidator\Program.cs(187,43): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\CoreTestUtilities\MEF\TestComposition.cs(201,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\Core\Portable\Rename\ConflictEngine\ConflictResolver.cs(515,16): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\Core\Portable\Rename\ConflictEngine\ConflictResolver.cs(515,16): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs(40,25): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs(40,25): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs(117,46): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs(117,46): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs(52,29): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs(52,29): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs(144,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs(144,21): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\VisualBasic\Portable\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.vb(49,28): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability
W:\roslyn\src\Workspaces\VisualBasic\Portable\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.vb(49,28): info CA2249: Use 'string.Contains' instead of 'string.IndexOf' to improve readability

I did not manage to run it against dotnet/roslyn-analyzers.
The rule did not trigger at all, even if I added a already covered case, e.g. var test = "str".IndexOf('a') == -1.
I tried it again with dotnet_diagnostic.CA2249.severity = warning added to the .editorconfig with no luck.

Fixes #6587

mpidash added 2 commits July 16, 2023 20:37
Extends the analyer and fixer to handle not equals for String.IndexOf.

Fix dotnet#6587
@mpidash mpidash requested a review from a team as a code owner July 16, 2023 21:13
@codecov
Copy link

codecov bot commented Jul 16, 2023

Codecov Report

Merging #6774 (29a56c8) into main (dfd38ae) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6774   +/-   ##
=======================================
  Coverage   96.33%   96.34%           
=======================================
  Files        1386     1386           
  Lines      325658   325667    +9     
  Branches    10718    10712    -6     
=======================================
+ Hits       313734   313750   +16     
+ Misses       9213     9205    -8     
- Partials     2711     2712    +1     

@mavasani mavasani merged commit 24b0087 into dotnet:main Jul 17, 2023
@mpidash mpidash deleted the issue-6587 branch July 17, 2023 17:18
amiru3f pushed a commit to amiru3f/roslyn-analyzers that referenced this pull request Jul 26, 2023
CA2249: Also trigger on `String.IndexOf() != -1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CA2249 (prefer Contains instead of IndexOf) does not trigger when IndexOf comparison operator is !=
2 participants