Task   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 25
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 9 2
1
<?php
2
/**
3
 * ownCloud - Files_antivirus
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later.See the COPYING file.
7
 *
8
 * @author Viktar Dubiniuk <[email protected]>
9
 *
10
 * @copyright Viktar Dubiniuk 2015-2018
11
 * @license AGPL-3.0
12
 */
13
14
namespace OCA\Files_Antivirus\Cron;
15
16
use OC\BackgroundJob\TimedJob;
17
use OCA\Files_Antivirus\AppInfo\Application;
18
19
class Task extends TimedJob {
20
21
	/**
22
	 * sets the correct interval for this timed job
23
	 */
24
	public function __construct() {
25
		// Run once per 15 minutes
26
		$this->setInterval(60 * 15);
27
	}
28
29
	/**
30
	 * @param string $argument
31
	 *
32
	 * @return void
33
	 */
34
	protected function run($argument) {
35
		if (!\OCP\App::isEnabled('files_antivirus')) {
36
			return;
37
		}
38
39
		$application = new Application();
40
		$container = $application->getContainer();
41
		$container->query('BackgroundScanner')->run();
42
	}
43
}
44