Commit Graph

70 Commits

Author SHA1 Message Date
erik-krogh
cc7a9ef97a rename more acronyms 2022-08-25 20:52:27 +02:00
erik-krogh
d96d6721ba change the alert message of unused-local-variable 2022-08-23 11:15:11 +02:00
erik-krogh
698ccd8850 update {cpp/java}/unused-local to match python 2022-08-22 21:41:45 +02:00
erik-krogh
5a312cd0da update cpp/complex-block to match java/csharp 2022-08-22 21:41:45 +02:00
erik-krogh
b1c9843d15 update {cs/cpp}/empty-block so they have the same alert message 2022-08-22 21:41:45 +02:00
Jeroen Ketema
ebbd9c5b90 C++: Handle C++17 if initializers 2022-05-12 12:56:50 +02:00
Jeroen Ketema
d19504fca2 C++: Add cpp/unused-local-variable test case with switch initializer
This is similar to the test case with the `if` initializer, and we should
not forget about it once we support `if` initialization.
2022-04-05 18:27:53 +02:00
Jeroen Ketema
4f49f9d6e1 C++: Remove exception from cpp/unused-local-variable that is no longer needed 2022-04-01 18:32:46 +02:00
Jeroen Ketema
423d325204 C++: Simplify cpp/declaration-hides-variable
The check for `(unnamed local variable)` is no longer needed, because these
variables are now identified as being compiler generated.
2022-02-22 23:04:48 +01:00
Jeroen Ketema
9194af9b15 Do not report "Declaration hides variable" for unnamed variables 2022-01-26 15:10:37 +01:00
Mathias Vorreiter Pedersen
4765772725 C++: Fix performance of 'cpp/unused-static-function'. 2021-12-06 16:41:10 +00:00
Erik Krogh Kristensen
d36c66cfca remove redundant inline casts in arguments where the type is inferred by the call target 2021-10-29 14:37:56 +02:00
Erik Krogh Kristensen
e75448ebb0 remove redundant inline casts 2021-10-28 16:35:53 +02:00
Geoffrey White
d990e790e7 C++: Remove unused index.qhelp files. 2021-10-27 15:40:34 +01:00
Geoffrey White
2e61ae244a C++: Set literals. 2021-10-13 16:12:36 +01:00
Calum Grant
771e686946 Update security-severity scores 2021-06-15 13:25:17 +01:00
Calum Grant
a594afb828 Add security-severity metadata 2021-06-10 20:11:08 +01:00
Chris Smowton
455b840712 Fix all dead qhelp links
For those documents with no obvious new home I've pointed the links to the Internet Archive.
2021-04-23 15:20:21 +01:00
Geoffrey White
998eaf90ee C++: Run through updated autoformat. 2020-12-04 18:53:24 +00:00
Geoffrey White
13d9d5dc45 C++: Use [,] more in general. 2020-12-03 18:50:43 +00:00
Anders Schack-Mulligen
8f2094f0bf Autoformat. 2020-11-30 14:42:38 +01:00
Jonas Jensen
8069e7b031 C++: Downgrade two queries to recommendation
The `cpp/local-variable-hides-global-variable` doesn't seem right as a
warning without some additional context. For example, is the local
variable and the global variable used in the same function body, and
do they have similar enough types that it would be possible to confuse
them.

The `cpp/missing-header-guard` query enforces good style and helps with
compilation speed, but AFAIK it has never flagged a correctness issue.
Therefore I think it should be a recommendation.
2020-11-27 10:45:03 +01:00
Geoffrey White
498177ce02 C++: Autoformat. 2020-11-12 13:30:58 +00:00
Geoffrey White
2aa6ff6239 C++: Add comments about the temporary exclusions. 2020-11-11 17:33:16 +00:00
Geoffrey White
e9bde9b711 C++: Work around issue with ConditionalDeclExpr. 2020-11-02 15:46:38 +00:00
Geoffrey White
79bda0055c C++: Work around issue with 'Unknown literal'. 2020-11-02 15:46:36 +00:00
Mathias Vorreiter Pedersen
d0dd71ba10 Apply suggestions from code review
Co-authored-by: hubwriter <54933897+hubwriter@users.noreply.github.com>
2020-10-22 12:53:35 +02:00
Mathias Vorreiter Pedersen
056a553976 C++: Fix broken qhelp links 2020-10-21 17:26:46 +02:00
Jonas Jensen
ab90f06ddf C++: Rename Block -> BlockStmt 2020-09-08 08:40:20 +02:00
Geoffrey White
156a174cf4 C++: Add explanation. 2020-09-04 14:55:55 +01:00
Geoffrey White
96098c5244 C++: Simplify getConstructedFrom. 2020-09-04 14:52:01 +01:00
Geoffrey White
1d04c89927 C++: Autoformat. 2020-09-03 18:54:36 +01:00
Geoffrey White
2d7552358b C++: Put in a better fix. 2020-09-03 18:51:57 +01:00
Geoffrey White
a1c7fd8fec C++: Remove the workaround for CPP-331. 2020-09-03 18:51:21 +01:00
Anders Schack-Mulligen
96e4a57edd C++: Autoformat. 2020-01-29 13:11:50 +01:00
Geoffrey White
c1be4c78af C++: Add tags to the leap year + japanese era queries. 2019-12-17 10:14:20 +00:00
Geoffrey White
acb011de04 CPP: Reduce precision of JapaneseEraDate.ql. 2019-12-13 08:40:58 +00:00
Rachel Mant
413f49bba5 Query cpp/unused-static-variable was producing incorrect results for constexpr variables 2019-10-31 22:50:44 +00:00
Jonas Jensen
4ef5c9af62 C++: Autoformat everything
Some files that will change in #1736 have been spared.

    ./build -j4 target/jars/qlformat
    find ql/cpp/ql -name "*.ql"  -print0 | xargs -0 target/jars/qlformat --input
    find ql/cpp/ql -name "*.qll" -print0 | xargs -0 target/jars/qlformat --input
    (cd ql && git checkout 'cpp/ql/src/semmle/code/cpp/ir/implementation/**/*SSA*.qll')
    buildutils-internal/scripts/pr-checks/sync-identical-files.py --latest
2019-09-09 11:25:53 +02:00
Geoffrey White
3a3bef3a03 CPP: Add the new Japanese era. 2019-09-03 18:28:24 +01:00
Geoffrey White
7c14c68486 CPP: Add a new, combined Japanese era query. 2019-08-29 17:47:42 +01:00
Geoffrey White
d1093cae2e CPP: Delete invalid URL and strange comment. 2019-08-07 09:25:36 +01:00
Jonas Jensen
8d3cb78a9d C++: Fix DeclarationHidesVariable FP
We don't want alerts about the compiler-generated variables that appear
in the desugaring of range-based `for`.
2019-07-05 20:39:43 +02:00
Robert Marsh
dbdaa1d3f3 C++: Replace getUnderlyingType().getUnspecifiedType() 2019-05-20 15:23:08 +01:00
Jonas Jensen
29aa5f550c C++: Tidy up code so it looks good after qlformat 2019-04-12 10:43:24 +02:00
Jonas Jensen
6049c2ccfd C++: Autoformat Architecture + Best Practices 2019-04-11 14:27:07 +02:00
Geoffrey White
96136a1c55 CPP: Change SloppyGlobal.ql to a recommendation. 2019-04-02 12:18:22 +01:00
Jonas Jensen
b65e2f8b79 C++: Put QLDoc on two helper predicates 2019-01-11 14:07:22 +01:00
Jonas Jensen
b38ca944f4 C++: Work around CPP-331
This change suppresses results from "Declaration hides parameter" where
the ParameterDeclarationEntry does not link up to the right
FunctionDeclarationEntry.
2019-01-11 11:26:43 +01:00
Jonas Jensen
2268f1fee6 C++: Speed up "Declaration hides parameter"
Bad magic ended up in `LocalVariable.getFunction` and effectively
created a Cartesian product. Before this change, the timing looked like
this:

    Variable::LocalVariable::getFunction_dispred#bb ... 50.1s
    #select#cpe#123#fff ............................... 20.6s

After this change, those predicates become much faster:

    Variable::LocalVariable::getFunction_dispred#ff ... 121ms
    DeclarationHidesParameter::localVariableNames#fff . 77ms
    #select#cpe#123#fff ............................... 28ms

Introducing the predicate `localVariableNames` ensures that we can do
the main join on two columns simultaneously, so that's a change we
should keep even if we remove the `pragma[nomagic]` later.
2019-01-11 11:06:18 +01:00