Skip to content

Commit e891289

Browse files
committed
Fix some violations of ql/misspelling.
1 parent 2f0a0db commit e891289

File tree

37 files changed

+75
-52
lines changed

37 files changed

+75
-52
lines changed

actions/ql/lib/codeql/actions/Ast.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class If extends AstNode instanceof IfImpl {
261261
}
262262

263263
/**
264-
* An Environemnt node representing a deployment environment.
264+
* An Environment node representing a deployment environment.
265265
*/
266266
class Environment extends AstNode instanceof EnvironmentImpl {
267267
string getName() { result = super.getName() }

cpp/ql/lib/experimental/cryptography/CryptoArtifact.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ abstract class CryptographicAlgorithm extends CryptographicArtifact {
127127
/**
128128
* Normalizes a raw name into a normalized name as found in `CryptoAlgorithmNames.qll`.
129129
* Subclassess should override for more api-specific normalization.
130-
* By deafult, converts a raw name to upper-case with no hyphen, underscore, hash, or space.
130+
* By default, converts a raw name to upper-case with no hyphen, underscore, hash, or space.
131131
*/
132132
bindingset[s]
133133
string normalizeName(string s) {

cpp/ql/lib/experimental/cryptography/utils/OpenSSL/CryptoFunction.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private string privateNormalizeFunctionName(Function f, string algType) {
5959
*
6060
* The predicate attempts to restrict normalization to what looks like an openssl
6161
* library by looking for functions only in an openssl path (see `isPossibleOpenSSLFunction`).
62-
* This may give false postive functions if a directory erronously appears to be openssl;
62+
* This may give false positive functions if a directory erronously appears to be openssl;
6363
* however, we take the stance that if a function
6464
* exists strongly mapping to a known function name in a directory such as these,
6565
* regardless of whether its actually a part of openSSL or not, we will analyze it as though it were.

cpp/ql/lib/experimental/cryptography/utils/OpenSSL/DataBuilders.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private string privateNormalizeFunctionName(Function f, string algType) {
4949
*
5050
* The predicate attempts to restrict normalization to what looks like an openssl
5151
* library by looking for functions only in an openssl path (see `isPossibleOpenSSLFunction`).
52-
* This may give false postive functions if a directory erronously appears to be openssl;
52+
* This may give false positive functions if a directory erronously appears to be openssl;
5353
* however, we take the stance that if a function
5454
* exists strongly mapping to a known function name in a directory such as these,
5555
* regardless of whether its actually a part of openSSL or not, we will analyze it as though it were.

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ class TranslatedReturnVoidStmt extends TranslatedReturnStmt {
601601
* The IR translation of an implicit `return` statement generated by the extractor to handle control
602602
* flow that reaches the end of a non-`void`-returning function body. Such control flow
603603
* produces undefined behavior in C++ but not in C. However even in C using the return value is
604-
* undefined behaviour. We make it return uninitialized memory to get as much flow as possible.
604+
* undefined behavior. We make it return uninitialized memory to get as much flow as possible.
605605
*/
606606
class TranslatedNoValueReturnStmt extends TranslatedReturnStmt, TranslatedVariableInitialization {
607607
TranslatedNoValueReturnStmt() {

cpp/ql/lib/semmle/code/cpp/security/boostorg/asio/protocols.qll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,16 @@ module BoostorgAsio {
191191
class SslContextClass extends Class {
192192
SslContextClass() { this.getQualifiedName() = "boost::asio::ssl::context" }
193193

194-
ConstructorCall getAContructorCall() {
194+
ConstructorCall getAConstructorCall() {
195195
this.getAConstructor().getACallToThisFunction() = result and
196196
not result.getLocation().getFile().toString().matches("%/boost/asio/%") and
197197
result.fromSource()
198198
}
199+
200+
/**
201+
* DEPRECATED: Use `getAConstructorCall` instead.
202+
*/
203+
deprecated ConstructorCall getAContructorCall() { result = this.getAConstructorCall() }
199204
}
200205

201206
/**
@@ -368,7 +373,7 @@ module BoostorgAsio {
368373
*/
369374
default predicate isSink(DataFlow::Node sink) {
370375
exists(ConstructorCall cc, SslContextClass c, Expr e | e = sink.asExpr() |
371-
c.getAContructorCall() = cc and
376+
c.getAConstructorCall() = cc and
372377
cc.getArgument(0) = e
373378
)
374379
}
@@ -468,7 +473,7 @@ module BoostorgAsio {
468473
predicate isSource(DataFlow::Node source) {
469474
exists(SslContextClass c, ConstructorCall cc |
470475
cc = source.asExpr() and
471-
c.getAContructorCall() = cc
476+
c.getAConstructorCall() = cc
472477
)
473478
}
474479

cpp/ql/src/Best Practices/Magic Constants/MagicConstants.qll

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,17 @@ predicate valueOccurrenceCount(string value, int n) {
164164
n > 20
165165
}
166166

167-
predicate occurenceCount(Literal lit, string value, int n) {
167+
predicate occurrenceCount(Literal lit, string value, int n) {
168168
valueOccurrenceCount(value, n) and
169169
value = lit.getValue() and
170170
nonTrivialValue(_, lit)
171171
}
172172

173+
/**
174+
* DEPRECATED: Use `occurrenceCount` instead.
175+
*/
176+
deprecated predicate occurenceCount = occurrenceCount/3;
177+
173178
/*
174179
* Literals repeated frequently
175180
*/
@@ -178,7 +183,7 @@ predicate check(Literal lit, string value, int n, File f) {
178183
// Check that the literal is nontrivial
179184
not trivial(lit) and
180185
// Check that it is repeated a number of times
181-
occurenceCount(lit, value, n) and
186+
occurrenceCount(lit, value, n) and
182187
n > 20 and
183188
f = lit.getFile() and
184189
// Exclude generated files

cpp/ql/src/Likely Bugs/Leap Year/LeapYear.qll

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,18 @@ abstract class LeapYearFieldAccess extends YearFieldAccess {
128128
/**
129129
* Holds if the top-level binary operation includes an addition or subtraction operator with an operand specified by `valueToCheck`.
130130
*/
131-
predicate additionalAdditionOrSubstractionCheckForLeapYear(int valueToCheck) {
131+
predicate additionalAdditionOrSubtractionCheckForLeapYear(int valueToCheck) {
132132
additionalLogicalCheck(this, "+", valueToCheck) or
133133
additionalLogicalCheck(this, "-", valueToCheck)
134134
}
135135

136+
/**
137+
* DEPRECATED: Use `additionalAdditionOrSubtractionCheckForLeapYear` instead.
138+
*/
139+
deprecated predicate additionalAdditionOrSubstractionCheckForLeapYear(int valueToCheck) {
140+
this.additionalAdditionOrSubtractionCheckForLeapYear(valueToCheck)
141+
}
142+
136143
/**
137144
* Holds if this object is used on a modulus 4 operation, which would likely indicate the start of a leap year check.
138145
*/
@@ -180,13 +187,13 @@ class StructTmLeapYearFieldAccess extends LeapYearFieldAccess {
180187
this.additionalModulusCheckForLeapYear(100) and
181188
// tm_year represents years since 1900
182189
(
183-
this.additionalAdditionOrSubstractionCheckForLeapYear(1900)
190+
this.additionalAdditionOrSubtractionCheckForLeapYear(1900)
184191
or
185192
// some systems may use 2000 for 2-digit year conversions
186-
this.additionalAdditionOrSubstractionCheckForLeapYear(2000)
193+
this.additionalAdditionOrSubtractionCheckForLeapYear(2000)
187194
or
188195
// converting from/to Unix epoch
189-
this.additionalAdditionOrSubstractionCheckForLeapYear(1970)
196+
this.additionalAdditionOrSubtractionCheckForLeapYear(1970)
190197
)
191198
}
192199
}

cpp/ql/src/Likely Bugs/Protocols/TlsSettingsMisconfiguration.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import cpp
1414
import semmle.code.cpp.security.boostorg.asio.protocols
1515

1616
predicate isSourceImpl(DataFlow::Node source, ConstructorCall cc) {
17-
exists(BoostorgAsio::SslContextClass c | c.getAContructorCall() = cc and cc = source.asExpr())
17+
exists(BoostorgAsio::SslContextClass c | c.getAConstructorCall() = cc and cc = source.asExpr())
1818
}
1919

2020
predicate isSinkImpl(DataFlow::Node sink, FunctionCall fcSetOptions) {

cpp/ql/src/definitions.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ where
1313
def = definitionOf(e, kind) and
1414
// We need to exclude definitions for elements inside template instantiations,
1515
// as these often lead to multiple links to definitions from the same source location.
16-
// LGTM does not support this behaviour.
16+
// LGTM does not support this behavior.
1717
not e.isFromTemplateInstantiation(_)
1818
select e, def, kind

0 commit comments

Comments
 (0)