Skip to content

Commit 3d0ecbe

Browse files
authored
Merge pull request #13361 from github/nickrolfe/csharp-location-tostring
C#: avoid calls to `Location::toString()`
2 parents b78cd48 + dadb5b3 commit 3d0ecbe

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

csharp/ql/src/Bad Practices/Implementation Hiding/ExposeRepresentation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ where
7878
exposesByStore(c, f, why, whyText)
7979
select c,
8080
"'" + c.getName() + "' exposes the internal representation stored in field '" + f.getName() +
81-
"'. The value may be modified $@.", why.getLocation(), whyText
81+
"'. The value may be modified $@.", why, whyText

csharp/ql/src/Complexity/ComplexCondition.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ where
2626
operators =
2727
count(BinaryLogicalOperation op | logicalParent*(op, e) and nontrivialLogicalOperator(op)) and
2828
operators > 3
29-
select e.getLocation(), "Complex condition: too many logical operations in this expression."
29+
select e, "Complex condition: too many logical operations in this expression."
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| ExposeRepresentation.cs:8:21:8:23 | Set | 'Set' exposes the internal representation stored in field 'rarray'. The value may be modified $@. | ExposeRepresentation.cs:16:9:16:9 | ExposeRepresentation.cs:16:9:16:9 | through the variable a |
2-
| ExposeRepresentationBad.cs:18:22:18:24 | Get | 'Get' exposes the internal representation stored in field 'rarray'. The value may be modified $@. | ExposeRepresentationBad.cs:24:23:24:29 | ExposeRepresentationBad.cs:24:23:24:29 | after this call to Get |
1+
| ExposeRepresentation.cs:8:21:8:23 | Set | 'Set' exposes the internal representation stored in field 'rarray'. The value may be modified $@. | ExposeRepresentation.cs:16:9:16:9 | access to local variable a | through the variable a |
2+
| ExposeRepresentationBad.cs:18:22:18:24 | Get | 'Get' exposes the internal representation stored in field 'rarray'. The value may be modified $@. | ExposeRepresentationBad.cs:24:23:24:29 | call to method Get | after this call to Get |

0 commit comments

Comments
 (0)