GeezerVison is showing github.com — Python: Add `toString` information for all classes without such. · github/codeql@c525ab3
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: python/ql/src/external/CodeDuplication.qll +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -93,7 +93,7 @@ class Copy extends @duplication_or_similarity |
93 | 93 | } |
94 | 94 |
|
95 | 95 | /** Gets a textual representation of this element. */ |
96 | | - string toString() { none() } |
| 96 | + string toString() { result = "Copy" } |
97 | 97 |
|
98 | 98 | /** |
99 | 99 | * Gets a block that extends this one, that is, its first token is also |
|
Collapse file
Copy file name to clipboardExpand all lines: python/ql/src/semmle/python/Exprs.qll +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -419,7 +419,7 @@ abstract class Num extends Num_, ImmutableLiteral { |
419 | 419 |
|
420 | 420 | /* We want to declare this abstract, but currently we cannot. */ |
421 | 421 | override string toString() { |
422 | | - none() |
| 422 | + result = "Num with missing toString" |
423 | 423 | } |
424 | 424 |
|
425 | 425 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: python/ql/src/semmle/python/Keywords.qll +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -60,7 +60,7 @@ abstract class DictUnpackingOrKeyword extends DictItem { |
60 | 60 | abstract Expr getValue(); |
61 | 61 |
|
62 | 62 | override string toString() { |
63 | | - none() |
| 63 | + result = "DictUnpackingOrKeyword with missing toString" |
64 | 64 | } |
65 | 65 |
|
66 | 66 | } |
@@ -70,7 +70,7 @@ abstract class DictDisplayItem extends DictItem { |
70 | 70 | abstract Expr getValue(); |
71 | 71 |
|
72 | 72 | override string toString() { |
73 | | - none() |
| 73 | + result = "DictDisplayItem with missing toString" |
74 | 74 | } |
75 | 75 |
|
76 | 76 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: python/ql/src/semmle/python/pointsto/PointsTo.qll +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,7 +13,7 @@ library class CfgOrigin extends @py_object { |
13 | 13 |
|
14 | 14 | string toString() { |
15 | 15 | /* Not to be displayed */ |
16 | | - none() |
| 16 | + result = "CfgOrigin" |
17 | 17 | } |
18 | 18 |
|
19 | 19 | /** Get a `ControlFlowNode` from `this` or `here`. |
@@ -68,7 +68,7 @@ module CfgOrigin { |
68 | 68 | // |
69 | 69 | // string toString() { |
70 | 70 | // /* Not to be displayed */ |
71 | | -// none() |
| 71 | +// result = "CfgOrigin" |
72 | 72 | // } |
73 | 73 | // |
74 | 74 | // /** Get a `ControlFlowNode` from `this` or `here`. |
|
Collapse file
Copy file name to clipboardExpand all lines: python/ql/src/semmle/python/types/Extensions.qll +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,7 +20,7 @@ import semmle.python.objects.ObjectInternal |
20 | 20 |
|
21 | 21 | abstract class PointsToExtension extends @py_flow_node { |
22 | 22 |
|
23 | | - string toString() { none() } |
| 23 | + string toString() { result = "PointsToExtension with missing toString" } |
24 | 24 |
|
25 | 25 | abstract predicate pointsTo(Context context, ObjectInternal value, ControlFlowNode origin); |
26 | 26 |
|
@@ -36,7 +36,7 @@ abstract class PointsToExtension extends @py_flow_node { |
36 | 36 | /** DEPRECATED -- Use PointsToExtension instead */ |
37 | 37 | deprecated abstract class CustomPointsToFact extends @py_flow_node { |
38 | 38 |
|
39 | | - string toString() { none() } |
| 39 | + string toString() { result = "CustomPointsToFact with missing toString" } |
40 | 40 |
|
41 | 41 | abstract predicate pointsTo(Context context, Object value, ClassObject cls, ControlFlowNode origin); |
42 | 42 |
|
|