Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add analysis timeout parameter #154

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Since CodeChecker-related paths vary greatly between systems, the following sett
| CodeChecker > Editor > Enable CodeLens <br> (default: `on`) | Enable CodeLens for displaying the reproduction path in the editor. |
| CodeChecker > Executor > Enable notifications <br> (default: `on`) | Enable CodeChecker-related toast notifications. |
| CodeChecker > Executor > Executable path <br> (default: `CodeChecker`) | Path to the CodeChecker executable. Can be an executable in the `PATH` environment variable, or an absolute path to one. |
| CodeChecker > Executor > Analysis timeout <br> (default: *60*) | The timeout (in seconds) for each individual analysis run by the CodeChecker analyze command - set to 0 to disable the timeout. |
| CodeChecker > Executor > Thread count <br> (default: *(empty)*) | CodeChecker's thread count - leave empty to use all threads. |
| CodeChecker > Executor > Arguments <br> (default: *(empty)*) | Additional arguments to `CodeChecker analyze`. For example, if you want to use a config file for CodeChecker pass '--config <config.json>'. For supported arguments, run `CodeChecker analyze --help`. <br> *Note:* The resulting command-line can be previewed with the command `CodeChecker: Show full CodeChecker analyze command line`. |
| CodeChecker > Executor > Log build command <br> (default: `make`) | The default build command used when running `CodeChecker log` via commands or tasks. |
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
"minimum": 1,
"order": 5
},
"codechecker.executor.analysisTimeout": {
"type": "number",
"description": "The timeout (in seconds) for each individual analysis run by the CodeChecker analyze command - set to 0 to disable the timeout",
"default": 60,
"order": 6
},
"codechecker.executor.logBuildCommand": {
"type": "string",
"description": "The build command passed to CodeChecker log.",
Expand All @@ -158,7 +164,7 @@
"type": "string",
"description": "The build command passed to CodeChecker log.",
"default": "make",
"order": 6
"order": 7
},
"codechecker.executor.logArguments": {
"type": "string",
Expand All @@ -169,7 +175,7 @@
"type": "string",
"description": "Additional arguments to CodeChecker log command. For supported arguments, run `CodeChecker log --help`. The command `CodeChecker: Preview CodeChecker log in terminal` command shows the resulting command line.",
"default": "",
"order": 7
"order": 8
},
"codechecker.editor.showDatabaseDialog": {
"type": "boolean",
Expand Down
6 changes: 6 additions & 0 deletions src/backend/executor/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ export class ExecutorBridge implements Disposable {
: executorConfig.has('threadCount') ? executorConfig.get<string>('threadCount') : undefined;
// FIXME: Add support for selecting a specific workspace folder

const ccTimeout = workspace.getConfiguration('codechecker.executor').get<number>('analysisTimeout') ?? 0;

const args = [
'analyze',
'--output', reportsFolder
Expand All @@ -206,6 +208,10 @@ export class ExecutorBridge implements Disposable {
args.push('-j', ccThreads);
}

if (ccTimeout > 0) {
args.push('--timeout', ccTimeout.toString());
}

if (this.checkedVersion < [6, 22, 0]) {
const ccCompileCmd = this.getCompileCommandsPath(
files.length
Expand Down
Loading