mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Apply suggestions from code review
Thanks for doing the work for me :-) Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Provides classes modeling security-relevant aspects of the `Psycopg` PyPI package.
|
||||
* Provides classes modeling security-relevant aspects of the `psycopg2` PyPI package.
|
||||
* See
|
||||
* - https://www.psycopg.org/docs/
|
||||
* - https://pypi.org/project/psycopg2/
|
||||
@@ -12,7 +12,7 @@ private import semmle.python.Concepts
|
||||
private import PEP249
|
||||
|
||||
/**
|
||||
* Provides models for the `Psycopg` PyPI package.
|
||||
* Provides models for the `psycopg2` PyPI package.
|
||||
* See
|
||||
* - https://www.psycopg.org/docs/
|
||||
* - https://pypi.org/project/psycopg2/
|
||||
@@ -21,19 +21,19 @@ module Psycopg {
|
||||
// ---------------------------------------------------------------------------
|
||||
// Psycopg
|
||||
// ---------------------------------------------------------------------------
|
||||
/** Gets a reference to the `Psycopg` module. */
|
||||
private DataFlow::Node modulePsycopg(DataFlow::TypeTracker t) {
|
||||
/** Gets a reference to the `psycopg2` module. */
|
||||
private DataFlow::Node psycopg2(DataFlow::TypeTracker t) {
|
||||
t.start() and
|
||||
result = DataFlow::importNode("psycopg2")
|
||||
or
|
||||
exists(DataFlow::TypeTracker t2 | result = modulePsycopg(t2).track(t2, t))
|
||||
exists(DataFlow::TypeTracker t2 | result = psycopg2(t2).track(t2, t))
|
||||
}
|
||||
|
||||
/** Gets a reference to the `Psycopg` module. */
|
||||
DataFlow::Node modulePsycopg() { result = modulePsycopg(DataFlow::TypeTracker::end()) }
|
||||
/** Gets a reference to the `psycopg2` module. */
|
||||
DataFlow::Node psycopg2() { result = psycopg2(DataFlow::TypeTracker::end()) }
|
||||
|
||||
/** Psycopg implements PEP 249, providing ways to execute SQL statements against a database. */
|
||||
/** psycopg2 implements PEP 249, providing ways to execute SQL statements against a database. */
|
||||
class Psycopg extends PEP249Module {
|
||||
Psycopg() { this = modulePsycopg() }
|
||||
Psycopg() { this = psycopg2() }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user