github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.53k stars 1.5k forks source link

General issue #15391

Open Cheap-Cheer opened 8 months ago

Cheap-Cheer commented 8 months ago

How can I download standard libraries locally? Preferably stored as some sort of structured data, please!

Cheap-Cheer commented 8 months ago

Just like this https://codeql.github.com/codeql-standard-libraries/java/semmle/code/java/frameworks/javaee/Persistence.qll/type.Persistence$AccessAnnotation.html

ginsbach commented 8 months ago

How can I download standard libraries locally? Preferably stored as some sort of structured data, please!

You can get a local copy of the standard libraries by cloning the https://github.com/github/codeql repository.

Just like this https://codeql.github.com/codeql-standard-libraries/java/semmle/code/java/frameworks/javaee/Persistence.qll/type.Persistence$AccessAnnotation.html

This online documentation of the standard libraries is generated from the repository that I mention above.

Cheap-Cheer commented 6 months ago

How can I download standard libraries locally? Preferably stored as some sort of structured data, please!

You can get a local copy of the standard libraries by cloning the https://github.com/github/codeql repository.

Just like this https://codeql.github.com/codeql-standard-libraries/java/semmle/code/java/frameworks/javaee/Persistence.qll/type.Persistence$AccessAnnotation.html

This online documentation of the standard libraries is generated from the repository that I mention above.

Thank you! But the codeql/docs/ql-libraries/ directory only has one folder dataflow and one file in it, where do I need to find the rest?

ginsbach commented 6 months ago

Thank you! But the codeql/docs/ql-libraries/ directory only has one folder dataflow and one file in it, where do I need to find the rest?

The codeql repository contains all the standard libraries. What you are looking for seems to be the documentation for the standard libraries rather than the libraries themselves. That documentation is automatically generated from the .ql and .qll source files in the codeql repository that I linked to.

For example, this documentation file that you linked to to is automatically generated from the declaration of the AccessAnnotation class in the codeql repository:

/**
 * A `@javax.persistence.Access` annotation.
 */
class AccessAnnotation extends Annotation {
  AccessAnnotation() { this.getType().hasQualifiedName("javax.persistence", "Access") }
}
Cheap-Cheer commented 6 months ago

Thank you!