Swift: rename ugly names in the Function AST hierarchy#12936
Conversation
| private import codeql.swift.elements | ||
| private import codeql.swift.generated.ParentChild | ||
|
|
||
| // Internal classes are not imported by the tests: |
There was a problem hiding this comment.
I didn't manage to amend the ql_test*.mustache templates to output the full import path in case of @ql.internal-marked classes, but that's what should ideally replace this.
MathiasVP
left a comment
There was a problem hiding this comment.
This looks fantastic! I'll give others some time to 👀 the PR as well, but I'm very happy just merging the PR as-is 😄
|
|
||
| class AbstractFunctionDecl(GenericContext, ValueDecl, Callable): | ||
| @group("decl") | ||
| class Function(GenericContext, ValueDecl, Callable): |
|
First commit LGTM (I've only very briefly reviewed the rest of the changes). 👍 |
6667a2b to
91a151e
Compare
|
QHelp previews: swift/ql/src/queries/Security/CWE-135/StringLengthConflation.qhelpString length conflationUsing a length value from an This issue can also arise from using the values of RecommendationUse If you need to convert between ExampleIn the following example, a This is dangerous because, if the input contains certain characters, the range computed on the References
swift/ql/src/queries/Security/CWE-943/PredicateInjection.qhelpPredicate built from user-controlled sourcesPredicates represent logical conditions that can be used to check whether an object matches them. If a predicate is built from user-provided data without sufficient sanitization, an attacker may be able to change the overall meaning of the predicate. RecommendationWhen building a predicate from untrusted data, you should either pass it to the appropriate ExampleIn the following insecure example, A better way to do this is to use the References
|
MathiasVP
left a comment
There was a problem hiding this comment.
LGTM once DCA is happy!
geoffw0
left a comment
There was a problem hiding this comment.
Thanks for spotting the two places where the .qhelp docs needed updating. This is minor and should not need a docs review.
LGTM. 🎉
Rename AST nodes in the Function hierarchy to be more in line with Swift terminology and naming conventions of other QL-supported languages.
The first commit defines the changes, the rest of them are the necessary fixups.