File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed
javascript/ql/lib/semmle/javascript/security
java/ql/lib/semmle/code/java/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 {
238238
239239/** Gets a char range that is overly large because of `reason`. */
240240RegExpCharacterRange getABadRange ( string reason , int priority ) {
241+ result instanceof OverlyWideRange and
241242 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+ )
243248 or
244249 priority = 1 and
245250 exists ( RegExpCharacterRange other |
Original file line number Diff line number Diff line change @@ -238,8 +238,13 @@ module RangePrinter {
238238
239239/** Gets a char range that is overly large because of `reason`. */
240240RegExpCharacterRange getABadRange ( string reason , int priority ) {
241+ result instanceof OverlyWideRange and
241242 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+ )
243248 or
244249 priority = 1 and
245250 exists ( RegExpCharacterRange other |
Original file line number Diff line number Diff line change @@ -238,8 +238,13 @@ module RangePrinter {
238238
239239/** Gets a char range that is overly large because of `reason`. */
240240RegExpCharacterRange getABadRange ( string reason , int priority ) {
241+ result instanceof OverlyWideRange and
241242 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+ )
243248 or
244249 priority = 1 and
245250 exists ( RegExpCharacterRange other |
Original file line number Diff line number Diff line change @@ -238,8 +238,13 @@ module RangePrinter {
238238
239239/** Gets a char range that is overly large because of `reason`. */
240240RegExpCharacterRange getABadRange ( string reason , int priority ) {
241+ result instanceof OverlyWideRange and
241242 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+ )
243248 or
244249 priority = 1 and
245250 exists ( RegExpCharacterRange other |
You can’t perform that action at this time.
0 commit comments