initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
12
github/codeql-action-v1/tests/java-repo/build.gradle
Normal file
12
github/codeql-action-v1/tests/java-repo/build.gradle
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
plugins {
|
||||
id 'application'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass = 'Main'
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
class Main {
|
||||
public static void main(String args[]) {
|
||||
if (true) {
|
||||
System.out.println("Hello, World!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
const mongoose = require('mongoose');
|
||||
|
||||
Logger = require('./logger').Logger;
|
||||
Note = require('./models/note').Note;
|
||||
|
||||
(async () => {
|
||||
if (process.argv.length != 5) {
|
||||
Logger.log("Creates a private note. Usage: node add-note.js <token> <title> <body>")
|
||||
return;
|
||||
}
|
||||
|
||||
// Open the default mongoose connection
|
||||
await mongoose.connect('mongodb://localhost:27017/notes', { useFindAndModify: false });
|
||||
|
||||
const [userToken, title, body] = process.argv.slice(2);
|
||||
await Note.create({ title, body, userToken });
|
||||
|
||||
Logger.log(`Created private note with title ${title} and body ${body} belonging to user with token ${userToken}.`);
|
||||
|
||||
await mongoose.connection.close();
|
||||
})();
|
||||
68
github/codeql-action-v1/tests/ml-powered-queries-repo/app.js
Normal file
68
github/codeql-action-v1/tests/ml-powered-queries-repo/app.js
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
const bodyParser = require('body-parser');
|
||||
const express = require('express');
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
const notesApi = require('./notes-api');
|
||||
const usersApi = require('./users-api');
|
||||
|
||||
const addSampleData = module.exports.addSampleData = async () => {
|
||||
const [userA, userB] = await User.create([
|
||||
{
|
||||
name: "A",
|
||||
token: "tokenA"
|
||||
},
|
||||
{
|
||||
name: "B",
|
||||
token: "tokenB"
|
||||
}
|
||||
]);
|
||||
|
||||
await Note.create([
|
||||
{
|
||||
title: "Public note belonging to A",
|
||||
body: "This is a public note belonging to A",
|
||||
isPublic: true,
|
||||
ownerToken: userA.token
|
||||
},
|
||||
{
|
||||
title: "Public note belonging to B",
|
||||
body: "This is a public note belonging to B",
|
||||
isPublic: true,
|
||||
ownerToken: userB.token
|
||||
},
|
||||
{
|
||||
title: "Private note belonging to A",
|
||||
body: "This is a private note belonging to A",
|
||||
ownerToken: userA.token
|
||||
},
|
||||
{
|
||||
title: "Private note belonging to B",
|
||||
body: "This is a private note belonging to B",
|
||||
ownerToken: userB.token
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
module.exports.startApp = async () => {
|
||||
// Open the default mongoose connection
|
||||
await mongoose.connect('mongodb://mongo:27017/notes', { useFindAndModify: false });
|
||||
// Drop contents of DB
|
||||
mongoose.connection.dropDatabase();
|
||||
// Add some sample data
|
||||
await addSampleData();
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded());
|
||||
|
||||
app.get('/', async (_req, res) => {
|
||||
res.send('Hello World');
|
||||
});
|
||||
|
||||
app.use('/api/notes', notesApi.router);
|
||||
app.use('/api/users', usersApi.router);
|
||||
|
||||
app.listen(3000);
|
||||
Logger.log('Express started on port 3000');
|
||||
};
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
const startApp = require('./app').startApp;
|
||||
|
||||
Logger = require('./logger').Logger;
|
||||
Note = require('./models/note').Note;
|
||||
User = require('./models/user').User;
|
||||
|
||||
startApp();
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
module.exports.Logger = class {
|
||||
log(message, ...objs) {
|
||||
console.log(message, objs);
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
const mongoose = require('mongoose');
|
||||
|
||||
module.exports.Note = mongoose.model('Note', new mongoose.Schema({
|
||||
title: String,
|
||||
body: String,
|
||||
ownerToken: String,
|
||||
isPublic: Boolean
|
||||
}));
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
const mongoose = require('mongoose');
|
||||
|
||||
module.exports.User = mongoose.model('User', new mongoose.Schema({
|
||||
name: String,
|
||||
token: String
|
||||
}));
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
const express = require('express')
|
||||
|
||||
const router = module.exports.router = express.Router();
|
||||
|
||||
function serializeNote(note) {
|
||||
return {
|
||||
title: note.title,
|
||||
body: note.body
|
||||
};
|
||||
}
|
||||
|
||||
router.post('/find', async (req, res) => {
|
||||
const notes = await Note.find({
|
||||
ownerToken: req.body.token
|
||||
}).exec();
|
||||
res.json({
|
||||
notes: notes.map(serializeNote)
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/findPublic', async (_req, res) => {
|
||||
const notes = await Note.find({
|
||||
isPublic: true
|
||||
}).exec();
|
||||
res.json({
|
||||
notes: notes.map(serializeNote)
|
||||
});
|
||||
});
|
||||
|
||||
router.post('/findVisible', async (req, res) => {
|
||||
const notes = await Note.find({
|
||||
$or: [
|
||||
{
|
||||
isPublic: true
|
||||
},
|
||||
{
|
||||
ownerToken: req.body.token
|
||||
}
|
||||
]
|
||||
}).exec();
|
||||
res.json({
|
||||
notes: notes.map(serializeNote)
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
const mongoose = require('mongoose');
|
||||
|
||||
Logger = require('./logger').Logger;
|
||||
Note = require('./models/note').Note;
|
||||
User = require('./models/user').User;
|
||||
|
||||
(async () => {
|
||||
if (process.argv.length != 3) {
|
||||
Logger.log("Outputs all notes visible to a user. Usage: node read-notes.js <token>")
|
||||
return;
|
||||
}
|
||||
|
||||
// Open the default mongoose connection
|
||||
await mongoose.connect('mongodb://localhost:27017/notes', { useFindAndModify: false });
|
||||
|
||||
const ownerToken = process.argv[2];
|
||||
|
||||
const user = await User.findOne({
|
||||
token: ownerToken
|
||||
}).exec();
|
||||
|
||||
const notes = await Note.find({
|
||||
$or: [
|
||||
{ isPublic: true },
|
||||
{ ownerToken }
|
||||
]
|
||||
}).exec();
|
||||
|
||||
notes.map(note => {
|
||||
Logger.log("Title:" + note.title);
|
||||
Logger.log("By:" + user.name);
|
||||
Logger.log("Body:" + note.body);
|
||||
Logger.log();
|
||||
});
|
||||
|
||||
await mongoose.connection.close();
|
||||
})();
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
const express = require('express')
|
||||
|
||||
Logger = require('./logger').Logger;
|
||||
const router = module.exports.router = express.Router();
|
||||
|
||||
router.post('/updateName', async (req, res) => {
|
||||
Logger.log("/updateName called with new name", req.body.name);
|
||||
await User.findOneAndUpdate({
|
||||
token: req.body.token
|
||||
}, {
|
||||
name: req.body.name
|
||||
}).exec();
|
||||
res.json({
|
||||
name: req.body.name
|
||||
});
|
||||
});
|
||||
|
||||
router.post('/getName', async (req, res) => {
|
||||
const user = await User.findOne({
|
||||
token: req.body.token
|
||||
}).exec();
|
||||
res.json({
|
||||
name: user.name
|
||||
});
|
||||
});
|
||||
12
github/codeql-action-v1/tests/multi-language-repo/.github/codeql/codeql-config-packaging.yml
vendored
Normal file
12
github/codeql-action-v1/tests/multi-language-repo/.github/codeql/codeql-config-packaging.yml
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
name: Pack testing in the CodeQL Action
|
||||
|
||||
disable-default-queries: true
|
||||
packs:
|
||||
javascript:
|
||||
- dsp-testing/codeql-pack1@1.0.0
|
||||
- dsp-testing/codeql-pack2
|
||||
- dsp-testing/codeql-pack3:other-query.ql
|
||||
|
||||
paths-ignore:
|
||||
- tests
|
||||
- lib
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
name: Pack testing in the CodeQL Action
|
||||
|
||||
disable-default-queries: true
|
||||
paths-ignore:
|
||||
- tests
|
||||
- lib
|
||||
10
github/codeql-action-v1/tests/multi-language-repo/.github/codeql/codeql-config-packaging3.yml
vendored
Normal file
10
github/codeql-action-v1/tests/multi-language-repo/.github/codeql/codeql-config-packaging3.yml
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
name: Pack testing in the CodeQL Action
|
||||
|
||||
disable-default-queries: true
|
||||
packs:
|
||||
javascript:
|
||||
- dsp-testing/codeql-pack2
|
||||
- dsp-testing/codeql-pack3:other-query.ql
|
||||
paths-ignore:
|
||||
- tests
|
||||
- lib
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
name: "Check SARIF for default queries with Single include, Single exclude"
|
||||
|
||||
query-filters:
|
||||
# This should run js/path-injection and js/zipslip
|
||||
- include:
|
||||
tags contain:
|
||||
- external/cwe/cwe-022
|
||||
|
||||
# Removes js/path-injection
|
||||
- exclude:
|
||||
id:
|
||||
- js/path-injection
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
name: "Check SARIF for query packs with Single include, Single exclude"
|
||||
|
||||
disable-default-queries: true
|
||||
|
||||
packs:
|
||||
javascript:
|
||||
- codeql/javascript-queries
|
||||
- dsp-testing/codeql-pack1@1.0.0
|
||||
|
||||
query-filters:
|
||||
# This should run js/path-injection and js/zipslip
|
||||
- include:
|
||||
tags contain:
|
||||
- external/cwe/cwe-022
|
||||
|
||||
# Removes js/path-injection
|
||||
- exclude:
|
||||
id:
|
||||
- js/path-injection
|
||||
|
||||
# Query from extra pack
|
||||
- include:
|
||||
id:
|
||||
- javascript/example/empty-or-one-block
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
name: "Check SARIF for query packs and local queries with Single include, Single exclude"
|
||||
|
||||
disable-default-queries: true
|
||||
|
||||
queries:
|
||||
# Local query
|
||||
- name: Run an extra local query
|
||||
uses: ./codeql-qlpacks/javascript-qlpack/show_ifs.ql
|
||||
|
||||
# These queries are ignored
|
||||
- name: Ignored queries
|
||||
uses: ./codeql-qlpacks/complex-python-qlpack/rootAndBar.qls
|
||||
|
||||
|
||||
packs:
|
||||
javascript:
|
||||
- codeql/javascript-queries
|
||||
- dsp-testing/codeql-pack1@1.0.0
|
||||
|
||||
query-filters:
|
||||
# This should run js/path-injection and js/zipslip
|
||||
- include:
|
||||
tags contain:
|
||||
- external/cwe/cwe-022
|
||||
|
||||
# Removes js/path-injection
|
||||
- exclude:
|
||||
id:
|
||||
- js/path-injection
|
||||
|
||||
# Query from extra pack
|
||||
- include:
|
||||
id:
|
||||
- javascript/example/empty-or-one-block
|
||||
|
||||
# Local query
|
||||
- include:
|
||||
id:
|
||||
- inrepo-javascript-querypack/show-ifs
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
name: Pack testing in the CodeQL Action
|
||||
|
||||
disable-default-queries: true
|
||||
packs:
|
||||
javascript:
|
||||
- dsp-testing/private-pack
|
||||
- dsp-testing/codeql-pack1
|
||||
29
github/codeql-action-v1/tests/multi-language-repo/.github/codeql/custom-queries.yml
vendored
Normal file
29
github/codeql-action-v1/tests/multi-language-repo/.github/codeql/custom-queries.yml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
name: Use custom queries
|
||||
|
||||
disable-default-queries: true
|
||||
|
||||
queries:
|
||||
# Query suites
|
||||
- name: Select a query suite
|
||||
uses: ./codeql-qlpacks/complex-python-qlpack/rootAndBar.qls
|
||||
# QL pack subset
|
||||
- name: Select a ql file
|
||||
uses: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
|
||||
- name: Select a subfolder
|
||||
uses: ./codeql-qlpacks/complex-javascript-qlpack/foo
|
||||
- name: Select a folder with two subfolders
|
||||
uses: ./codeql-qlpacks/complex-javascript-qlpack/foo2
|
||||
# Inrepo QL pack
|
||||
- name: Select an inrepo ql pack
|
||||
uses: ./codeql-qlpacks/csharp-qlpack
|
||||
- name: Java queries
|
||||
uses: ./codeql-qlpacks/java-qlpack
|
||||
# External QL packs
|
||||
- name: Go queries
|
||||
uses: Anthophila/go-querypack@master
|
||||
- name: Cpp queries
|
||||
uses: Anthophila/cpp-querypack@second-branch
|
||||
- name: JavaScript queries
|
||||
uses: Anthophila/javascript-querypack/show_ifs2.ql@master
|
||||
- name: Python queries
|
||||
uses: Anthophila/python-querypack/show_ifs2.ql@second-branch
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
packs:
|
||||
javascript:
|
||||
- dsp-testing/codeql-pack1@1.0.0
|
||||
- dsp-testing/codeql-pack2
|
||||
ruby:
|
||||
- codeql/ruby-queries
|
||||
|
||||
queries:
|
||||
- uses: ./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql
|
||||
9
github/codeql-action-v1/tests/multi-language-repo/.github/codeql/other-config-properties.yml
vendored
Normal file
9
github/codeql-action-v1/tests/multi-language-repo/.github/codeql/other-config-properties.yml
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
name: Config using all properties
|
||||
|
||||
disable-default-queries: true
|
||||
|
||||
paths-ignore:
|
||||
- xxx
|
||||
|
||||
paths:
|
||||
- yyy
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
packs:
|
||||
javascript:
|
||||
- dsp-testing/codeql-pack1@1.0.0
|
||||
- dsp-testing/codeql-pack2
|
||||
|
||||
queries:
|
||||
- uses: ./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
source "https://rubygems.org" do
|
||||
end
|
||||
|
||||
gem "bundler"
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
|
||||
PLATFORMS
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
bundler (= 2.2.9)
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.9
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
class Main {
|
||||
public static void main(String args[]) {
|
||||
if (true) {
|
||||
System.out.println("Hello, World!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
// swift-tools-version: 5.7
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "helloWorld",
|
||||
products: [
|
||||
// Products define the executables and libraries a package produces, and make them visible to other packages.
|
||||
.library(
|
||||
name: "helloWorld",
|
||||
targets: ["helloWorld"]),
|
||||
],
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
// .package(url: /* package url */, from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||
// Targets can depend on other targets in this package, and on products in packages this package depends on.
|
||||
.target(
|
||||
name: "helloWorld",
|
||||
path: "swift-custom-build/helloWorld"
|
||||
)
|
||||
]
|
||||
)
|
||||
15
github/codeql-action-v1/tests/multi-language-repo/build.sh
Executable file
15
github/codeql-action-v1/tests/multi-language-repo/build.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
gcc -o main main.c
|
||||
|
||||
dotnet build -p:UseSharedCompilation=false
|
||||
|
||||
javac Main.java
|
||||
|
||||
go build main.go
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* || "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
swift build
|
||||
fi
|
||||
|
||||
kotlinc main.kt
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Foo Show Ifs
|
||||
* @description Foo Show Ifs
|
||||
* @kind problem
|
||||
* @id complex-javascript-querypack/foo-show-ifs
|
||||
*/
|
||||
|
||||
import javascript
|
||||
|
||||
from IfStmt i
|
||||
select i, "foo if"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Bar Show Ifs
|
||||
* @description Bar Show Ifs
|
||||
* @kind problem
|
||||
* @id complex-javascript-querypack/bar-ifs
|
||||
*/
|
||||
|
||||
import javascript
|
||||
|
||||
from IfStmt i
|
||||
select i, "bar if"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Barfoobar Show Ifs
|
||||
* @description Barfoobar Show Ifs
|
||||
* @kind problem
|
||||
* @id complex-javascript-querypack/barfoobar-ifs
|
||||
*/
|
||||
|
||||
import javascript
|
||||
|
||||
from IfStmt i
|
||||
select i, "barfoobar if"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Foo2 Show Ifs
|
||||
* @description Foo2 Show Ifs
|
||||
* @kind problem
|
||||
* @id complex-javascript-querypack/foo2-ifs
|
||||
*/
|
||||
|
||||
import javascript
|
||||
|
||||
from IfStmt i
|
||||
select i, "foo2 if"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
name: complex-javascript-querypack
|
||||
version: 0.0.1
|
||||
libraryPathDependencies: codeql-javascript
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Root Show Ifs
|
||||
* @description Root Show Ifs
|
||||
* @kind problem
|
||||
* @id complex-javascript-querypack/root-show-ifs
|
||||
*/
|
||||
|
||||
import javascript
|
||||
|
||||
from IfStmt i
|
||||
select i, "root if"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Foo/Bar Show Ifs
|
||||
* @description Foo/Bar Show Ifs
|
||||
* @kind problem
|
||||
* @id complex-python-querypack/foo/bar/show-ifs
|
||||
*/
|
||||
|
||||
import python
|
||||
|
||||
from If i
|
||||
select i, "foo/bar if"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Foo Show Ifs
|
||||
* @description Foo Show Ifs
|
||||
* @kind problem
|
||||
* @id complex-python-querypack/foo/show-ifs
|
||||
*/
|
||||
|
||||
import python
|
||||
|
||||
from If i
|
||||
select i, "foo if"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
name: inrepo-python-querypack
|
||||
version: 0.0.1
|
||||
libraryPathDependencies: codeql-python
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
- query: show_ifs.ql
|
||||
- query: foo/bar/show_ifs.ql
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Show Ifs
|
||||
* @description Show Ifs
|
||||
* @kind problem
|
||||
* @id complex-python-querypack/show-ifs
|
||||
*/
|
||||
|
||||
import python
|
||||
|
||||
from If i
|
||||
select i, "hello if"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
name: inrepo-cpp-querypack
|
||||
version: 0.0.1
|
||||
libraryPathDependencies: codeql-cpp
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Show Cpp Ifs
|
||||
* @description Show Cpp Ifs
|
||||
* @kind problem
|
||||
* @id inrepo-cpp-querypack/show-ifs
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
from IfStmt i
|
||||
select i, "hello if"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
name: inrepo-csharp-querypack
|
||||
version: 0.0.1
|
||||
libraryPathDependencies: codeql-csharp
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Show Csharp Ifs
|
||||
* @description Show Csharp Ifs
|
||||
* @kind problem
|
||||
* @id inrepo-csharp-querypack/show-ifs
|
||||
*/
|
||||
|
||||
import csharp
|
||||
|
||||
from IfStmt i
|
||||
select i, "hello if"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
name: inrepo-go-querypack
|
||||
version: 0.0.1
|
||||
libraryPathDependencies: codeql-go
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Show Go Ifs
|
||||
* @description Show Go Ifs
|
||||
* @kind problem
|
||||
* @id inrepo-go-querypack/show-ifs
|
||||
*/
|
||||
|
||||
import go
|
||||
|
||||
from IfStmt i
|
||||
select i, "hello if"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
name: inrepo-java-querypack
|
||||
version: 0.0.1
|
||||
libraryPathDependencies: codeql-java
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Show Java Ifs
|
||||
* @description Show Java Ifs
|
||||
* @kind problem
|
||||
* @id inrepo-java-querypack/show-ifs
|
||||
*/
|
||||
|
||||
import java
|
||||
|
||||
from IfStmt i
|
||||
select i, "hello if"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
name: inrepo-javascript-querypack
|
||||
version: 0.0.1
|
||||
libraryPathDependencies: codeql-javascript
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Show JavaScript Ifs
|
||||
* @description Show JavaScript Ifs
|
||||
* @kind problem
|
||||
* @id inrepo-javascript-querypack/show-ifs
|
||||
*/
|
||||
|
||||
import javascript
|
||||
|
||||
from IfStmt i
|
||||
select i, "hello if"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
name: inrepo-python-querypack
|
||||
version: 0.0.1
|
||||
libraryPathDependencies: codeql-python
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @name Show Python Ifs
|
||||
* @description Show Python Ifs
|
||||
* @kind problem
|
||||
* @id inrepo-python-querypack/show-ifs
|
||||
*/
|
||||
|
||||
import python
|
||||
|
||||
from If i
|
||||
select i, "hello if"
|
||||
|
|
@ -0,0 +1,310 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 56;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
46D4896F291B98000029E1E2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D4896E291B98000029E1E2 /* AppDelegate.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
46D4896B291B98000029E1E2 /* codeql-swift-autobuild-test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "codeql-swift-autobuild-test.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
46D4896E291B98000029E1E2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
46D48968291B98000029E1E2 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
46D48962291B98000029E1E2 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
46D4896D291B98000029E1E2 /* codeql-swift-autobuild-test */,
|
||||
46D4896C291B98000029E1E2 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
46D4896C291B98000029E1E2 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
46D4896B291B98000029E1E2 /* codeql-swift-autobuild-test.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
46D4896D291B98000029E1E2 /* codeql-swift-autobuild-test */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
46D4896E291B98000029E1E2 /* AppDelegate.swift */,
|
||||
);
|
||||
path = "codeql-swift-autobuild-test";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
46D4896A291B98000029E1E2 /* codeql-swift-autobuild-test */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 46D4897A291B98020029E1E2 /* Build configuration list for PBXNativeTarget "codeql-swift-autobuild-test" */;
|
||||
buildPhases = (
|
||||
46D48967291B98000029E1E2 /* Sources */,
|
||||
46D48968291B98000029E1E2 /* Frameworks */,
|
||||
46D48969291B98000029E1E2 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "codeql-swift-autobuild-test";
|
||||
productName = "codeql-swift-autobuild-test";
|
||||
productReference = 46D4896B291B98000029E1E2 /* codeql-swift-autobuild-test.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
46D48963291B98000029E1E2 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = 1;
|
||||
LastSwiftUpdateCheck = 1400;
|
||||
LastUpgradeCheck = 1400;
|
||||
TargetAttributes = {
|
||||
46D4896A291B98000029E1E2 = {
|
||||
CreatedOnToolsVersion = 14.0;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 46D48966291B98000029E1E2 /* Build configuration list for PBXProject "codeql-swift-autobuild-test" */;
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 46D48962291B98000029E1E2;
|
||||
productRefGroup = 46D4896C291B98000029E1E2 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
46D4896A291B98000029E1E2 /* codeql-swift-autobuild-test */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
46D48969291B98000029E1E2 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
46D48967291B98000029E1E2 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
46D4896F291B98000029E1E2 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
46D48978291B98020029E1E2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
46D48979291B98020029E1E2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
46D4897B291B98020029E1E2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
INFOPLIST_KEY_NSMainStoryboardFile = Main;
|
||||
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.github.codeql-swift-autobuild-test";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
46D4897C291B98020029E1E2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
INFOPLIST_KEY_NSMainStoryboardFile = Main;
|
||||
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.github.codeql-swift-autobuild-test";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
46D48966291B98000029E1E2 /* Build configuration list for PBXProject "codeql-swift-autobuild-test" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
46D48978291B98020029E1E2 /* Debug */,
|
||||
46D48979291B98020029E1E2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
46D4897A291B98020029E1E2 /* Build configuration list for PBXNativeTarget "codeql-swift-autobuild-test" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
46D4897B291B98020029E1E2 /* Debug */,
|
||||
46D4897C291B98020029E1E2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 46D48963291B98000029E1E2 /* Project object */;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
import Cocoa
|
||||
|
||||
@main
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>multi_language_test</RootNamespace>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);codeql-runner/**</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
8
github/codeql-action-v1/tests/multi-language-repo/main.c
Normal file
8
github/codeql-action-v1/tests/multi-language-repo/main.c
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include "stdio.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (1) {
|
||||
printf("Hello, World!\n");
|
||||
}
|
||||
}
|
||||
|
||||
12
github/codeql-action-v1/tests/multi-language-repo/main.cs
Normal file
12
github/codeql-action-v1/tests/multi-language-repo/main.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
|
||||
namespace HelloWorldApp {
|
||||
class Geeks {
|
||||
static void Main(string[] args) {
|
||||
if (true) {
|
||||
Console.WriteLine("Hello World!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
if true {
|
||||
fmt.Println("hello world")
|
||||
}
|
||||
}
|
||||
12
github/codeql-action-v1/tests/multi-language-repo/main.js
Normal file
12
github/codeql-action-v1/tests/multi-language-repo/main.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
if (true) {
|
||||
console.log("Hello, World!");
|
||||
console.log("Good-bye, World!");
|
||||
}
|
||||
|
||||
if (true) {
|
||||
console.log("Hello, World!");
|
||||
}
|
||||
|
||||
if (true) {
|
||||
// empty
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
fun main() {
|
||||
if (true) {
|
||||
println("Hello, World!")
|
||||
}
|
||||
}
|
||||
9
github/codeql-action-v1/tests/multi-language-repo/main.py
Executable file
9
github/codeql-action-v1/tests/multi-language-repo/main.py
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
def main():
|
||||
if True:
|
||||
print("Hello, World!")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
11
github/codeql-action-v1/tests/multi-language-repo/main.rb
Executable file
11
github/codeql-action-v1/tests/multi-language-repo/main.rb
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
def main
|
||||
v = ARGV[0]
|
||||
|
||||
puts 'with arg?' unless v.nil?
|
||||
puts 'hello there'
|
||||
end
|
||||
|
||||
main
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
public struct main {
|
||||
public private(set) var text = "Hello, World!"
|
||||
|
||||
public init() {
|
||||
if (true) {
|
||||
print(text)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue