llvm-project/clang-tools-extra/clang-tidy/readability
Whisperity 73e4b5cfa8 [clang-tidy] Add 'readability-suspicious-call-argument' check
Finds function calls where the call arguments might be provided in an
incorrect order, based on the comparison (via string metrics) of the
parameter names and the argument names against each other.

A diagnostic is emitted if an argument name is similar to a *different*
parameter than the one currently passed to, and it is sufficiently
dissimilar to the one it **is** passed to currently.

False-positive warnings from this check are useful to indicate bad
naming convention issues, even if a swap isn't necessary.
This check does not generate FixIts.

Originally implemented by @varjujan as his Master's Thesis work.
The check was subsequently taken over by @barancsuk who added type
conformity checks to silence false positive matches.
The work by @whisperity involved driving the check's review and fixing
some more bugs in the process.

Reviewed By: aaron.ballman, alexfh

Differential Revision: http://reviews.llvm.org/D20689

Co-authored-by: János Varjú <varjujanos2@gmail.com>
Co-authored-by: Lilla Barancsuk <barancsuklilla@gmail.com>
2021-07-19 10:18:09 +02:00
..
AvoidConstParamsInDecls.cpp [clang-tidy] Fix readability-avoid-const-params-in-decls removing const in template paramaters 2021-02-24 15:54:10 +00:00
AvoidConstParamsInDecls.h [clang-tidy] Simplify const params check 2021-02-17 10:20:12 +00:00
BracesAroundStatementsCheck.cpp [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
BracesAroundStatementsCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
CMakeLists.txt [clang-tidy] Add 'readability-suspicious-call-argument' check 2021-07-19 10:18:09 +02:00
ConstReturnTypeCheck.cpp [clang-tools-extra] NFC: Fix trivial typo in documents and comments 2020-04-05 15:28:40 +09:00
ConstReturnTypeCheck.h [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
ContainerSizeEmptyCheck.cpp [clang-tidy] Simplify implementation of container-size-empty 2021-02-05 14:03:41 +00:00
ContainerSizeEmptyCheck.h [clang-tidy] Simplify implementation of container-size-empty 2021-02-05 14:03:41 +00:00
ConvertMemberFunctionsToStatic.cpp [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
ConvertMemberFunctionsToStatic.h [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
DeleteNullPointerCheck.cpp [clang-tidy] Simplify delete null ptr check 2021-02-17 10:18:36 +00:00
DeleteNullPointerCheck.h [clang-tidy] Simplify delete null ptr check 2021-02-17 10:18:36 +00:00
ElseAfterReturnCheck.cpp [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
ElseAfterReturnCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
FunctionCognitiveComplexityCheck.cpp Fix nits. 2021-04-12 18:46:13 +02:00
FunctionCognitiveComplexityCheck.h [clang-tidy] Add option to ignore macros in readability-function-cognitive-complexity check. 2021-04-12 18:46:12 +02:00
FunctionSizeCheck.cpp
FunctionSizeCheck.h [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
IdentifierNamingCheck.cpp [clang-tidy] Fix readability-identifer-naming duplicating prefix or suffix for replacements. 2021-03-15 14:20:48 +00:00
IdentifierNamingCheck.h [clang-tidy] Support IgnoredRegexp configuration to selectively suppress identifier naming checks 2020-11-25 01:18:44 +00:00
ImplicitBoolConversionCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
ImplicitBoolConversionCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
InconsistentDeclarationParameterNameCheck.cpp [clang-tools-extra] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
InconsistentDeclarationParameterNameCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
IsolateDeclarationCheck.cpp [clang-tools-extra] NFC: Fix trivial typo in documents and comments 2020-04-05 15:28:40 +09:00
IsolateDeclarationCheck.h [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
MagicNumbersCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 12:39:33 +01:00
MagicNumbersCheck.h [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
MakeMemberFunctionConstCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
MakeMemberFunctionConstCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
MisleadingIndentationCheck.cpp [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
MisleadingIndentationCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
MisplacedArrayIndexCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
MisplacedArrayIndexCheck.h [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
NamedParameterCheck.cpp [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
NamedParameterCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
NamespaceCommentCheck.cpp [clang-tools-extra] NFC: Fix trivial typo in documents and comments 2020-04-05 15:28:40 +09:00
NamespaceCommentCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
NonConstParameterCheck.cpp [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
NonConstParameterCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
QualifiedAutoCheck.cpp [clang-tidy][NFC] Tweak some generation of diag messages 2021-02-26 19:10:25 +00:00
QualifiedAutoCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
ReadabilityTidyModule.cpp [clang-tidy] Add 'readability-suspicious-call-argument' check 2021-07-19 10:18:09 +02:00
RedundantAccessSpecifiersCheck.cpp [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
RedundantAccessSpecifiersCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
RedundantControlFlowCheck.cpp [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
RedundantControlFlowCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
RedundantDeclarationCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
RedundantDeclarationCheck.h [clang-tidy] Implement storeOptions for checks missing it. 2020-06-21 19:01:11 +01:00
RedundantFunctionPtrDereferenceCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
RedundantFunctionPtrDereferenceCheck.h [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
RedundantMemberInitCheck.cpp [clang-tidy] Simplify redundant member init check 2021-02-27 12:11:44 +00:00
RedundantMemberInitCheck.h [clang-tidy] Simplify redundant member init check 2021-02-27 12:11:44 +00:00
RedundantPreprocessorCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
RedundantPreprocessorCheck.h [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
RedundantSmartptrGetCheck.cpp [clang-tidy] Handle uninstantiated templates in redundant get check 2021-02-27 12:08:41 +00:00
RedundantSmartptrGetCheck.h [clang-tidy] Handle uninstantiated templates in redundant get check 2021-02-27 12:08:41 +00:00
RedundantStringCStrCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
RedundantStringCStrCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
RedundantStringInitCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
RedundantStringInitCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
SimplifyBooleanExprCheck.cpp [clang-tidy] Simplify boolean expr check 2021-02-27 12:13:24 +00:00
SimplifyBooleanExprCheck.h [clang-tidy] Simplify boolean expr check 2021-02-27 12:13:24 +00:00
SimplifySubscriptExprCheck.cpp [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
SimplifySubscriptExprCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
StaticAccessedThroughInstanceCheck.cpp [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
StaticAccessedThroughInstanceCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
StaticDefinitionInAnonymousNamespaceCheck.cpp
StaticDefinitionInAnonymousNamespaceCheck.h [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
StringCompareCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
StringCompareCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
SuspiciousCallArgumentCheck.cpp [clang-tidy] Add 'readability-suspicious-call-argument' check 2021-07-19 10:18:09 +02:00
SuspiciousCallArgumentCheck.h [clang-tidy] Add 'readability-suspicious-call-argument' check 2021-07-19 10:18:09 +02:00
UniqueptrDeleteReleaseCheck.cpp [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
UniqueptrDeleteReleaseCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
UppercaseLiteralSuffixCheck.cpp [clang-tools-extra] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
UppercaseLiteralSuffixCheck.h [clang-tidy] Simplify readability checks to not need ignoring* matchers 2021-03-28 11:25:41 +01:00
UseAnyOfAllOfCheck.cpp [clang-tidy][NFC] Tweak some generation of diag messages 2021-02-26 19:10:25 +00:00
UseAnyOfAllOfCheck.h [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00