Showing 3,235 of 4,504 total issues
Method getItemsSharedWithUser
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$itemType,
$user,
$format = self::FORMAT_NONE,
$parameters = null,
$limit = -1,
Avoid deeply nested control flow statements. Open
if ($item['permissions'] & ~$permissions) {
// Add to list of items that need permissions removed
$ids[] = $item['id'];
$parents[] = $item['id'];
}
Method getItemSharedWithBySource
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$itemType,
$itemSource,
$format = self::FORMAT_NONE,
$parameters = null,
$includeCollections = false,
Avoid deeply nested control flow statements. Open
if ($items[$id]['share_type'] != self::SHARE_TYPE_GROUP) {
$items[$id]['share_type'] = self::SHARE_TYPE_GROUP;
$items[$id]['share_with'] = $row['share_with'];
}
Method fixEntryParent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function fixEntryParent(IOutput $out, $storageId, $fileId, $path, $wrongParentId, $parentIdExists = false) {
Function getBackend
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getBackend($itemType) {
$l = \OC::$server->getL10N('lib');
if (isset(self::$backends[$itemType])) {
return self::$backends[$itemType];
} elseif (isset(self::$backendTypes[$itemType]['class'])) {
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
LicenseFetcher $licenseFetcher,
MessageService $messageService,
IAppManager $appManager,
IConfig $config,
ITimeFactory $timeFactory,
Method getSharesBy
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getSharesBy($userId, $shareType, $path = null, $reshares = false, $limit = 50, $offset = 0) {
Method getSharesBy
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset) {
Function resizeAndStore
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function resizeAndStore() {
$image = $this->preview;
if (!($image instanceof IImage)) {
Util::writeLog(
'core',
- 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 getShareById
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getShareById($id, $recipientId = null) {
if (!ctype_digit($id)) {
// share id is defined as a field of type integer
// if someone calls the API asking for a share id like "abc"
// then there is no point trying to query the database,
- 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 unscalable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function unscalable($x, $y) {
$maxX = $this->getMaxX();
$maxY = $this->getMaxY();
$scalingUp = $this->getScalingUp();
$maxScaleFactor = $this->getMaxScaleFactor();
- 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 getDescription
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getDescription($errorCode, $errorObject) {
switch ($errorCode) {
case CodeChecker::STATIC_CALL_NOT_ALLOWED:
$functions = $this->getLocalFunctions();
$functions = \array_change_key_case($functions, CASE_LOWER);
- 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 scale
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function scale($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight) {
$scalingUp = $this->getScalingUp();
$maxScaleFactor = $this->getMaxScaleFactor();
$factorX = $askedWidth / $previewWidth;
- 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 listNotifiers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function listNotifiers() {
if (!empty($this->notifiersInfo)) {
return $this->notifiersInfo;
}
- 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 prepare
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function prepare(INotification $notification, $languageCode) {
$notifiers = $this->getNotifiers();
foreach ($notifiers as $notifier) {
try {
- 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
Avoid deeply nested control flow statements. Open
if (!$officeFound) {
$whichOpenOffice = \shell_exec('command -v openoffice');
$officeFound = !empty($whichOpenOffice);
}
Function getInsecureServerHost
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getInsecureServerHost() {
$host = 'localhost';
if (isset($this->server['HTTP_X_FORWARDED_HOST'])) {
if (\strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
$parts = \explode(',', $this->server['HTTP_X_FORWARDED_HOST']);
- 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
Avoid deeply nested control flow statements. Open
if ($sameNum != 0) {
$bmpData .= \chr($sameNum) . \chr($lastIndex);
}
Function getDisplayName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getDisplayName($uid = null) {
if ($uid) {
$user = \OC::$server->getUserManager()->get($uid);
if ($user) {
return $user->getDisplayName();
- 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"