Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ql/extractor/src/extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ struct Visitor<'a> {
schema: &'a NodeTypeMap,
/// A stack for gathering information from child nodes. Whenever a node is
/// entered the parent's [Label], child counter, and an empty list is pushed.
/// All children append their data to the the list. When the visitor leaves a
/// All children append their data to the list. When the visitor leaves a
/// node the list containing the child data is popped from the stack and
/// matched against the dbscheme for the node. If the expectations are met
/// the corresponding row definitions are added to the trap_output.
Expand Down
2 changes: 1 addition & 1 deletion ql/node-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub enum FieldTypeInfo {
},

/// The field can be one of several tokens, so the db type will be an `int`
/// with a `case @foo.kind` for each possiblity.
/// with a `case @foo.kind` for each possibility.
ReservedWordInt(BTreeMap<String, (usize, String)>),
}

Expand Down
8 changes: 4 additions & 4 deletions ql/ql/src/codeql_ql/ast/Ast.qll
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ class Class extends TClass, TypeDeclaration, ModuleDeclaration {
override string getName() { result = cls.getName().getValue() }

/**
* Gets the charateristic predicate for this class.
* Gets the characteristic predicate for this class.
*/
CharPred getCharPred() { toQL(result) = cls.getChild(_).(QL::ClassMember).getChild(_) }

Expand Down Expand Up @@ -1009,7 +1009,7 @@ class NewTypeBranch extends TNewTypeBranch, Predicate, TypeDeclaration {
class Call extends TCall, Expr, Formula {
/** Gets the `i`th argument of this call. */
Expr getArgument(int i) {
none() // overridden in sublcasses.
none() // overridden in subclasses.
}

/** Gets an argument of this call, if any. */
Expand Down Expand Up @@ -2507,10 +2507,10 @@ module YAML {
deprecated class YAMLNode = YamlNode;

/** A YAML comment. */
class YamlComment extends TYamlCommemt, YamlNode {
class YamlComment extends TYamlComment, YamlNode {
Yaml::Comment yamlcomment;

YamlComment() { this = TYamlCommemt(yamlcomment) }
YamlComment() { this = TYamlComment(yamlcomment) }

override string getAPrimaryQlClass() { result = "YamlComment" }
}
Expand Down
6 changes: 3 additions & 3 deletions ql/ql/src/codeql_ql/ast/internal/AstNodes.qll
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ newtype TAstNode =
TPredicateExpr(QL::PredicateExpr pe) or
TAnnotation(QL::Annotation annot) or
TAnnotationArg(QL::AnnotArg arg) or
TYamlCommemt(Yaml::Comment yc) or
TYamlComment(Yaml::Comment yc) or
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully not a problem

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a problem.
We don't need to follow any kind of deprecation policy inside the ql/ folder, as it's not part of any product.

We should be good as long as the CI passes.

TYamlEntry(Yaml::Entry ye) or
TYamlKey(Yaml::Key yk) or
TYamlListitem(Yaml::Listitem yli) or
Expand All @@ -86,7 +86,7 @@ class TCall = TPredicateCall or TMemberCall or TNoneCall or TAnyCall;

class TTypeRef = TImport or TModuleExpr or TType;

class TYamlNode = TYamlCommemt or TYamlEntry or TYamlKey or TYamlListitem or TYamlValue;
class TYamlNode = TYamlComment or TYamlEntry or TYamlKey or TYamlListitem or TYamlValue;

class TSignatureExpr = TPredicateExpr or TType or TModuleExpr;

Expand Down Expand Up @@ -125,7 +125,7 @@ private QL::AstNode toQLExpr(AST::AstNode n) {
}

Yaml::AstNode toGenerateYaml(AST::AstNode n) {
n = TYamlCommemt(result) or
n = TYamlComment(result) or
n = TYamlEntry(result) or
n = TYamlKey(result) or
n = TYamlListitem(result) or
Expand Down
4 changes: 2 additions & 2 deletions ql/ql/src/codeql_ql/ast/internal/Builtins.qll
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ predicate isBuiltinMember(string qual, string ret, string name, string args) {
}

module BuiltinsConsistency {
query predicate noBuildinParse(string sig) {
query predicate noBuiltinParse(string sig) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and similarly

isBuiltinMember(sig) and
not exists(sig.regexpCapture("(\\w+) (\\w+)\\.(\\w+)\\(([\\w, ]*)\\)", _))
}

query predicate noBuildinClasslessParse(string sig) {
query predicate noBuiltinClasslessParse(string sig) {
isBuiltinClassless(sig) and
not exists(sig.regexpCapture("(\\w+) (\\w+)\\(([\\w, ]*)\\)", _))
}
Expand Down
4 changes: 2 additions & 2 deletions ql/ql/src/codeql_ql/ast/internal/Module.qll
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private module Cached {

pragma[noinline]
private predicate resolveModuleRefHelper(TypeRef me, ContainerOrModule enclosing, string name) {
// The scope is all enclosing modules, the immidiatly containing folder, not the parent folders.
// The scope is all enclosing modules, the immediately containing folder, not the parent folders.
enclosing = getEnclosingModuleNoFolderStep*(getStartModule(me)) and
name = [me.(ModuleExpr).getName(), me.(TypeExpr).getClassName()] and
not exists(me.(ModuleExpr).getQualifier()) and
Expand Down Expand Up @@ -313,7 +313,7 @@ private predicate definesModule(
m = TModule(any(Module mod | public = getPublicBool(mod)))
)
or
// signature module in a paramertized module
// signature module in a parameterized module
exists(Module mod, SignatureExpr sig, TypeRef ty, int i |
mod = container.asModule() and
mod.hasParameter(i, name, sig) and
Expand Down
4 changes: 2 additions & 2 deletions ql/ql/src/codeql_ql/ast/internal/Predicate.qll
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private module Cached {
)
}

private predicate resolveBuildinPredicateCall(PredicateCall call, BuiltinClassless pred) {
private predicate resolveBuiltinPredicateCall(PredicateCall call, BuiltinClassless pred) {
call.getNumberOfArguments() = pred.getArity() and
call.getPredicateName() = pred.getName()
}
Expand All @@ -167,7 +167,7 @@ private module Cached {
resolvePredicateCall(c, p)
or
not resolvePredicateCall(c, _) and
resolveBuildinPredicateCall(c, p)
resolveBuiltinPredicateCall(c, p)
or
resolveMemberCall(c, p)
or
Expand Down
2 changes: 1 addition & 1 deletion ql/ql/src/codeql_ql/dataflow/DataFlow.qll
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AstNodeNode extends Node, MkAstNodeNode {
}

/**
* Gets the data-flow node correspoinding to the given AST node.
* Gets the data-flow node corresponding to the given AST node.
*/
pragma[inline]
Node astNode(AstNode node) { result = MkAstNodeNode(node) }
Expand Down
6 changes: 3 additions & 3 deletions ql/ql/src/codeql_ql/style/DeadCodeQuery.qll
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private AstNode alive() {
or
result instanceof TopLevel // toplevel is always alive.
or
// recurisve cases
// recursive cases
result = aliveStep(alive())
}

Expand Down Expand Up @@ -243,13 +243,13 @@ private AstNode queryable() {
or
result instanceof TopLevel // toplevel is always alive.
or
// recurisve cases
// recursive cases
result = aliveStep(queryable())
}

/**
* Gets an AstNode that does not affect any query result.
* Is interresting as an quick-eval target to investigate dead code.
* Is interesting as an quick-eval target to investigate dead code.
* (It is intentional that this predicate is a result of this predicate).
*/
AstNode unQueryable(string msg) {
Expand Down
2 changes: 1 addition & 1 deletion ql/ql/src/queries/bugs/InconsistentDeprecation.ql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @problem.severity warning
* @id ql/inconsistent-deprecation
* @tags correctness
* maintanability
* maintainability
* @precision very-high
*/

Expand Down
2 changes: 1 addition & 1 deletion ql/ql/src/queries/diagnostics/EmptyConsistencies.ql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @kind problem
* @problem.severity warning
* @precision very-high
* @id ql/diagnostics/empty-consitencies
* @id ql/diagnostics/empty-consistencies
*/

import ql
Expand Down
2 changes: 1 addition & 1 deletion ql/ql/src/queries/style/ConsistentCasing.ql
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ predicate problem(string name1, AstNode node1, string name2, string kind) {
pack2 = pack1.getADependency*() and
name2 = getNameAndPack(_, kind, lower, pack2) and // TODO: Get if it's a dependency pack in the alert-message.
name1 != name2 and
kind != "variable" // these are benign, and plentyful...
kind != "variable" // these are benign, and plentiful...
)
}

Expand Down
2 changes: 1 addition & 1 deletion ql/ql/src/queries/style/MissingOverride.ql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @name Missing override annotation
* @description Predicates that overide another predicate should have an `override` annotation.
* @description Predicates that override another predicate should have an `override` annotation.
* @kind problem
* @problem.severity warning
* @precision very-high
Expand Down
4 changes: 2 additions & 2 deletions ql/ql/src/queries/style/RegexpInsteadOfPattern.ql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @description The `matches` builtin predicate takes a special pattern format as an input, not a regular expression.
* @kind problem
* @problem.severity warning
* @id ql/rexexp-pattern
* @id ql/regex-pattern
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are fine.

* @precision medium
*/

Expand Down Expand Up @@ -33,5 +33,5 @@ where
c.getArgument(0) = arg and
arg.getValue().regexpMatch(getALikelyRegExpPattern())
select c,
"Argument \"$@\" looks like a reguar expression, but will be interpreted as a SQL 'LIKE' pattern.",
"Argument \"$@\" looks like a regular expression, but will be interpreted as a SQL 'LIKE' pattern.",
arg, arg.getValue()
2 changes: 1 addition & 1 deletion ql/ql/src/queries/style/UseInstanceofExtension.ql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @name Suggest using non-extending subtype relationships.
* @description Non-extending subtypes ("instanceof extensions") are generally preferrable to instanceof expressions in characteristic predicates.
* @description Non-extending subtypes ("instanceof extensions") are generally preferable to instanceof expressions in characteristic predicates.
* @kind problem
* @problem.severity warning
* @id ql/suggest-instanceof-extension
Expand Down