File Checker.php
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Roeland Jago Douma <rullzer@owncloud.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
Function generateHashes
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private function generateHashes(
\RecursiveIteratorIterator $iterator,
$path
) {
$hashes = [];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function verify
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function verify($signaturePath, $basePath, $certificateCN, $force = false) {
if (!$force && !$this->isCodeCheckEnforced()) {
return [];
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method verify
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function verify($signaturePath, $basePath, $certificateCN, $force = false) {
if (!$force && !$this->isCodeCheckEnforced()) {
return [];
}
Checker
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Checker {
public const CACHE_KEY = 'oc.integritycheck.checker';
/** @var EnvironmentHelper */
private $environmentHelper;
/** @var AppLocator */
Method generateHashes
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateHashes(
\RecursiveIteratorIterator $iterator,
$path
) {
$hashes = [];
Method verifyAppSignature
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function verifyAppSignature($appId, $path = '', $force = false) {
try {
if ($path === '') {
$path = $this->appLocator->getAppPath($appId);
}
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
EnvironmentHelper $environmentHelper,
FileAccessHelper $fileAccessHelper,
AppLocator $appLocator,
IConfig $config = null,
ICacheFactory $cacheFactory,
Function runInstanceVerification
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function runInstanceVerification() {
$this->cleanResults();
$this->verifyCoreSignature();
// FIXME: appManager === null means ownCloud is not installed. We check all apps in this case
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function verifyAppSignature
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function verifyAppSignature($appId, $path = '', $force = false) {
try {
if ($path === '') {
$path = $this->appLocator->getAppPath($appId);
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"