Skip to content

Commit d89c52f

Browse files
authored
Merge pull request #8403 from erik-krogh/noUpper
Rename all upper-case variables, and all lower-case modules
2 parents 3311fed + c93f29b commit d89c52f

File tree

21 files changed

+255
-118
lines changed

21 files changed

+255
-118
lines changed

java/ql/test/library-tests/frameworks/JaxWs/JaxRs.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class JaxRsTest extends InlineExpectationsTest {
5555
or
5656
tag = "ResourceMethodOnResourceClass" and
5757
exists(JaxRsResourceMethod resourceMethod |
58-
resourceMethod = any(JaxRsResourceClass ResourceClass).getAResourceMethod()
58+
resourceMethod = any(JaxRsResourceClass resourceClass).getAResourceMethod()
5959
|
6060
resourceMethod.getLocation() = location and
6161
element = resourceMethod.toString() and

java/ql/test/library-tests/structure/TypeGetCompilationUnit.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import semmle.code.java.Type
22

33
predicate typeIsInCU(Type tpe, CompilationUnit cu) { tpe.getCompilationUnit() = cu }
44

5-
from Type tpe, CompilationUnit Ajava
5+
from Type tpe, CompilationUnit aJava
66
where
7-
Ajava.hasName("A") and
8-
typeIsInCU(tpe, Ajava)
7+
aJava.hasName("A") and
8+
typeIsInCU(tpe, aJava)
99
select tpe
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
category: deprecated
3+
---
4+
* Some modules that started with a lowercase letter have been renamed to follow our style-guide.
5+
The old name still exists as a deprecated alias.

javascript/ql/lib/semmle/javascript/frameworks/Logging.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private module Winston {
123123
/**
124124
* Provides classes for working with [log4js](https://github.com/log4js-node/log4js-node).
125125
*/
126-
private module log4js {
126+
private module Log4js {
127127
/**
128128
* A call to the log4js logging mechanism.
129129
*/

javascript/ql/lib/semmle/javascript/frameworks/UriLibraries.qll

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ abstract deprecated class UriLibraryStep extends DataFlow::ValueNode {
1414
predicate step(DataFlow::Node pred, DataFlow::Node succ) { none() }
1515
}
1616

17+
/** DEPRECATED: Alias for `Urijs` */
18+
deprecated module urijs = Urijs;
19+
1720
/**
1821
* Provides classes for working with [urijs](http://medialize.github.io/URI.js/) code.
1922
*/
20-
module urijs {
23+
module Urijs {
2124
/**
2225
* Gets a data flow source node for the urijs library.
2326
*/
@@ -80,10 +83,13 @@ module urijs {
8083
}
8184
}
8285

86+
/** DEPRECATED: Alias for `Uridashjs` */
87+
deprecated module uridashjs = Uridashjs;
88+
8389
/**
8490
* Provides classes for working with [uri-js](https://github.com/garycourt/uri-js) code.
8591
*/
86-
module uridashjs {
92+
module Uridashjs {
8793
/**
8894
* Gets a data flow source node for member `name` of the uridashjs library.
8995
*/
@@ -105,10 +111,13 @@ module uridashjs {
105111
}
106112
}
107113

114+
/** DEPRECATED: Alias for `Punycode` */
115+
deprecated module punycode = Punycode;
116+
108117
/**
109118
* Provides classes for working with [punycode](https://github.com/bestiejs/punycode.js) code.
110119
*/
111-
module punycode {
120+
module Punycode {
112121
/**
113122
* Gets a data flow source node for member `name` of the punycode library.
114123
*/
@@ -130,10 +139,13 @@ module punycode {
130139
}
131140
}
132141

142+
/** DEPRECATED: Alias for `UrlParse` */
143+
deprecated module urlParse = UrlParse;
144+
133145
/**
134146
* Provides classes for working with [url-parse](https://github.com/unshiftio/url-parse) code.
135147
*/
136-
module urlParse {
148+
module UrlParse {
137149
/**
138150
* Gets a data flow source node for the url-parse library.
139151
*/
@@ -167,10 +179,13 @@ module urlParse {
167179
}
168180
}
169181

182+
/** DEPRECATED: Alias for `Querystringify` */
183+
deprecated module querystringify = Querystringify;
184+
170185
/**
171186
* Provides classes for working with [querystringify](https://github.com/unshiftio/querystringify) code.
172187
*/
173-
module querystringify {
188+
module Querystringify {
174189
/**
175190
* Gets a data flow source node for member `name` of the querystringify library.
176191
*/
@@ -197,10 +212,13 @@ module querystringify {
197212
}
198213
}
199214

215+
/** DEPRECATED: Alias for `Querydashstring` */
216+
deprecated module querydashstring = Querydashstring;
217+
200218
/**
201219
* Provides classes for working with [query-string](https://github.com/sindresorhus/query-string) code.
202220
*/
203-
module querydashstring {
221+
module Querydashstring {
204222
/**
205223
* Gets a data flow source node for member `name` of the query-string library.
206224
*/
@@ -222,10 +240,13 @@ module querydashstring {
222240
}
223241
}
224242

243+
/** DEPRECATED: Alias for `Url` */
244+
deprecated module url = Url;
245+
225246
/**
226247
* Provides classes for working with [url](https://nodejs.org/api/url.html) code.
227248
*/
228-
module url {
249+
module Url {
229250
/**
230251
* Gets a data flow source node for member `name` of the url library.
231252
*/
@@ -245,10 +266,13 @@ module url {
245266
}
246267
}
247268

269+
/** DEPRECATED: Alias for `Querystring` */
270+
deprecated module querystring = Querystring;
271+
248272
/**
249273
* Provides classes for working with [querystring](https://nodejs.org/api/querystring.html) code.
250274
*/
251-
module querystring {
275+
module Querystring {
252276
/**
253277
* Gets a data flow source node for member `name` of the querystring library.
254278
*/
@@ -408,7 +432,7 @@ private module ClosureLibraryUri {
408432
/**
409433
* Provides classes for working with [path](https://nodejs.org/api/path.html) code.
410434
*/
411-
module path {
435+
module Path {
412436
/**
413437
* A taint step in the path module.
414438
*/
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import javascript
22

3-
query predicate punycode(DataFlow::Node n) { n = punycode::punycodeMember(_) }
3+
query predicate punycode(DataFlow::Node n) { n = Punycode::punycodeMember(_) }
44

5-
query predicate querydashstring(DataFlow::Node n) { n = querydashstring::querydashstringMember(_) }
5+
query predicate querydashstring(DataFlow::Node n) { n = Querydashstring::querydashstringMember(_) }
66

7-
query predicate querystring(DataFlow::Node n) { n = querystring::querystringMember(_) }
7+
query predicate querystring(DataFlow::Node n) { n = Querystring::querystringMember(_) }
88

9-
query predicate querystringify(DataFlow::Node n) { n = querystringify::querystringifyMember(_) }
9+
query predicate querystringify(DataFlow::Node n) { n = Querystringify::querystringifyMember(_) }
1010

11-
query predicate uridashjs(DataFlow::Node n) { n = uridashjs::uridashjsMember(_) }
11+
query predicate uridashjs(DataFlow::Node n) { n = Uridashjs::uridashjsMember(_) }
1212

13-
query predicate urijs(DataFlow::Node n) { n = urijs::urijs() }
13+
query predicate urijs(DataFlow::Node n) { n = Urijs::urijs() }
1414

1515
query predicate uriLibraryStep(DataFlow::Node pred, DataFlow::Node succ) {
1616
TaintTracking::uriStep(pred, succ)
1717
}
1818

19-
query predicate url(DataFlow::Node n) { n = url::urlMember(_) }
19+
query predicate url(DataFlow::Node n) { n = Url::urlMember(_) }
2020

21-
query predicate urlParse(DataFlow::Node n) { n = urlParse::urlParse() }
21+
query predicate urlParse(DataFlow::Node n) { n = UrlParse::urlParse() }
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
category: deprecated
3+
---
4+
* Some modules that started with a lowercase letter have been renamed to follow our style-guide.
5+
The old name still exists as a deprecated alias.

python/ql/lib/semmle/python/Metrics.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class FunctionMetrics extends Function {
2727
* P = the number of connected components, which for a single function is 1.
2828
*/
2929
int getCyclomaticComplexity() {
30-
exists(int E, int N |
31-
N = count(BasicBlock b | b = this.getABasicBlock() and b.likelyReachable()) and
32-
E =
30+
exists(int e, int n |
31+
n = count(BasicBlock b | b = this.getABasicBlock() and b.likelyReachable()) and
32+
e =
3333
count(BasicBlock b1, BasicBlock b2 |
3434
b1 = this.getABasicBlock() and
3535
b1.likelyReachable() and
@@ -39,7 +39,7 @@ class FunctionMetrics extends Function {
3939
not b1.unlikelySuccessor(b2)
4040
)
4141
|
42-
result = E - N + 2
42+
result = e - n + 2
4343
)
4444
}
4545

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPrivate.qll

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ predicate isArgumentNode(ArgumentNode arg, DataFlowCall c, ArgumentPosition pos)
3939
//--------
4040
predicate isExpressionNode(ControlFlowNode node) { node.getNode() instanceof Expr }
4141

42+
/** DEPRECATED: Alias for `SyntheticPreUpdateNode` */
43+
deprecated module syntheticPreUpdateNode = SyntheticPreUpdateNode;
44+
4245
/** A module collecting the different reasons for synthesising a pre-update node. */
43-
module syntheticPreUpdateNode {
46+
module SyntheticPreUpdateNode {
4447
class SyntheticPreUpdateNode extends Node, TSyntheticPreUpdateNode {
4548
NeedsSyntheticPreUpdateNode post;
4649

@@ -78,10 +81,13 @@ module syntheticPreUpdateNode {
7881
CfgNode objectCreationNode() { result.getNode().(CallNode) = any(ClassCall c).getNode() }
7982
}
8083

81-
import syntheticPreUpdateNode
84+
import SyntheticPreUpdateNode
85+
86+
/** DEPRECATED: Alias for `SyntheticPostUpdateNode` */
87+
deprecated module syntheticPostUpdateNode = SyntheticPostUpdateNode;
8288

8389
/** A module collecting the different reasons for synthesising a post-update node. */
84-
module syntheticPostUpdateNode {
90+
module SyntheticPostUpdateNode {
8591
/** A post-update node is synthesized for all nodes which satisfy `NeedsSyntheticPostUpdateNode`. */
8692
class SyntheticPostUpdateNode extends PostUpdateNode, TSyntheticPostUpdateNode {
8793
NeedsSyntheticPostUpdateNode pre;
@@ -177,7 +183,7 @@ module syntheticPostUpdateNode {
177183
}
178184
}
179185

180-
import syntheticPostUpdateNode
186+
import SyntheticPostUpdateNode
181187

182188
class DataFlowExpr = Expr;
183189

0 commit comments

Comments
 (0)