Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/codeql/nightly/AccountVTableMismatch.ql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @kind problem
* @problem.severity warning
* @precision high
* @id asymmetric-research/account-meta-deref-before-modify
* @id asymmetric-research/account-vtable-mismatch
*/

import cpp
Expand Down
23 changes: 23 additions & 0 deletions contrib/codeql/nightly/SwappedParameters.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* @name Swapped Parameters
* @description Detects cases where the parameters of a function are
* swapped between the function definition and the function
* implementation. If the both parameters are the same type and have the
* the compiler will not warn about it, but this confusion can easily
* lead to bugs.
* @kind problem
* @problem.severity warning
* @precision high
* @id asymmetric-research/swapped-parameters
*/

import cpp
import filter

from Function f, ParameterDeclarationEntry defP, Parameter implP
where included(f.getLocation()) and
implP = f.getAParameter() and
defP = f.getADeclarationEntry().getAParameterDeclarationEntry() and
defP.getName() = implP.getName() and
defP.getIndex() != implP.getIndex()
select defP, "Parameter " + defP.getName() + " is swapped with parameter " + implP.getName() + " in function " + f.getName() + "."
Loading