File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed
java/ql/lib/semmle/code/java/security
javascript/ql/lib/semmle/javascript/security
python/ql/lib/semmle/python/security
ruby/ql/lib/codeql/ruby/security Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -238,8 +238,13 @@ module RangePrinter {
238
238
239
239
/** Gets a char range that is overly large because of `reason`. */
240
240
RegExpCharacterRange getABadRange ( string reason , int priority ) {
241
+ result instanceof OverlyWideRange and
241
242
priority = 0 and
242
- reason = "is equivalent to " + result .( OverlyWideRange ) .printEquivalent ( )
243
+ exists ( string equiv | equiv = result .( OverlyWideRange ) .printEquivalent ( ) |
244
+ if equiv .length ( ) <= 50
245
+ then reason = "is equivalent to " + equiv
246
+ else reason = "is equivalent to " + equiv .substring ( 0 , 50 ) + "..."
247
+ )
243
248
or
244
249
priority = 1 and
245
250
exists ( RegExpCharacterRange other |
Original file line number Diff line number Diff line change @@ -238,8 +238,13 @@ module RangePrinter {
238
238
239
239
/** Gets a char range that is overly large because of `reason`. */
240
240
RegExpCharacterRange getABadRange ( string reason , int priority ) {
241
+ result instanceof OverlyWideRange and
241
242
priority = 0 and
242
- reason = "is equivalent to " + result .( OverlyWideRange ) .printEquivalent ( )
243
+ exists ( string equiv | equiv = result .( OverlyWideRange ) .printEquivalent ( ) |
244
+ if equiv .length ( ) <= 50
245
+ then reason = "is equivalent to " + equiv
246
+ else reason = "is equivalent to " + equiv .substring ( 0 , 50 ) + "..."
247
+ )
243
248
or
244
249
priority = 1 and
245
250
exists ( RegExpCharacterRange other |
Original file line number Diff line number Diff line change @@ -238,8 +238,13 @@ module RangePrinter {
238
238
239
239
/** Gets a char range that is overly large because of `reason`. */
240
240
RegExpCharacterRange getABadRange ( string reason , int priority ) {
241
+ result instanceof OverlyWideRange and
241
242
priority = 0 and
242
- reason = "is equivalent to " + result .( OverlyWideRange ) .printEquivalent ( )
243
+ exists ( string equiv | equiv = result .( OverlyWideRange ) .printEquivalent ( ) |
244
+ if equiv .length ( ) <= 50
245
+ then reason = "is equivalent to " + equiv
246
+ else reason = "is equivalent to " + equiv .substring ( 0 , 50 ) + "..."
247
+ )
243
248
or
244
249
priority = 1 and
245
250
exists ( RegExpCharacterRange other |
Original file line number Diff line number Diff line change @@ -238,8 +238,13 @@ module RangePrinter {
238
238
239
239
/** Gets a char range that is overly large because of `reason`. */
240
240
RegExpCharacterRange getABadRange ( string reason , int priority ) {
241
+ result instanceof OverlyWideRange and
241
242
priority = 0 and
242
- reason = "is equivalent to " + result .( OverlyWideRange ) .printEquivalent ( )
243
+ exists ( string equiv | equiv = result .( OverlyWideRange ) .printEquivalent ( ) |
244
+ if equiv .length ( ) <= 50
245
+ then reason = "is equivalent to " + equiv
246
+ else reason = "is equivalent to " + equiv .substring ( 0 , 50 ) + "..."
247
+ )
243
248
or
244
249
priority = 1 and
245
250
exists ( RegExpCharacterRange other |
You can’t perform that action at this time.
0 commit comments