GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python: Change all remaining occurrences of `StrConst` · github/codeql@1c68c98

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • python/ql
    • examples/snippets
      • raw_string.ql
      • singlequotestring.ql
    • lib
      • analysis
        • DefinitionTracking.qll
      • experimental/cryptography/modules/stdlib
        • HashlibModule.qll
        • HmacModule.qll
      • semmle/python
        • ApiGraphs.qll
        • Concepts.qll
        • Files.qll
        • Module.qll
        • PrintAst.qll
        • Scope.qll
        • Stmts.qll
        • dataflow
          • new
            • BarrierGuards.qll
            • SensitiveDataSources.qll
            • internal
              • Attributes.qll
              • DataFlowPrivate.qll
              • DataFlowPublic.qll
              • ImportResolution.qll
              • MatchUnpacking.qll
              • PrintNode.qll
          • old
            • Implementation.qll
        • frameworks
          • Cryptodome.qll
          • Django.qll
          • FastApi.qll
          • Rsa.qll
          • Stdlib.qll
          • Urllib3.qll
        • objects
          • Constants.qll
          • ObjectAPI.qll
          • TObject.qll
        • pointsto
          • Filters.qll
          • PointsTo.qll
          • PointsToContext.qll
        • regex.qll
        • regexp
          • RegexTreeView.qll
          • internal
            • ParseRegExp.qll
            • RegExpTracking.qll
        • security/dataflow
          • LogInjectionCustomizations.qll
          • PamAuthorizationCustomizations.qll
          • ServerSideRequestForgeryCustomizations.qll
          • TarSlipCustomizations.qll
          • UnsafeShellCommandConstructionCustomizations.qll
          • UrlRedirectCustomizations.qll
        • strings.qll
        • types
          • ModuleKind.qll
          • Object.qll
    • src
      • Expressions
        • DuplicateKeyInDictionaryLiteral.ql
        • Formatting
          • AdvancedFormatting.qll
        • IncorrectComparisonUsingIs.ql
        • IsComparisons.qll
        • UnintentionalImplicitStringConcatenation.ql
        • WrongNumberArgumentsForFormat.ql
      • Imports
        • UnusedImport.ql
      • Security
        • CVE-2018-1281
          • BindToAllInterfaces.ql
        • CWE-020
          • IncompleteUrlSubstringSanitization.ql
        • CWE-798
          • HardcodedCredentials.ql
      • Statements
        • AssertLiteralConstant.ql
        • StatementNoEffect.ql
        • TopLevelPrint.ql
      • Variables
        • Loop.qll
        • MonkeyPatched.qll
        • MultiplyDefined.ql
        • UndefinedExport.ql
        • UnusedModuleVariable.ql
      • experimental
        • Security
          • CWE-287-ConstantSecretKey
            • WebAppConstantSecretKeyFlask.qll
            • WebAppConstantSecretKeySource.qll
          • CWE-287
            • ImproperLdapAuth.ql
          • CWE-327/Azure
            • UnsafeUsageOfClientSideEncryptionVersion.ql
          • CWE-348
            • ClientSuppliedIpUsedInSecurityCheck.ql
            • ClientSuppliedIpUsedInSecurityCheckLib.qll
          • CWE-770
            • UnicodeDoS.ql
        • semmle/python
          • CookieHeader.qll
          • frameworks
            • Django.qll
            • Flask.qll
            • JWT.qll
            • Sendgrid.qll
          • libraries
            • Authlib.qll
            • PyJWT.qll
            • PythonJose.qll
            • Python_JWT.qll
            • SmtpLib.qll
          • security
            • DecompressionBomb.qll
            • LdapInsecureAuth.qll
            • TimingAttack.qll
    • test
      • 2
        • extractor-tests/multibyte
          • Test.ql
        • library-tests/locations
          • general
            • Prefix.ql
          • strings
            • test.ql
      • 3
        • extractor-tests
          • fstrings3.6
            • Formatted.ql
            • Successors.ql
          • fstrings3.8
            • Successors.ql
          • multibyte
            • Test.ql
        • library-tests/locations/general
          • Prefix.ql
      • experimental
        • dataflow
          • testConfig.qll
          • testTaintConfig.qll
        • import-resolution
          • importflow.ql
      • extractor-tests
        • long_string
          • Test.ql
        • string_concatenation
          • StrConst.ql
      • library-tests
        • ApiGraphs/py3
          • verifyApiGraphs.ql
        • exprs/strings
          • Strings.ql
        • locations/implicit_concatenation
          • parts.ql
          • test.ql

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎python/ql/examples/snippets/raw_string.ql‎

Copy file name to clipboardExpand all lines: python/ql/examples/snippets/raw_string.ql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
import python
1010

11-
from StrConst s
11+
from StringLiteral s
1212
where s.getPrefix().matches("%r%")
1313
select s
Collapse file

‎python/ql/examples/snippets/singlequotestring.ql‎

Copy file name to clipboardExpand all lines: python/ql/examples/snippets/singlequotestring.ql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
import python
1111

12-
from StrConst s
12+
from StringLiteral s
1313
where s.getPrefix().charAt(_) = "'"
1414
select s
Collapse file

‎python/ql/lib/analysis/DefinitionTracking.qll‎

Copy file name to clipboardExpand all lines: python/ql/lib/analysis/DefinitionTracking.qll
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ private predicate sets_attribute(ArgumentRefinement def, string name) {
410410
call = def.getDefiningNode() and
411411
call.getFunction().refersTo(Object::builtin("setattr")) and
412412
def.getInput().getAUse() = call.getArg(0) and
413-
call.getArg(1).getNode().(StrConst).getText() = name
413+
call.getArg(1).getNode().(StringLiteral).getText() = name
414414
)
415415
}
416416

Collapse file

‎python/ql/lib/experimental/cryptography/modules/stdlib/HashlibModule.qll‎

Copy file name to clipboardExpand all lines: python/ql/lib/experimental/cryptography/modules/stdlib/HashlibModule.qll
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ module Hashes {
2626
}
2727

2828
override string getName() {
29-
result = super.normalizeName(this.asExpr().(StrConst).getText())
29+
result = super.normalizeName(this.asExpr().(StringLiteral).getText())
3030
or
3131
// if not a known/static string, assume from an outside source and the algorithm is UNKNOWN
32-
not this.asExpr() instanceof StrConst and result = unknownAlgorithm()
32+
not this.asExpr() instanceof StringLiteral and result = unknownAlgorithm()
3333
}
3434
}
3535

@@ -49,10 +49,10 @@ module Hashes {
4949
}
5050

5151
override string getName() {
52-
result = super.normalizeName(this.asExpr().(StrConst).getText())
52+
result = super.normalizeName(this.asExpr().(StringLiteral).getText())
5353
or
5454
// if not a known/static string, assume from an outside source and the algorithm is UNKNOWN
55-
not this.asExpr() instanceof StrConst and result = unknownAlgorithm()
55+
not this.asExpr() instanceof StringLiteral and result = unknownAlgorithm()
5656
}
5757
}
5858

@@ -88,9 +88,9 @@ module Hashes {
8888
// Name is a string constant or consider the name unknown
8989
// NOTE: we are excluding hmac.new and hmac.HMAC constructor calls so we are expecting
9090
// a string or an outside configuration only
91-
result = super.normalizeName(this.asExpr().(StrConst).getText())
91+
result = super.normalizeName(this.asExpr().(StringLiteral).getText())
9292
or
93-
not this.asExpr() instanceof StrConst and
93+
not this.asExpr() instanceof StringLiteral and
9494
result = unknownAlgorithm()
9595
}
9696
}
Collapse file

‎python/ql/lib/experimental/cryptography/modules/stdlib/HmacModule.qll‎

Copy file name to clipboardExpand all lines: python/ql/lib/experimental/cryptography/modules/stdlib/HmacModule.qll
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ module Hashes {
6262
then result = super.normalizeName("MD5")
6363
else (
6464
// Else get the string name, if its a string constant, or UNKNOWN if otherwise
65-
result = super.normalizeName(this.asExpr().(StrConst).getText())
65+
result = super.normalizeName(this.asExpr().(StringLiteral).getText())
6666
or
67-
not this.asExpr() instanceof StrConst and result = unknownAlgorithm()
67+
not this.asExpr() instanceof StringLiteral and result = unknownAlgorithm()
6868
)
6969
}
7070
}
Collapse file

‎python/ql/lib/semmle/python/ApiGraphs.qll‎

Copy file name to clipboardExpand all lines: python/ql/lib/semmle/python/ApiGraphs.qll
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ module API {
257257
*/
258258
Node getSubscript(string key) {
259259
exists(API::Node index | result = this.getSubscriptAt(index) |
260-
key = index.getAValueReachingSink().asExpr().(PY::StrConst).getText()
260+
key = index.getAValueReachingSink().asExpr().(PY::StringLiteral).getText()
261261
)
262262
}
263263

Collapse file

‎python/ql/lib/semmle/python/Concepts.qll‎

Copy file name to clipboardExpand all lines: python/ql/lib/semmle/python/Concepts.qll
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ module Http {
855855

856856
/** Gets the URL pattern for this route, if it can be statically determined. */
857857
string getUrlPattern() {
858-
exists(StrConst str |
858+
exists(StringLiteral str |
859859
this.getUrlPatternArg().getALocalSource() = DataFlow::exprNode(str) and
860860
result = str.getText()
861861
)
@@ -983,7 +983,7 @@ module Http {
983983

984984
/** Gets the mimetype of this HTTP response, if it can be statically determined. */
985985
string getMimetype() {
986-
exists(StrConst str |
986+
exists(StringLiteral str |
987987
this.getMimetypeOrContentTypeArg().getALocalSource() = DataFlow::exprNode(str) and
988988
result = str.getText().splitAt(";", 0)
989989
)
Collapse file

‎python/ql/lib/semmle/python/Files.qll‎

Copy file name to clipboardExpand all lines: python/ql/lib/semmle/python/Files.qll
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class File extends Container, Impl::File {
9393
exists(Stmt s | s.getLocation().getFile() = this)
9494
or
9595
// The file contains the usual `if __name__ == '__main__':` construction
96-
exists(If i, Name name, StrConst main, Cmpop op |
96+
exists(If i, Name name, StringLiteral main, Cmpop op |
9797
i.getScope().(Module).getFile() = this and
9898
op instanceof Eq and
9999
i.getTest().(Compare).compares(name, op, main) and
@@ -123,7 +123,7 @@ private predicate occupied_line(File f, int n) {
123123
exists(Location l | l.getFile() = f |
124124
l.getStartLine() = n
125125
or
126-
exists(StrConst s | s.getLocation() = l | n in [l.getStartLine() .. l.getEndLine()])
126+
exists(StringLiteral s | s.getLocation() = l | n in [l.getStartLine() .. l.getEndLine()])
127127
)
128128
}
129129

Collapse file

‎python/ql/lib/semmle/python/Module.qll‎

Copy file name to clipboardExpand all lines: python/ql/lib/semmle/python/Module.qll
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ class Module extends Module_, Scope, AstNode {
125125
a.getScope() = this and
126126
all.getId() = "__all__" and
127127
(
128-
a.getValue().(List).getAnElt().(StrConst).getText() = name
128+
a.getValue().(List).getAnElt().(StringLiteral).getText() = name
129129
or
130-
a.getValue().(Tuple).getAnElt().(StrConst).getText() = name
130+
a.getValue().(Tuple).getAnElt().(StringLiteral).getText() = name
131131
)
132132
)
133133
}
Collapse file

‎python/ql/lib/semmle/python/PrintAst.qll‎

Copy file name to clipboardExpand all lines: python/ql/lib/semmle/python/PrintAst.qll
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,13 @@ class ParameterNode extends AstElementNode {
423423
}
424424

425425
/**
426-
* A print node for a `StrConst`.
426+
* A print node for a `StringLiteral`.
427427
*
428428
* The string has a child, if the child is used as a regular expression,
429429
* which is the root of the regular expression.
430430
*/
431-
class StrConstNode extends AstElementNode {
432-
override StrConst element;
431+
class StringLiteralNode extends AstElementNode {
432+
override StringLiteral element;
433433
}
434434

435435
/**
@@ -599,7 +599,7 @@ private module PrettyPrinting {
599599
or
600600
result = "class " + a.(Class).getName()
601601
or
602-
result = a.(StrConst).getText()
602+
result = a.(StringLiteral).getText()
603603
or
604604
result = "yield " + a.(Yield).getValue()
605605
or

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.