File tree Expand file tree Collapse file tree 5 files changed +20
-20
lines changed
javascript/ql/test/query-tests/Statements
InconsistentLoopOrientation
SuspiciousUnusedLoopIterationVariable Expand file tree Collapse file tree 5 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ while(c){ // $ Alert
77 break ;
88}
99
10- function f ( ) { // $ Alert
11- for ( ; k < numprecincts ; ) {
10+ function f ( ) {
11+ for ( ; k < numprecincts ; ) { // $ Alert
1212 var packet = createPacket ( resolution , k , l ) ;
1313 k ++ ;
1414 return packet ;
Original file line number Diff line number Diff line change 1- function f ( ) { // $ Alert
2- if ( foo ( ) )
1+ function f ( ) {
2+ if ( foo ( ) ) // $ Alert
33 return true ;
44}
55
@@ -95,12 +95,12 @@ function t(n) {
9595 } while ( "true" ) ;
9696}
9797
98- var u = function ( ) { // $ Alert
99- if ( foo ( ) )
98+ var u = function ( ) {
99+ if ( foo ( ) ) // $ Alert
100100 return true ;
101101} ;
102102
103- function v ( b ) { // $ Alert
104- if ( b )
103+ function v ( b ) {
104+ if ( b ) // $ Alert
105105 return 1 ;
106106}
Original file line number Diff line number Diff line change 22for ( j = i - 1 ; j >= 0 ; -- j ) {
33}
44
5- for ( j = i + 1 ; j < strLength ; -- j ) { // $ Alert
6- }
5+ for ( j = i + 1 ; j < strLength ; -- j ) {
6+ } // $ Alert
77
8- for ( var i = 0 , l = c . length ; i > l ; i ++ ) { // $ Alert
9- }
8+ for ( var i = 0 , l = c . length ; i > l ; i ++ ) {
9+ } // $ Alert
1010
1111
1212for ( i = lower - 1 ; i >= 0 ; -- i )
1313 a [ i ] = 0 ;
1414
15- for ( i = upper + 1 ; i < a . length ; -- i ) // $ Alert
16- a [ i ] = 0 ;
15+ for ( i = upper + 1 ; i < a . length ; -- i )
16+ a [ i ] = 0 ; // $ Alert
Original file line number Diff line number Diff line change 1- function f ( x ) { // $ Alert
2- return x = 23 ;
1+ function f ( x ) {
2+ return x = 23 ; // $ Alert
33}
44
5- function g ( ) { // $ Alert
5+ function g ( ) {
66 var x ;
7- return x = 23 ;
7+ return x = 23 ; // $ Alert
88}
99
1010
Original file line number Diff line number Diff line change 1- function countOccurrences ( xs , p ) { // $ Alert
1+ function countOccurrences ( xs , p ) {
22 var count = 0 ;
3- for ( let x of xs )
3+ for ( let x of xs ) // $ Alert
44 if ( p ( ) )
55 ++ count ;
66 return count ;
You can’t perform that action at this time.
0 commit comments