mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
C++: Mark FPs that are hard to solve w/o source code
This commit is contained in:
@@ -88,25 +88,25 @@ int test(int i, int j, int (*foo)(int), int (*bar)(int, int))
|
||||
|
||||
// Mixed tabs and spaces (ugly case):
|
||||
|
||||
for (i = 0, // GOOD if tab >= 4 spaces else BAD
|
||||
for (i = 0, // GOOD if tab >= 4 spaces else BAD -- can't exclude w/o source code text :/
|
||||
j = 0;
|
||||
i + j < 10;
|
||||
i++, // GOOD if tab >= 4 spaces else BAD
|
||||
i++, // GOOD if tab >= 4 spaces else BAD -- can't exclude w/o source code text :/
|
||||
j++);
|
||||
|
||||
if (i)
|
||||
(void)i, // GOOD if tab >= 4 spaces else BAD
|
||||
(void)i, // GOOD if tab >= 4 spaces else BAD -- can't exclude w/o source code text :/
|
||||
(void)j;
|
||||
|
||||
// One char difference (common but borderline):
|
||||
|
||||
for (i = 0, // GOOD? [FALSE POSITIVE]
|
||||
for (i = 0, // GOOD? [FALSE POSITIVE] -- can't exclude w/o source code text :/
|
||||
j = 1;
|
||||
i + j < 10;
|
||||
i++, j++);
|
||||
|
||||
for (i = 0,
|
||||
j = 1; i < 10; i += 2, // GOOD? [FALSE POSITIVE]
|
||||
j = 1; i < 10; i += 2, // GOOD? [FALSE POSITIVE] -- can't exclude w/o source code text :/
|
||||
j++) {}
|
||||
|
||||
// LHS ends on same line RHS begins on:
|
||||
@@ -119,7 +119,7 @@ int test(int i, int j, int (*foo)(int), int (*bar)(int, int))
|
||||
|
||||
if (foo(j))
|
||||
return i++
|
||||
, i++ // GOOD(?) [FALSE POSITIVE]
|
||||
, i++ // GOOD(?) [FALSE POSITIVE] -- can't exclude w/o source code text :/
|
||||
? 1
|
||||
: 2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user