Showing 4,504 of 4,504 total issues
Function analyzePhpVersion
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function analyzePhpVersion(array $dependencies) {
$missing = [];
if (isset($dependencies['php']['@attributes']['min-version'])) {
$minVersion = $dependencies['php']['@attributes']['min-version'];
if ($this->compareSmaller($this->platform->getPhpVersion(), $minVersion)) {
- 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 getUidAndFilename
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getUidAndFilename($path) {
list($storage, $internalPath) = $this->rootView->resolvePath($path);
$absMountPoint = $this->rootView->getMountPoint($path);
$parts = \explode('/', $absMountPoint);
- 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 streamCopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function streamCopy($source, $target) {
if (!$source or !$target) {
return [0, false];
}
$bufSize = 8192;
- 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 isAppCompatible
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function isAppCompatible($ocVersion, $appInfo) {
$requireMin = '';
$requireMax = '';
if (isset($appInfo['dependencies']['owncloud']['@attributes']['min-version'])) {
$requireMin = $appInfo['dependencies']['owncloud']['@attributes']['min-version'];
- 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 centerCrop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function centerCrop($size = 0) {
if (!$this->valid()) {
$this->logger->error('OC_Image->centerCrop, No image loaded', ['app' => 'core']);
return false;
}
- 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 updateApp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function updateApp($appId) {
\OC::$server->getAppManager()->clearAppsCache();
$appPath = self::getAppPath($appId);
if ($appPath === false) {
return false;
- 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 setStatus
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function setStatus($status) {
$protocol = \OC::$server->getRequest()->getHttpProtocol();
switch ($status) {
case self::STATUS_NOT_MODIFIED:
$status = $status . ' Not Modified';
- 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 setCorsHeaders
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function setCorsHeaders($userId, $domain, \OCP\IConfig $config = null, array $headers = []) {
if ($config === null) {
$config = \OC::$server->getConfig();
}
// first check if any of the global CORS domains matches
- 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 set
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function set($data) {
if ($data instanceof IImage) {
$img = $data;
$data = $img->data();
} else {
- 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 getSystemInfo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getSystemInfo($allowAllDatabases = false) {
$databases = $this->getSupportedDatabases($allowAllDatabases);
$dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data');
- 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 formatDateSpan
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function formatDateSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null) {
$l = $this->getLocale($l);
$timestamp = $this->getDateTime($timestamp);
$timestamp->setTime(0, 0, 0);
if ($baseTimestamp === null) {
- 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 __construct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
$appName,
IDBConnection $connection,
IOutput $output = null,
AppLocator $appLocator = null,
- 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 loginInOwnCloud
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function loginInOwnCloud($loginType, $user, $password, $options = []) {
$login = $user->getUID();
// check the login policies first. It will throw a LoginException if needed
// The LoginPolicyManager can't be injected due to cyclic dependency
- 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 clearRememberMeTokensForLoggedInUser
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function clearRememberMeTokensForLoggedInUser($targetToken) {
$user = $this->getUser();
$uid = $user->getUID();
if ($targetToken !== null) {
$hashedToken = \hash('snefru', $targetToken);
- 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 getFileSizeViaCurl
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getFileSizeViaCurl($fileName) {
if (\OC::$server->getIniWrapper()->getString('open_basedir') === '') {
$pathParts = \explode('/', $fileName);
$encodedPathParts = \array_map('rawurlencode', $pathParts);
$encodedFileName = \implode('/', $encodedPathParts);
- 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 tryAuthModuleLogin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function tryAuthModuleLogin(IRequest $request) {
foreach ($this->getAuthModules(false) as $authModule) {
$user = $authModule->auth($request);
if ($user !== null) {
if (!$user->isEnabled()) {
- 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 searchInUnicode
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function searchInUnicode($unicodePoint) {
$left = 0;
$right = \count($this->unicodeRanges) - 1;
while ($left <= $right) {
$midpoint = \intval(($left + $right) / 2, 10);
- 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 preLoginNameUsedAsUserName
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function preLoginNameUsedAsUserName($param) {
if (!isset($param['uid'])) {
throw new \Exception('key uid is expected to be set in $param');
}
- 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 handleRepairFeedBack
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function handleRepairFeedBack($event) {
if (!$event instanceof GenericEvent) {
return;
}
switch ($event->getSubject()) {
- 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 execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
$key = $input->getArgument('key');
$value = $input->getArgument('value');
- 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"